]>
git.tdb.fi Git - libs/core.git/log
Mikko Rasa [Fri, 6 Sep 2024 11:44:07 +0000 (14:44 +0300)]
Make any_equals take a const reference to the container
Mikko Rasa [Sat, 31 Aug 2024 08:49:42 +0000 (11:49 +0300)]
Make Time::format_now use the local timezone
Mikko Rasa [Tue, 27 Aug 2024 11:51:51 +0000 (14:51 +0300)]
Use unique_ptr to manage owned memory
Required C++ language version is now C++14.
Mikko Rasa [Fri, 29 Dec 2023 22:23:28 +0000 (00:23 +0200)]
Refactor FS::list_files to not use an empty regex
Mikko Rasa [Fri, 29 Dec 2023 20:36:05 +0000 (22:36 +0200)]
Optimize memory accesses in Regex::run
Use a vector instead of a linked list to store execution contexts, and
store matched groups in contiguous memory as well.
Mikko Rasa [Sat, 23 Dec 2023 14:15:29 +0000 (16:15 +0200)]
Export a few low-level symbols which are needed by other libraries
Mikko Rasa [Sat, 16 Sep 2023 09:46:08 +0000 (12:46 +0300)]
Add a function to retrieve temporary directory location
MacOS and Android versions are untested.
Mikko Rasa [Sat, 16 Sep 2023 09:16:39 +0000 (12:16 +0300)]
Recognize CRLF as line terminator in getline
Mikko Rasa [Fri, 15 Sep 2023 21:31:53 +0000 (00:31 +0300)]
Don't try to fetch the value of a nonexistent environment variable
Mikko Rasa [Mon, 11 Sep 2023 08:00:25 +0000 (11:00 +0300)]
Refactor Variant's internals to be compatible with older MSVC versions
Mikko Rasa [Sun, 10 Sep 2023 21:38:34 +0000 (00:38 +0300)]
Use a dynamic buffer when retrieving environment variables on Windows
Mikko Rasa [Sat, 9 Sep 2023 07:41:03 +0000 (10:41 +0300)]
Fix incorrect multiple inclusion guards
Mikko Rasa [Sat, 9 Sep 2023 07:38:43 +0000 (10:38 +0300)]
Use the length result from getenv_s
Mikko Rasa [Sat, 9 Sep 2023 07:37:18 +0000 (10:37 +0300)]
Improvements for empty variants
There's now a function to check if an empty variant holds a value, and
two empty variants will compare as equal.
Mikko Rasa [Wed, 6 Sep 2023 22:02:15 +0000 (01:02 +0300)]
Hide the delegating constructor of ZlibCompressed in the .cpp file
MSVC has trouble with exporting the vftable if the main constructor is
in a .cpp file but the delegating one is not.
Mikko Rasa [Tue, 5 Sep 2023 12:22:03 +0000 (15:22 +0300)]
Export Handle::Private from the library
It's needed by other libraries which implement I/O classes, particularly
mspnet.
Mikko Rasa [Sun, 3 Sep 2023 23:01:06 +0000 (02:01 +0300)]
Fix an error in Stat copy constructor
Mikko Rasa [Sun, 3 Sep 2023 22:44:31 +0000 (01:44 +0300)]
Implement symlink support on Windows
Also avoid lossage when statting reparse points of the appexeclink type.
Mikko Rasa [Sun, 3 Sep 2023 22:17:21 +0000 (01:17 +0300)]
Make the ls example print symlink targets
Mikko Rasa [Sun, 27 Aug 2023 10:59:18 +0000 (13:59 +0300)]
Add a moving overload of insert_unique
Mikko Rasa [Thu, 1 Jun 2023 07:17:56 +0000 (10:17 +0300)]
Add move semantics to Variant
Mikko Rasa [Thu, 1 Jun 2023 06:26:48 +0000 (09:26 +0300)]
Add a helper function for clearing a Variant
Mikko Rasa [Wed, 4 Jan 2023 11:04:49 +0000 (13:04 +0200)]
Update .gitignore to include build products on Windows
Mikko Rasa [Tue, 3 Jan 2023 16:07:33 +0000 (18:07 +0200)]
Move accessors of static data members to .cpp files
Importing data items directly is tricky on MSVC, so better to hide them
behind functions.
Mikko Rasa [Tue, 3 Jan 2023 15:42:11 +0000 (17:42 +0200)]
Make Console references static instead of extern
This avoids unresolved external errors on MSVC. It's not ideal because
every translation unit will have its own copy of the references and
initialize them separately, but the overhead for calling the instance
accessor function is not too large.
Mikko Rasa [Tue, 3 Jan 2023 14:29:47 +0000 (16:29 +0200)]
Add a wrapper header for windows.h
Since Time::min is now defined in the header, it runs afoul of the min()
macro defined in windows.h unless the latter is disabled.
Mikko Rasa [Tue, 3 Jan 2023 14:03:19 +0000 (16:03 +0200)]
Make time constants constexpr and move them to the header
Mikko Rasa [Tue, 3 Jan 2023 13:29:58 +0000 (15:29 +0200)]
Move Memory constructors to the .cpp file
It's causing an undefined reference to vftable if they're in the header.
Mikko Rasa [Tue, 3 Jan 2023 00:23:57 +0000 (02:23 +0200)]
Add decorations for things which are considered part of the API
Mikko Rasa [Mon, 2 Jan 2023 21:38:27 +0000 (23:38 +0200)]
Fallback to comparing typeid in Variant if funcs are not the same
On Windows it looks like instantiations of a function template in
different modules may have different addresses of its static locals.
Mikko Rasa [Sun, 1 Jan 2023 20:20:39 +0000 (22:20 +0200)]
Make lexical conversions from and to long long available everywhere
The type became part of the C++ standard in C++11, so there's no longer
need to guard it with __GNUC__.
Mikko Rasa [Wed, 28 Dec 2022 13:00:57 +0000 (15:00 +0200)]
Fix a shadowed variable warning
Mikko Rasa [Tue, 27 Dec 2022 16:18:08 +0000 (18:18 +0200)]
Add missing override specifiers
Mikko Rasa [Tue, 27 Dec 2022 15:32:24 +0000 (17:32 +0200)]
Fix an issue with normalizing paths of the form /foo/..
The separator indicating the root directory was being incorrectly
removed, resulting in a path denoting the current directory.
Mikko Rasa [Fri, 23 Dec 2022 12:27:44 +0000 (14:27 +0200)]
Rename Variant's check_type function to has_type
Mikko Rasa [Fri, 23 Dec 2022 12:27:01 +0000 (14:27 +0200)]
Rewrite the Variant class
It now uses type erasure and small object optimization
Mikko Rasa [Tue, 20 Dec 2022 23:31:12 +0000 (01:31 +0200)]
Partially revert "Use braced initializer lists ..."
Turns out you can't omit initializers with some members, and
MemberCompare has the predicate as a member.
Mikko Rasa [Tue, 20 Dec 2022 11:19:53 +0000 (13:19 +0200)]
Delete private data of Process on destruction
Mikko Rasa [Mon, 19 Dec 2022 10:06:20 +0000 (12:06 +0200)]
Add an algorithm to check for existence of a value in a container
Mikko Rasa [Mon, 19 Dec 2022 10:04:20 +0000 (12:04 +0200)]
Use braced initializer lists in place of constructors when possible
Mikko Rasa [Mon, 19 Dec 2022 10:02:34 +0000 (12:02 +0200)]
Add a few missing default initializers
Mikko Rasa [Sun, 11 Dec 2022 09:22:17 +0000 (11:22 +0200)]
Add dllimport to the declaration of getenv_s on Windows
Mikko Rasa [Sun, 11 Dec 2022 09:19:31 +0000 (11:19 +0200)]
Add missing includes for Windows platform
Mikko Rasa [Tue, 6 Dec 2022 23:03:22 +0000 (01:03 +0200)]
Adjust exception messages
Mikko Rasa [Tue, 6 Dec 2022 23:02:22 +0000 (01:02 +0200)]
Add new exception classes for some common errors
Mikko Rasa [Tue, 6 Dec 2022 22:57:52 +0000 (00:57 +0200)]
Modernize noexcept specifiers
Mikko Rasa [Sun, 27 Nov 2022 13:27:46 +0000 (15:27 +0200)]
Use size_t in EventReader
Mikko Rasa [Sun, 27 Nov 2022 13:25:38 +0000 (15:25 +0200)]
Change Thread::main_wrapper's return value back to 0
It's a DWORD on Windows, not a pointer.
Mikko Rasa [Wed, 26 Oct 2022 08:52:12 +0000 (11:52 +0300)]
Use std::less as predicate in algorithms
It guarantees a consistent ordering of pointers, unlike the < operator.
Mikko Rasa [Wed, 16 Mar 2022 10:10:40 +0000 (12:10 +0200)]
Add utilities to interface with an attached debugger
Mikko Rasa [Sun, 2 Jan 2022 10:13:04 +0000 (12:13 +0200)]
Produce an octal escape code for \177
This character is designated DEL and should be considered non-printable.
Mikko Rasa [Tue, 23 Nov 2021 08:57:06 +0000 (10:57 +0200)]
Add a flipped operator() to MemberCompare so upper_bound_member can work
Mikko Rasa [Wed, 17 Nov 2021 12:15:18 +0000 (14:15 +0200)]
Add some more hash utility functions
Mikko Rasa [Wed, 17 Nov 2021 12:13:06 +0000 (14:13 +0200)]
Rewrite the hash functions to be more generic
The number of bits is now taken as a template parameter and the hash
size is determined automatically.
Mikko Rasa [Sun, 31 Oct 2021 18:16:57 +0000 (20:16 +0200)]
Mark overridden virtual functions as such
Mikko Rasa [Sun, 31 Oct 2021 18:04:27 +0000 (20:04 +0200)]
Remove the broken IO::Filtered class
Mikko Rasa [Sun, 31 Oct 2021 17:46:51 +0000 (19:46 +0200)]
Pass security attributes to the correct argument of CreateFile
Mikko Rasa [Sun, 31 Oct 2021 17:14:33 +0000 (19:14 +0200)]
Add some missing includes
Mikko Rasa [Sun, 31 Oct 2021 17:11:04 +0000 (19:11 +0200)]
Check for self-assignment in non-trivial assignment operators
Mikko Rasa [Sun, 31 Oct 2021 17:09:29 +0000 (19:09 +0200)]
Use nullptr instead of 0 for pointers
Mikko Rasa [Sun, 31 Oct 2021 13:12:26 +0000 (15:12 +0200)]
Check for closed handles when changing Pipe flags
Mikko Rasa [Sun, 31 Oct 2021 13:05:18 +0000 (15:05 +0200)]
Mark boolean conversion operators as explicit
Also turn const void * operators into actual boolean conversions.
Mikko Rasa [Sun, 31 Oct 2021 12:45:57 +0000 (14:45 +0200)]
Fix JIS X 0208 encoding
This seems to have broken all the way back in
f47bc86 .
Mikko Rasa [Sun, 31 Oct 2021 11:46:57 +0000 (13:46 +0200)]
Update naming of internal variables and functions
In most cases put just an underscore in front (instead of back as it was
previously). When a member name conflicts with a noun function, use m_
prefix.
Mikko Rasa [Sun, 31 Oct 2021 11:29:59 +0000 (13:29 +0200)]
Use size_t to represent sizes
Mikko Rasa [Sun, 31 Oct 2021 11:29:36 +0000 (13:29 +0200)]
Use a const variable instead of #define
Mikko Rasa [Sun, 31 Oct 2021 11:29:06 +0000 (13:29 +0200)]
Remove unnecessary private copy constructors
These classes already inherit NonCopyable.
Mikko Rasa [Sun, 31 Oct 2021 11:28:41 +0000 (13:28 +0200)]
Mark constructors and destructors as default where appropriate
Mikko Rasa [Sun, 31 Oct 2021 11:26:57 +0000 (13:26 +0200)]
Improve robustness of resolving user/group names in Stat
Mikko Rasa [Sun, 31 Oct 2021 11:08:16 +0000 (13:08 +0200)]
Use default member initializers and constructor delegation
Mikko Rasa [Sat, 18 Sep 2021 00:21:18 +0000 (03:21 +0300)]
Use the standard fixed-size integer types directly
Mikko Rasa [Wed, 1 Sep 2021 00:13:32 +0000 (03:13 +0300)]
Add necessary libraries
These are not included by default on MSVC
Mikko Rasa [Wed, 1 Sep 2021 00:13:05 +0000 (03:13 +0300)]
Don't access iterator if it's at end
Mikko Rasa [Wed, 1 Sep 2021 00:12:09 +0000 (03:12 +0300)]
Fix incorrect iterator manipulation
Now that opts is a vector, erase invalidates iterators.
Mikko Rasa [Mon, 30 Aug 2021 00:21:05 +0000 (03:21 +0300)]
Retrieve process exit codes on Windows
Mikko Rasa [Sun, 29 Aug 2021 23:49:36 +0000 (02:49 +0300)]
Update example programs
Mikko Rasa [Sun, 29 Aug 2021 23:38:46 +0000 (02:38 +0300)]
Add platform-specific implemenrations of FS::list_filtered
Microsoft's stdlib does not have opendir and friends.
Mikko Rasa [Sun, 29 Aug 2021 23:15:57 +0000 (02:15 +0300)]
Add wrappers for environment manipulation functions
Mikko Rasa [Sun, 29 Aug 2021 22:50:13 +0000 (01:50 +0300)]
Fix signedness errors from MSVC
Mikko Rasa [Sun, 29 Aug 2021 14:16:04 +0000 (17:16 +0300)]
Add a shortcut for transforming a container in-place
Mikko Rasa [Sun, 29 Aug 2021 14:15:28 +0000 (17:15 +0300)]
Formatting fixes
Mikko Rasa [Sun, 29 Aug 2021 13:46:48 +0000 (16:46 +0300)]
Deprecate various meta-programming constructs in favor of std ones
Mikko Rasa [Sun, 29 Aug 2021 13:16:44 +0000 (16:16 +0300)]
Prefer more cache-efficient containers
Mikko Rasa [Sun, 29 Aug 2021 12:15:50 +0000 (15:15 +0300)]
Use C++11 features with containers
Mikko Rasa [Sun, 29 Aug 2021 10:06:40 +0000 (13:06 +0300)]
Use integer types from <cstdint>
Mikko Rasa [Sun, 29 Aug 2021 09:18:17 +0000 (12:18 +0300)]
Require C++11 for building
In practice this has been a requirement for a while due to libsigc++.
Mikko Rasa [Sun, 29 Aug 2021 08:59:32 +0000 (11:59 +0300)]
Remove unnecessary std:: qualifiers
Mikko Rasa [Sun, 29 Aug 2021 08:54:20 +0000 (11:54 +0300)]
Use size_t for sizes in I/O classes
Mikko Rasa [Sun, 29 Aug 2021 08:50:29 +0000 (11:50 +0300)]
Remove deprecated things
Mikko Rasa [Sun, 29 Aug 2021 08:45:43 +0000 (11:45 +0300)]
Bump version so I can do breaking changes
Mikko Rasa [Sun, 29 Aug 2021 08:18:20 +0000 (11:18 +0300)]
Fix incorrect MSVC check
Mikko Rasa [Sun, 22 Aug 2021 10:19:29 +0000 (13:19 +0300)]
Treat ERROR_BROKEN_PIPE as end-of-file instead of an error
Mikko Rasa [Sun, 22 Aug 2021 10:17:08 +0000 (13:17 +0300)]
Use a persistent OVERLAPPED structure in EventReader
Mikko Rasa [Sun, 22 Aug 2021 09:41:28 +0000 (12:41 +0300)]
Close duplicated handles after starting a new process
Mikko Rasa [Sun, 22 Aug 2021 09:39:59 +0000 (12:39 +0300)]
Enable inheriting handles in CreateProcess
Mikko Rasa [Sun, 22 Aug 2021 09:37:15 +0000 (12:37 +0300)]
Skip path lookup if PATH is not set
Mikko Rasa [Sun, 22 Aug 2021 09:33:32 +0000 (12:33 +0300)]
Use correct directory separator to check for absolute binary path
Mikko Rasa [Sun, 22 Aug 2021 09:26:19 +0000 (12:26 +0300)]
Check for ERROR_PATH_NOT_FOUND in adition to ERROR_FILE_NOT_FOUND
Mikko Rasa [Sun, 22 Aug 2021 09:18:42 +0000 (12:18 +0300)]
Fix Path::is_absolute for empty paths on Windows
Mikko Rasa [Tue, 20 Apr 2021 15:11:45 +0000 (18:11 +0300)]
Add equality comparison for Variant
Besides value comparison, it's also possible to check if two Variant
objects have the same type.