]> git.tdb.fi Git - libs/core.git/log
libs/core.git
13 months agoMake the ls example print symlink targets
Mikko Rasa [Sun, 3 Sep 2023 22:17:21 +0000 (01:17 +0300)]
Make the ls example print symlink targets

14 months agoAdd a moving overload of insert_unique
Mikko Rasa [Sun, 27 Aug 2023 10:59:18 +0000 (13:59 +0300)]
Add a moving overload of insert_unique

17 months agoAdd move semantics to Variant
Mikko Rasa [Thu, 1 Jun 2023 07:17:56 +0000 (10:17 +0300)]
Add move semantics to Variant

17 months agoAdd a helper function for clearing a Variant
Mikko Rasa [Thu, 1 Jun 2023 06:26:48 +0000 (09:26 +0300)]
Add a helper function for clearing a Variant

21 months agoUpdate .gitignore to include build products on Windows
Mikko Rasa [Wed, 4 Jan 2023 11:04:49 +0000 (13:04 +0200)]
Update .gitignore to include build products on Windows

21 months agoMove accessors of static data members to .cpp files
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.

21 months agoMake Console references static instead of extern
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.

21 months agoAdd a wrapper header for windows.h
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.

21 months agoMake time constants constexpr and move them to the header
Mikko Rasa [Tue, 3 Jan 2023 14:03:19 +0000 (16:03 +0200)]
Make time constants constexpr and move them to the header

21 months agoMove Memory constructors to the .cpp file
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.

21 months agoAdd decorations for things which are considered part of the API
Mikko Rasa [Tue, 3 Jan 2023 00:23:57 +0000 (02:23 +0200)]
Add decorations for things which are considered part of the API

21 months agoFallback to comparing typeid in Variant if funcs are not the same
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.

21 months agoMake lexical conversions from and to long long available everywhere
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__.

22 months agoFix a shadowed variable warning
Mikko Rasa [Wed, 28 Dec 2022 13:00:57 +0000 (15:00 +0200)]
Fix a shadowed variable warning

22 months agoAdd missing override specifiers
Mikko Rasa [Tue, 27 Dec 2022 16:18:08 +0000 (18:18 +0200)]
Add missing override specifiers

22 months agoFix an issue with normalizing paths of the form /foo/..
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.

22 months agoRename Variant's check_type function to has_type
Mikko Rasa [Fri, 23 Dec 2022 12:27:44 +0000 (14:27 +0200)]
Rename Variant's check_type function to has_type

22 months agoRewrite the Variant class
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

22 months agoPartially revert "Use braced initializer lists ..."
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.

22 months agoDelete private data of Process on destruction
Mikko Rasa [Tue, 20 Dec 2022 11:19:53 +0000 (13:19 +0200)]
Delete private data of Process on destruction

22 months agoAdd an algorithm to check for existence of a value in a container
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

22 months agoUse braced initializer lists in place of constructors when possible
Mikko Rasa [Mon, 19 Dec 2022 10:04:20 +0000 (12:04 +0200)]
Use braced initializer lists in place of constructors when possible

22 months agoAdd a few missing default initializers
Mikko Rasa [Mon, 19 Dec 2022 10:02:34 +0000 (12:02 +0200)]
Add a few missing default initializers

22 months agoAdd dllimport to the declaration of getenv_s on Windows
Mikko Rasa [Sun, 11 Dec 2022 09:22:17 +0000 (11:22 +0200)]
Add dllimport to the declaration of getenv_s on Windows

22 months agoAdd missing includes for Windows platform
Mikko Rasa [Sun, 11 Dec 2022 09:19:31 +0000 (11:19 +0200)]
Add missing includes for Windows platform

22 months agoAdjust exception messages
Mikko Rasa [Tue, 6 Dec 2022 23:03:22 +0000 (01:03 +0200)]
Adjust exception messages

22 months agoAdd new exception classes for some common errors
Mikko Rasa [Tue, 6 Dec 2022 23:02:22 +0000 (01:02 +0200)]
Add new exception classes for some common errors

22 months agoModernize noexcept specifiers
Mikko Rasa [Tue, 6 Dec 2022 22:57:52 +0000 (00:57 +0200)]
Modernize noexcept specifiers

23 months agoUse size_t in EventReader
Mikko Rasa [Sun, 27 Nov 2022 13:27:46 +0000 (15:27 +0200)]
Use size_t in EventReader

23 months agoChange Thread::main_wrapper's return value back to 0
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.

2 years agoUse std::less as predicate in algorithms
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.

2 years agoAdd utilities to interface with an attached debugger
Mikko Rasa [Wed, 16 Mar 2022 10:10:40 +0000 (12:10 +0200)]
Add utilities to interface with an attached debugger

2 years agoProduce an octal escape code for \177
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.

2 years agoAdd a flipped operator() to MemberCompare so upper_bound_member can work
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

2 years agoAdd some more hash utility functions
Mikko Rasa [Wed, 17 Nov 2021 12:15:18 +0000 (14:15 +0200)]
Add some more hash utility functions

2 years agoRewrite the hash functions to be more generic
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.

3 years agoMark overridden virtual functions as such
Mikko Rasa [Sun, 31 Oct 2021 18:16:57 +0000 (20:16 +0200)]
Mark overridden virtual functions as such

3 years agoRemove the broken IO::Filtered class
Mikko Rasa [Sun, 31 Oct 2021 18:04:27 +0000 (20:04 +0200)]
Remove the broken IO::Filtered class

3 years agoPass security attributes to the correct argument of CreateFile
Mikko Rasa [Sun, 31 Oct 2021 17:46:51 +0000 (19:46 +0200)]
Pass security attributes to the correct argument of CreateFile

3 years agoAdd some missing includes
Mikko Rasa [Sun, 31 Oct 2021 17:14:33 +0000 (19:14 +0200)]
Add some missing includes

3 years agoCheck for self-assignment in non-trivial assignment operators
Mikko Rasa [Sun, 31 Oct 2021 17:11:04 +0000 (19:11 +0200)]
Check for self-assignment in non-trivial assignment operators

3 years agoUse nullptr instead of 0 for pointers
Mikko Rasa [Sun, 31 Oct 2021 17:09:29 +0000 (19:09 +0200)]
Use nullptr instead of 0 for pointers

3 years agoCheck for closed handles when changing Pipe flags
Mikko Rasa [Sun, 31 Oct 2021 13:12:26 +0000 (15:12 +0200)]
Check for closed handles when changing Pipe flags

3 years agoMark boolean conversion operators as explicit
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.

3 years agoFix JIS X 0208 encoding
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.

3 years agoUpdate naming of internal variables and functions
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.

3 years agoUse size_t to represent sizes
Mikko Rasa [Sun, 31 Oct 2021 11:29:59 +0000 (13:29 +0200)]
Use size_t to represent sizes

3 years agoUse a const variable instead of #define
Mikko Rasa [Sun, 31 Oct 2021 11:29:36 +0000 (13:29 +0200)]
Use a const variable instead of #define

3 years agoRemove unnecessary private copy constructors
Mikko Rasa [Sun, 31 Oct 2021 11:29:06 +0000 (13:29 +0200)]
Remove unnecessary private copy constructors

These classes already inherit NonCopyable.

3 years agoMark constructors and destructors as default where appropriate
Mikko Rasa [Sun, 31 Oct 2021 11:28:41 +0000 (13:28 +0200)]
Mark constructors and destructors as default where appropriate

3 years agoImprove robustness of resolving user/group names in Stat
Mikko Rasa [Sun, 31 Oct 2021 11:26:57 +0000 (13:26 +0200)]
Improve robustness of resolving user/group names in Stat

3 years agoUse default member initializers and constructor delegation
Mikko Rasa [Sun, 31 Oct 2021 11:08:16 +0000 (13:08 +0200)]
Use default member initializers and constructor delegation

3 years agoUse the standard fixed-size integer types directly
Mikko Rasa [Sat, 18 Sep 2021 00:21:18 +0000 (03:21 +0300)]
Use the standard fixed-size integer types directly

3 years agoAdd necessary libraries
Mikko Rasa [Wed, 1 Sep 2021 00:13:32 +0000 (03:13 +0300)]
Add necessary libraries

These are not included by default on MSVC

3 years agoDon't access iterator if it's at end
Mikko Rasa [Wed, 1 Sep 2021 00:13:05 +0000 (03:13 +0300)]
Don't access iterator if it's at end

3 years agoFix incorrect iterator manipulation
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.

3 years agoRetrieve process exit codes on Windows
Mikko Rasa [Mon, 30 Aug 2021 00:21:05 +0000 (03:21 +0300)]
Retrieve process exit codes on Windows

3 years agoUpdate example programs
Mikko Rasa [Sun, 29 Aug 2021 23:49:36 +0000 (02:49 +0300)]
Update example programs

3 years agoAdd platform-specific implemenrations of FS::list_filtered
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.

3 years agoAdd wrappers for environment manipulation functions
Mikko Rasa [Sun, 29 Aug 2021 23:15:57 +0000 (02:15 +0300)]
Add wrappers for environment manipulation functions

3 years agoFix signedness errors from MSVC
Mikko Rasa [Sun, 29 Aug 2021 22:50:13 +0000 (01:50 +0300)]
Fix signedness errors from MSVC

3 years agoAdd a shortcut for transforming a container in-place
Mikko Rasa [Sun, 29 Aug 2021 14:16:04 +0000 (17:16 +0300)]
Add a shortcut for transforming a container in-place

3 years agoFormatting fixes
Mikko Rasa [Sun, 29 Aug 2021 14:15:28 +0000 (17:15 +0300)]
Formatting fixes

3 years agoDeprecate various meta-programming constructs in favor of std ones
Mikko Rasa [Sun, 29 Aug 2021 13:46:48 +0000 (16:46 +0300)]
Deprecate various meta-programming constructs in favor of std ones

3 years agoPrefer more cache-efficient containers
Mikko Rasa [Sun, 29 Aug 2021 13:16:44 +0000 (16:16 +0300)]
Prefer more cache-efficient containers

3 years agoUse C++11 features with containers
Mikko Rasa [Sun, 29 Aug 2021 12:15:50 +0000 (15:15 +0300)]
Use C++11 features with containers

3 years agoUse integer types from <cstdint>
Mikko Rasa [Sun, 29 Aug 2021 10:06:40 +0000 (13:06 +0300)]
Use integer types from <cstdint>

3 years agoRequire C++11 for building
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++.

3 years agoRemove unnecessary std:: qualifiers
Mikko Rasa [Sun, 29 Aug 2021 08:59:32 +0000 (11:59 +0300)]
Remove unnecessary std:: qualifiers

3 years agoUse size_t for sizes in I/O classes
Mikko Rasa [Sun, 29 Aug 2021 08:54:20 +0000 (11:54 +0300)]
Use size_t for sizes in I/O classes

3 years agoRemove deprecated things
Mikko Rasa [Sun, 29 Aug 2021 08:50:29 +0000 (11:50 +0300)]
Remove deprecated things

3 years agoBump version so I can do breaking changes
Mikko Rasa [Sun, 29 Aug 2021 08:45:43 +0000 (11:45 +0300)]
Bump version so I can do breaking changes

3 years agoFix incorrect MSVC check
Mikko Rasa [Sun, 29 Aug 2021 08:18:20 +0000 (11:18 +0300)]
Fix incorrect MSVC check

3 years agoTreat ERROR_BROKEN_PIPE as end-of-file instead of an error
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

3 years agoUse a persistent OVERLAPPED structure in EventReader
Mikko Rasa [Sun, 22 Aug 2021 10:17:08 +0000 (13:17 +0300)]
Use a persistent OVERLAPPED structure in EventReader

3 years agoClose duplicated handles after starting a new process
Mikko Rasa [Sun, 22 Aug 2021 09:41:28 +0000 (12:41 +0300)]
Close duplicated handles after starting a new process

3 years agoEnable inheriting handles in CreateProcess
Mikko Rasa [Sun, 22 Aug 2021 09:39:59 +0000 (12:39 +0300)]
Enable inheriting handles in CreateProcess

3 years agoSkip path lookup if PATH is not set
Mikko Rasa [Sun, 22 Aug 2021 09:37:15 +0000 (12:37 +0300)]
Skip path lookup if PATH is not set

3 years agoUse correct directory separator to check for absolute binary path
Mikko Rasa [Sun, 22 Aug 2021 09:33:32 +0000 (12:33 +0300)]
Use correct directory separator to check for absolute binary path

3 years agoCheck for ERROR_PATH_NOT_FOUND in adition to ERROR_FILE_NOT_FOUND
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

3 years agoFix Path::is_absolute for empty paths on Windows
Mikko Rasa [Sun, 22 Aug 2021 09:18:42 +0000 (12:18 +0300)]
Fix Path::is_absolute for empty paths on Windows

3 years agoAdd equality comparison for Variant
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.

3 years agoAdd TypeRegistry class
Mikko Rasa [Mon, 12 Apr 2021 11:36:12 +0000 (14:36 +0300)]
Add TypeRegistry class

This is basically a generalization of DataFile::LoadableTypeRegistry,
formulated so it isn't associated specifically with Loaders.

3 years agoAdd utility functions to search and sort containers based on a member
Mikko Rasa [Sat, 10 Apr 2021 18:07:14 +0000 (21:07 +0300)]
Add utility functions to search and sort containers based on a member

3 years agoAdd folding functions for hashes
Mikko Rasa [Sat, 3 Apr 2021 15:44:36 +0000 (18:44 +0300)]
Add folding functions for hashes

3 years agoAdd wrappers for lower_bound and upper_bound
Mikko Rasa [Fri, 2 Apr 2021 11:05:04 +0000 (14:05 +0300)]
Add wrappers for lower_bound and upper_bound

3 years agoUse the new utilities to format some strings
Mikko Rasa [Thu, 4 Mar 2021 10:29:09 +0000 (12:29 +0200)]
Use the new utilities to format some strings

3 years agoAdd some utility functions for joining strings
Mikko Rasa [Thu, 4 Mar 2021 10:26:25 +0000 (12:26 +0200)]
Add some utility functions for joining strings

3 years agoNicer formatting of exceptions with multi-line whats
Mikko Rasa [Fri, 19 Feb 2021 23:15:52 +0000 (01:15 +0200)]
Nicer formatting of exceptions with multi-line whats

3 years agoImplement weak pointers
Mikko Rasa [Sat, 6 Feb 2021 11:09:28 +0000 (13:09 +0200)]
Implement weak pointers

3 years agoMove non-oneliner functions out of RefPtr class declaration
Mikko Rasa [Sat, 6 Feb 2021 09:55:56 +0000 (11:55 +0200)]
Move non-oneliner functions out of RefPtr class declaration

3 years agoMove RefPtr refcount into a struct
Mikko Rasa [Sat, 6 Feb 2021 09:51:17 +0000 (11:51 +0200)]
Move RefPtr refcount into a struct

This is necessary to implement weak pointers

4 years agoAdd a refcount function to RefPtr
Mikko Rasa [Mon, 18 May 2020 23:27:15 +0000 (02:27 +0300)]
Add a refcount function to RefPtr

Sometimes it may be useful to check if there are any other users for the
data.

5 years agoCheck that objects still exist when dispatching events to them
Mikko Rasa [Fri, 27 Sep 2019 19:36:09 +0000 (22:36 +0300)]
Check that objects still exist when dispatching events to them

5 years agoAdditional adjustments for Poller
Mikko Rasa [Fri, 27 Sep 2019 19:35:14 +0000 (22:35 +0300)]
Additional adjustments for Poller

5 years agoUse vectors for storage in Poller
Mikko Rasa [Fri, 27 Sep 2019 19:34:05 +0000 (22:34 +0300)]
Use vectors for storage in Poller

5 years agoRefactor signal connection handling in EventDispatcher
Mikko Rasa [Fri, 27 Sep 2019 19:24:07 +0000 (22:24 +0300)]
Refactor signal connection handling in EventDispatcher

Connect the signals to functions on the Slot object to make them easier
to disconnect.

5 years agoAdd RemoveConstReference metaprogamming struct
Mikko Rasa [Fri, 27 Sep 2019 00:05:07 +0000 (03:05 +0300)]
Add RemoveConstReference metaprogamming struct

It combines RemoveConst and RemoveReference but is much shorter

5 years agoAdd FileMonitor stubs for Windows
Mikko Rasa [Wed, 25 Sep 2019 20:42:08 +0000 (23:42 +0300)]
Add FileMonitor stubs for Windows

5 years agoAdd a class for monitoring changes in files
Mikko Rasa [Sat, 21 Sep 2019 15:25:59 +0000 (18:25 +0300)]
Add a class for monitoring changes in files