]>
git.tdb.fi Git - libs/core.git/log
Mikko Rasa [Sun, 5 Oct 2014 18:20:48 +0000 (21:20 +0300)]
Make FS::Path::Iterator meet forward iterator requirements
Mikko Rasa [Sun, 5 Oct 2014 10:48:57 +0000 (13:48 +0300)]
Use direct constant values for non-POSIX baud rates
Not all systems (particularly older ones) have #defines for the extended
baud rates, and the standard doesn't provide anything to check their
existence either.
Mikko Rasa [Sun, 5 Oct 2014 10:48:15 +0000 (13:48 +0300)]
Add a missing include
Mikko Rasa [Fri, 27 Jun 2014 16:02:13 +0000 (19:02 +0300)]
Additional baud rates from termios.h
Mikko Rasa [Mon, 6 Jan 2014 19:55:30 +0000 (21:55 +0200)]
Change get_bin_dir logic to assume exe in cwd if not otherwise found
Windows has an implicit . component in $PATH, which can cause programs
started from command line to not find their executable in $PATH. This
fixes the issue, and should not cause undue trouble on other systems.
Mikko Rasa [Mon, 6 Jan 2014 19:53:25 +0000 (21:53 +0200)]
Windows uses ; as separator in $PATH
Mikko Rasa [Mon, 18 Nov 2013 14:41:26 +0000 (16:41 +0200)]
Add RAII class for atomic overwrites
Mikko Rasa [Wed, 6 Nov 2013 09:24:51 +0000 (11:24 +0200)]
Remove a useless const qualifier
Mikko Rasa [Wed, 6 Nov 2013 09:23:31 +0000 (11:23 +0200)]
Add a function to remove an item from a map, checking for existence
Mikko Rasa [Wed, 16 Oct 2013 18:13:16 +0000 (21:13 +0300)]
Set exists to true if the file was found
Mikko Rasa [Tue, 15 Oct 2013 12:46:38 +0000 (15:46 +0300)]
Move Handle::operator void * to the common part
Mikko Rasa [Tue, 15 Oct 2013 12:45:59 +0000 (15:45 +0300)]
Avoid closing handles twice
Mikko Rasa [Tue, 15 Oct 2013 11:53:04 +0000 (14:53 +0300)]
Allow setting a pipe read-only or write-only after creation
This is useful for handing the pipe to a child process and then closing
the unused end so an end-of-file event can be properly received.
Mikko Rasa [Tue, 15 Oct 2013 11:51:52 +0000 (14:51 +0300)]
Interpret POLLHUP as end-of-file
Mikko Rasa [Mon, 14 Oct 2013 19:23:11 +0000 (22:23 +0300)]
Add a Process class for running and interfacing with other programs
Mikko Rasa [Mon, 14 Oct 2013 19:19:16 +0000 (22:19 +0300)]
Add get_handle to Console
This is needed to e.g. redirect cerr to cout.
Mikko Rasa [Sun, 13 Oct 2013 22:06:03 +0000 (01:06 +0300)]
Throw an exception in list_files if the directory can't be opened
Mikko Rasa [Mon, 7 Oct 2013 16:36:04 +0000 (19:36 +0300)]
Rewrite BufferedFile as a standalone class
The generic Filtered template is unable to account for the complexities of
buffering a seekable object. In particular, relative seeks were broken.
I may revisit the template form at a later date if I come up with a
workable design. For now its use is discouraged.
Mikko Rasa [Sat, 5 Oct 2013 12:15:07 +0000 (15:15 +0300)]
Better method of preventing duplicate applications
Application::run can now be called multiple times, but not recursively.
Mikko Rasa [Sat, 5 Oct 2013 12:12:35 +0000 (15:12 +0300)]
Redesign uncaught exception handling to allow external reporters
This helps keep UI code out of the core library. It was becoming a
problem especially on OS X where including an Objective-C wrapper around
NSAlert would have broken Builder's bootstrap. Libmspgui will acquire
a class that will present graphical error dialogs on each platform.
Mikko Rasa [Fri, 4 Oct 2013 21:45:40 +0000 (00:45 +0300)]
Update .gitignore
Mikko Rasa [Fri, 4 Oct 2013 21:44:41 +0000 (00:44 +0300)]
OS X tweaks
Mikko Rasa [Fri, 4 Oct 2013 19:26:07 +0000 (22:26 +0300)]
Move Application member documentation to the header
Mikko Rasa [Tue, 27 Aug 2013 19:39:17 +0000 (22:39 +0300)]
Avoid leaking external references through default c'tors and d'tors
Mikko Rasa [Tue, 27 Aug 2013 19:35:24 +0000 (22:35 +0300)]
Suppress usage errors if help is requested
Mikko Rasa [Mon, 5 Aug 2013 14:38:56 +0000 (17:38 +0300)]
size_t needs <cstddef>
Mikko Rasa [Fri, 31 May 2013 21:56:23 +0000 (00:56 +0300)]
Add RAII utilities
Mikko Rasa [Fri, 24 May 2013 16:29:09 +0000 (19:29 +0300)]
The threads flag is more correct than specifying -lpthread directly
Mikko Rasa [Fri, 24 May 2013 14:45:49 +0000 (17:45 +0300)]
Miscellaneous fixes
Mikko Rasa [Fri, 24 May 2013 14:42:09 +0000 (17:42 +0300)]
Avoid a shadowing warning from clang
It considers the handle member of the outer class to be shadowed by the
parameter of an inner class member function.
Mikko Rasa [Fri, 24 May 2013 14:38:32 +0000 (17:38 +0300)]
Use _FILE_OFFSET_BITS rather than _LARGEFILE64_SOURCE
lseek64 and off64_t are non-portable. This makes the standard lseek use
a 64-bit interface.
Mikko Rasa [Tue, 7 May 2013 13:41:21 +0000 (16:41 +0300)]
Don't output the list of options in usage with full help
Mikko Rasa [Fri, 3 May 2013 09:49:14 +0000 (12:49 +0300)]
Add test cases for path manipulation functions
Mikko Rasa [Fri, 3 May 2013 09:47:51 +0000 (12:47 +0300)]
Throw an exception for nonsensical arguments in some FS functions
Mikko Rasa [Fri, 3 May 2013 09:47:24 +0000 (12:47 +0300)]
Cosmetic fixes for comments and output
Mikko Rasa [Fri, 3 May 2013 09:46:49 +0000 (12:46 +0300)]
Add new test cases to cover positional arguments
Mikko Rasa [Fri, 3 May 2013 09:42:27 +0000 (12:42 +0300)]
Add support for positional arguments in GetOpt
This addresses the issue of any positional arguments recognized by an
application not showing up in the generated help text. It also reduces
the amount of processing and validation required from the application
itself and provides consistent error messages.
Mikko Rasa [Fri, 3 May 2013 09:40:20 +0000 (12:40 +0300)]
Restore the check that list options must take an argument
Mikko Rasa [Thu, 2 May 2013 11:21:19 +0000 (14:21 +0300)]
Restructure internals of GetOpt
Value storage is now handled by a separate class hierarchy, making it more
reusable.
Mikko Rasa [Thu, 2 May 2013 09:58:36 +0000 (12:58 +0300)]
Use a typedef for the option descriptor list
Mikko Rasa [Tue, 30 Apr 2013 12:57:45 +0000 (15:57 +0300)]
Move GetOpt exception handling to the .cpp file
Mikko Rasa [Wed, 24 Apr 2013 13:40:27 +0000 (16:40 +0300)]
Add missing terminator entries to some test data arrays
Mikko Rasa [Wed, 24 Apr 2013 13:22:18 +0000 (16:22 +0300)]
Move most platform-specific code into overlay directories
A few things, in particular FS::Path, were not trivial to split. I'm not
certain what to do with features like zlib either.
Mikko Rasa [Wed, 24 Apr 2013 13:11:11 +0000 (16:11 +0300)]
Clean up after the timedelta.h/units.h merge
Quite a few files were still including units.h, and documentation for
TimeDelta contained a reference to it.
Mikko Rasa [Wed, 24 Apr 2013 13:08:45 +0000 (16:08 +0300)]
Use UInt64 for FileSize
The MSVC define was incorrect anyway.
Mikko Rasa [Tue, 23 Apr 2013 13:42:10 +0000 (16:42 +0300)]
Use the system call name as parameter to system_error
Mikko Rasa [Mon, 22 Apr 2013 10:54:32 +0000 (13:54 +0300)]
Make the Thread state machine more strict
Trying to re-launch a thread after it has finished now throws a
logic_error.
Added a state to indicate the thread having finished.
Mikko Rasa [Sat, 20 Apr 2013 16:37:59 +0000 (19:37 +0300)]
Link examples against the library with a use statement
Mikko Rasa [Sat, 20 Apr 2013 14:47:50 +0000 (17:47 +0300)]
Fix Timer to use is Semaphore correctly
Besides still assuming the old condvar-style semantics, it was also
horribly broken and contained potential deadlocks and race conditions.
Not to mention unusable due to a missing constructor.
Mikko Rasa [Sat, 20 Apr 2013 14:32:04 +0000 (17:32 +0300)]
Avoid an extra copy by making Variant::Store's c'tor take a const ref
Mikko Rasa [Sat, 20 Apr 2013 14:19:55 +0000 (17:19 +0300)]
Add activation check to the rest of Filtered's virtual functions
This fixes a bug manifesting in builder where a put call that triggers a
BufferedFile's buffer flush causes the buffer contents to be written to
the file twice.
Mikko Rasa [Sat, 20 Apr 2013 14:18:23 +0000 (17:18 +0300)]
Encapsulate serial device state into a struct
Mikko Rasa [Sat, 20 Apr 2013 13:07:52 +0000 (16:07 +0300)]
Fix a memory leak in Poller
Mikko Rasa [Sat, 20 Apr 2013 13:05:31 +0000 (16:05 +0300)]
Correct some multiple inclusion guards
Mikko Rasa [Sat, 13 Apr 2013 16:09:52 +0000 (19:09 +0300)]
Fix seeking of Slice
Mikko Rasa [Wed, 27 Mar 2013 19:53:20 +0000 (21:53 +0200)]
Improve file opening on Windows
Handle M_RDWR properly
Allow multiple concurrent readers
Mikko Rasa [Sun, 10 Feb 2013 09:38:20 +0000 (11:38 +0200)]
Move the time constants to timedelta.h
Mikko Rasa [Wed, 16 Jan 2013 16:45:30 +0000 (18:45 +0200)]
Comment changes
Mikko Rasa [Mon, 14 Jan 2013 09:41:34 +0000 (11:41 +0200)]
Fix an overload resolution problem in formatting values for key_error
Mikko Rasa [Sat, 5 Jan 2013 09:39:24 +0000 (11:39 +0200)]
Add a constructor to ZlibCompressed that takes a mode parameter
Mikko Rasa [Mon, 10 Dec 2012 19:49:46 +0000 (21:49 +0200)]
Fix Windows compilation
Mikko Rasa [Sat, 1 Dec 2012 20:59:52 +0000 (22:59 +0200)]
Improve maputils test cases
Mikko Rasa [Sat, 1 Dec 2012 20:58:19 +0000 (22:58 +0200)]
Store the value of the key in key_error
The type of the container is uninformative and often ugly.
Mikko Rasa [Sat, 1 Dec 2012 20:57:35 +0000 (22:57 +0200)]
Throw from LexicalConverter::get if no conversion was performed
Mikko Rasa [Sat, 1 Dec 2012 20:50:39 +0000 (22:50 +0200)]
Filter the types that get fallback lexical conversion operators
Only enable the operators for types that already have iostream formatting
operators defined. Having them exist for everything would interfere with
some other stuff I'm going to commit in a moment.
Mikko Rasa [Sat, 1 Dec 2012 09:27:45 +0000 (11:27 +0200)]
Make lexical_cast symmetric
It has bugged me for a long time that lexical_cast took only the type of
the non-string side as a template argument. Fix it so that it always
takes both target and source types. The source type can be deduced, so
this only requires changes to invocations that cast things to strings.
Mikko Rasa [Thu, 8 Nov 2012 19:51:30 +0000 (21:51 +0200)]
Add an I/O class to access a restricted range of bytes from another object
Mikko Rasa [Sun, 4 Nov 2012 20:44:05 +0000 (22:44 +0200)]
Add a dedicated exception class for a bad seek operation
Mikko Rasa [Sun, 4 Nov 2012 20:36:11 +0000 (22:36 +0200)]
Use native win32 functions for rename and unlink
Mikko Rasa [Sun, 4 Nov 2012 20:35:27 +0000 (22:35 +0200)]
Some fixes for eof handling in Memory
Mikko Rasa [Thu, 27 Sep 2012 22:06:53 +0000 (01:06 +0300)]
Add no-throw destructors to exception classes that were lacking one
Mikko Rasa [Thu, 27 Sep 2012 22:04:31 +0000 (01:04 +0300)]
Add some useful shortcuts for CreateMode combinations
All valid modes can now be referred to with a single enumerator.
C_EXCLUSIVE alone is not valid.
Mikko Rasa [Thu, 27 Sep 2012 22:02:38 +0000 (01:02 +0300)]
Add an exclusive create flag to IO::File
This flag is important in creating temp files, as it allows atomic
creation of a new file. It also completes the set of create modes
available on Win32.
Mikko Rasa [Thu, 27 Sep 2012 20:45:34 +0000 (23:45 +0300)]
Don't report M_RDWR as "generic"
Mikko Rasa [Thu, 27 Sep 2012 20:41:20 +0000 (23:41 +0300)]
Add a mode parameter to Memory constructor with non-const pointers
This makes it possible to explicitly set the mode for a Memory, and in
particular to create a write-only Memory. ZlibCompressed does not work
with M_RDWR so writing compressed data to memory was impossible before
this commit.
Mikko Rasa [Thu, 27 Sep 2012 20:38:10 +0000 (23:38 +0300)]
Don't give out a non-const reference from a const Variant
Mikko Rasa [Sun, 16 Sep 2012 20:39:45 +0000 (23:39 +0300)]
Comment updates
Mikko Rasa [Sun, 16 Sep 2012 20:36:53 +0000 (23:36 +0300)]
Make Profiler able to report number of calls per second
Mikko Rasa [Sun, 16 Sep 2012 20:21:11 +0000 (23:21 +0300)]
Refactor Profiler
Have record() take in a ProfilingScope for easier transport of the
parameters.
Rename scope() to get_scope() since it provides read-only access.
Mikko Rasa [Thu, 13 Sep 2012 21:47:31 +0000 (00:47 +0300)]
Avoid invoking callbacks of a deleted object
Mikko Rasa [Tue, 4 Sep 2012 20:12:37 +0000 (23:12 +0300)]
Fix the name of the UTF-16 codec
Mikko Rasa [Tue, 4 Sep 2012 20:06:57 +0000 (23:06 +0300)]
Disable main() on win32 in favor of WinMain
Mikko Rasa [Tue, 4 Sep 2012 20:06:45 +0000 (23:06 +0300)]
Convert command line arguments on Windows from UTF-16 to UTF-8
Mikko Rasa [Tue, 4 Sep 2012 10:15:46 +0000 (13:15 +0300)]
Add a UTF-16 codec
Mikko Rasa [Tue, 4 Sep 2012 06:46:19 +0000 (09:46 +0300)]
Refuse to encode invalid Unicode characters in UTF-8
Mikko Rasa [Tue, 4 Sep 2012 06:40:53 +0000 (09:40 +0300)]
Let the base classes decide the default error mode
Mikko Rasa [Fri, 3 Aug 2012 08:57:49 +0000 (11:57 +0300)]
The EOF logic wasn't quite correct
If the underlying object reported EOF after reading the last byte, then
ZlibCompressed would report EOF itself before giving out all data from
the buffers.
Mikko Rasa [Thu, 2 Aug 2012 23:46:35 +0000 (02:46 +0300)]
Add support for de/compression with zlib
Mikko Rasa [Wed, 1 Aug 2012 20:43:34 +0000 (23:43 +0300)]
Fix several corner case bugs in lexical_cast
Mikko Rasa [Wed, 1 Aug 2012 20:22:11 +0000 (23:22 +0300)]
Add unit tests for lexical_cast
Mikko Rasa [Wed, 1 Aug 2012 15:01:10 +0000 (18:01 +0300)]
Provide a way to get an integer type matching the size of another type
Mikko Rasa [Wed, 1 Aug 2012 14:30:58 +0000 (17:30 +0300)]
Prefer inttypes.h to doing the #ifdef dance everywhere
Mikko Rasa [Wed, 1 Aug 2012 13:57:37 +0000 (16:57 +0300)]
Exactly-sized integer types, the C++ way
Mikko Rasa [Wed, 1 Aug 2012 08:52:56 +0000 (11:52 +0300)]
Update .gitignore
Mikko Rasa [Thu, 26 Jul 2012 19:32:45 +0000 (22:32 +0300)]
We are no longer compatible with 1.x, so might as well bump the version
Mikko Rasa [Thu, 26 Jul 2012 19:32:11 +0000 (22:32 +0300)]
Update Build for latest changes in Builder
Mikko Rasa [Thu, 26 Jul 2012 19:30:06 +0000 (22:30 +0300)]
Implement Console::get_size on windows
Mikko Rasa [Thu, 26 Jul 2012 19:15:28 +0000 (22:15 +0300)]
Tell the TTY driver to not mess with serial port data
Mikko Rasa [Tue, 10 Jul 2012 09:08:00 +0000 (12:08 +0300)]
Handle c_cc when toggling canonical mode
Mikko Rasa [Tue, 10 Jul 2012 09:02:34 +0000 (12:02 +0300)]
Fix a 64-bit compile error