]>
git.tdb.fi Git - libs/datafile.git/log
Mikko Rasa [Wed, 16 Jan 2013 14:01:28 +0000 (16:01 +0200)]
Add an API to open files from a collection's sources
Mikko Rasa [Sat, 5 Jan 2013 11:03:59 +0000 (13:03 +0200)]
Use IO::Slice to constrain access to logical files
Mikko Rasa [Sat, 5 Jan 2013 09:40:42 +0000 (11:40 +0200)]
Pass mode to ZlibCompressed
This makes creating compressed packs work. The temporary file is opened
with M_RDWR because we want to read the data back from the same handle, so
ZlibCompressed can't autodetect the mode.
Mikko Rasa [Fri, 4 Jan 2013 17:29:58 +0000 (19:29 +0200)]
Add a method to filter the files loaded from a pack
Mikko Rasa [Fri, 7 Dec 2012 10:28:15 +0000 (12:28 +0200)]
Add support for fallback collections
Mikko Rasa [Thu, 6 Dec 2012 21:44:11 +0000 (23:44 +0200)]
Some minor fixes in Collection
Move RemoveConst invovations close to the public interface to reduce the
number of template function instantiations.
Correct access specifiers.
Mikko Rasa [Wed, 5 Dec 2012 19:16:00 +0000 (21:16 +0200)]
Rework the list and containment queries
Most of the implementations are now in .cpp, and they should deal better
with base classes.
Mikko Rasa [Wed, 5 Dec 2012 16:57:28 +0000 (18:57 +0200)]
Add some new test cases for Collection
Failures will be fixed a bit later.
Mikko Rasa [Tue, 4 Dec 2012 10:28:24 +0000 (12:28 +0200)]
Restore the check to avoid deletion if an add call fails
It was lost to a careless rewrite in
b1bc256 .
Mikko Rasa [Tue, 4 Dec 2012 09:08:11 +0000 (11:08 +0200)]
Update Collection test cases with source and base class changes
Mikko Rasa [Tue, 4 Dec 2012 08:32:43 +0000 (10:32 +0200)]
More flexible system for handling base classes in Collection
Items are now stored with their original type, but can be retrieved with
a base class as well.
Mikko Rasa [Mon, 3 Dec 2012 21:58:06 +0000 (23:58 +0200)]
Turn internal type helpers into structs
Eliminating access specifiers and dummy constructors reduces clutter, and
in most cases pure virtual functions prevent instantiation anyway. Since
these reside in private or protected sections of other classes, risk of
misuse is negligible.
Mikko Rasa [Mon, 3 Dec 2012 21:20:02 +0000 (23:20 +0200)]
Move most of Collection::get implementation to collection.cpp
Mikko Rasa [Sat, 1 Dec 2012 09:45:04 +0000 (11:45 +0200)]
Use an Fmt object to store the float format
Mikko Rasa [Sat, 1 Dec 2012 09:32:19 +0000 (11:32 +0200)]
Add the target type to lexical_cast invocations
Mikko Rasa [Thu, 15 Nov 2012 21:25:59 +0000 (23:25 +0200)]
Cache filenames in DirectorySource
Mikko Rasa [Thu, 15 Nov 2012 21:03:43 +0000 (23:03 +0200)]
Simplify DirectorySource path management
Mikko Rasa [Thu, 15 Nov 2012 19:04:09 +0000 (21:04 +0200)]
Redesign automatic object loading
Replace the Collection subclasses with a new concept of CollectionSources.
This permits more than one way of loading objects.
Mikko Rasa [Sun, 4 Nov 2012 19:15:40 +0000 (21:15 +0200)]
Fix comment handling
A comment start sequence inside another comment should not change the
comment type.
Mikko Rasa [Sun, 4 Nov 2012 19:15:02 +0000 (21:15 +0200)]
Add a test case for comments
Mikko Rasa [Fri, 28 Sep 2012 23:34:47 +0000 (02:34 +0300)]
Add an intelligent packed collection class
Mikko Rasa [Fri, 28 Sep 2012 23:01:34 +0000 (02:01 +0300)]
Throw an exception if a future object couldn't be created
Mikko Rasa [Fri, 28 Sep 2012 22:55:03 +0000 (01:55 +0300)]
Preserve source declarations when transferring a collection
Optionally print all internal statements (useful to see what's happening
inside a binary datafile).
Mikko Rasa [Fri, 28 Sep 2012 22:54:06 +0000 (01:54 +0300)]
Add a flag to return also internal statements
Mikko Rasa [Fri, 28 Sep 2012 09:11:58 +0000 (12:11 +0300)]
Add a special keyword to terminate parsing
Mikko Rasa [Fri, 28 Sep 2012 09:10:23 +0000 (12:10 +0300)]
Improve the API for future objects
add_future is now documented as ignoring names that don't match any type,
and there's a new function to add future objects with a keyword.
Mikko Rasa [Fri, 28 Sep 2012 09:04:38 +0000 (12:04 +0300)]
Remove the outdated except.h
Mikko Rasa [Thu, 27 Sep 2012 22:31:37 +0000 (01:31 +0300)]
Add a shortcut for wrapping data for a collection file
Collections are part of the library itself, so there's no reason to
require users to write all the boilerplate to do the wrapping.
Mikko Rasa [Thu, 27 Sep 2012 22:24:13 +0000 (01:24 +0300)]
Create writers dynamically and delete them before deleting output
This ensures that the IO objects are destroyed in the correct order, and
filters won't try to access deleted objects.
Mikko Rasa [Thu, 27 Sep 2012 22:15:32 +0000 (01:15 +0300)]
Recognize char pointers as strings
statement.append("literal") was creating a symbol value, which was not
following the principle of least surprise.
Mikko Rasa [Thu, 27 Sep 2012 16:23:58 +0000 (19:23 +0300)]
Restructure the tool and make it able to handle multiple input files
Mikko Rasa [Thu, 27 Sep 2012 13:11:56 +0000 (16:11 +0300)]
Simplify loading collection items
The ItemLoader wrapper from DirectoryCollection can be used in the base
Collection::Loader as well. This removes the need for the kludgy struct
Add and the need for two separate loader functions. As an added bonus,
the ItemLoader can still be used in DirectoryCollection and future derived
classes as well, further reducing duplication.
Mikko Rasa [Wed, 26 Sep 2012 20:29:57 +0000 (23:29 +0300)]
More unit tests for Collection, including contains and future objects
Mikko Rasa [Wed, 26 Sep 2012 20:26:54 +0000 (23:26 +0300)]
Fix some minor mistakes
Mikko Rasa [Wed, 26 Sep 2012 19:18:24 +0000 (22:18 +0300)]
Give DirectoryCollection the ability to add files as future objects
Mikko Rasa [Wed, 26 Sep 2012 18:49:22 +0000 (21:49 +0300)]
Minor reorganization
Mikko Rasa [Wed, 26 Sep 2012 18:36:28 +0000 (21:36 +0300)]
Introduce the concept of future objects
Mikko Rasa [Wed, 26 Sep 2012 16:04:33 +0000 (19:04 +0300)]
Make Collection::contains check for type
Checking item existence without type information is not particularly
useful, since there's no guarantee that the object can be used for its
intended purpose.
Mikko Rasa [Wed, 26 Sep 2012 07:43:01 +0000 (10:43 +0300)]
Improve the documentation of Collection
Mikko Rasa [Thu, 30 Aug 2012 08:35:53 +0000 (11:35 +0300)]
Revert "Convenience function for reporting errors in loaded data"
This reverts commit
b0b9af7216560da2a46ea38fe2df959f4dfb126f .
Why did I even add this function. The Loader catches any exceptions and
rethrows them as data_errors with the correct line number information.
Mikko Rasa [Thu, 30 Aug 2012 08:35:37 +0000 (11:35 +0300)]
Fix some whitespace errors
Mikko Rasa [Tue, 21 Aug 2012 23:15:41 +0000 (02:15 +0300)]
Change DerivedObjectLoader to take the base loader as template argument
This makes it much more versatile, as it can now be used to derive from
a protected loader or one with a nonstandard name.
Mikko Rasa [Sat, 18 Aug 2012 21:16:50 +0000 (00:16 +0300)]
Proper loading of collection-enabled objects in DirectoryCollection
Mikko Rasa [Sat, 18 Aug 2012 21:16:13 +0000 (00:16 +0300)]
Make DirectoryCollection::lookup_file available to derived classes
Mikko Rasa [Fri, 3 Aug 2012 10:06:13 +0000 (13:06 +0300)]
Add support for compressed datafiles
Mikko Rasa [Fri, 3 Aug 2012 09:55:03 +0000 (12:55 +0300)]
Add an abstraction layer for output
Mikko Rasa [Thu, 2 Aug 2012 14:45:00 +0000 (17:45 +0300)]
More senseful validity checks for keyword and string definitions
I don't see how the original conditions could ever have been triggered,
given that arguments are parsed based on the signature, and those of the
built-in statements are fixed.
Mikko Rasa [Thu, 2 Aug 2012 08:11:40 +0000 (11:11 +0300)]
Use custom encoding for floats in binary format
This makes the binary format fully machine-independent, and provides
control over the precision of floating point values.
Mikko Rasa [Wed, 1 Aug 2012 15:52:25 +0000 (18:52 +0300)]
Use negative integers for built-in statements for better extensibility
Mikko Rasa [Wed, 1 Aug 2012 15:46:49 +0000 (18:46 +0300)]
Use Int64 from inttypes.h, and proper defines
Mikko Rasa [Wed, 1 Aug 2012 15:06:31 +0000 (18:06 +0300)]
Recognize floating-point literals with an exponent but no decimal point
Mikko Rasa [Wed, 1 Aug 2012 08:54:14 +0000 (11:54 +0300)]
Update .gitignore
Mikko Rasa [Wed, 1 Aug 2012 08:47:11 +0000 (11:47 +0300)]
Bump version to 2.0 due to incompatible changes
Mikko Rasa [Wed, 1 Aug 2012 08:08:08 +0000 (11:08 +0300)]
Update the Build file with new Builder features
Mikko Rasa [Fri, 20 Jul 2012 20:55:26 +0000 (23:55 +0300)]
Fix tests/Build
Mikko Rasa [Wed, 18 Jul 2012 14:43:19 +0000 (17:43 +0300)]
Add facility for classes to specify what type they should be loaded as
Mikko Rasa [Wed, 18 Jul 2012 13:01:50 +0000 (16:01 +0300)]
Don't use long long on MSVC
Mikko Rasa [Wed, 18 Jul 2012 12:56:42 +0000 (15:56 +0300)]
Use the metadata for type.h in binary write/parse functions
Mikko Rasa [Wed, 18 Jul 2012 12:00:36 +0000 (15:00 +0300)]
Refactor symbol handling in binary format
Mikko Rasa [Wed, 18 Jul 2012 10:09:37 +0000 (13:09 +0300)]
Convenience function for reporting errors in loaded data
Mikko Rasa [Tue, 10 Jul 2012 15:28:11 +0000 (18:28 +0300)]
Add DerivedObjectLoader class
Mikko Rasa [Tue, 17 Apr 2012 09:00:03 +0000 (12:00 +0300)]
Style fixes
Mikko Rasa [Fri, 20 Jan 2012 20:28:06 +0000 (22:28 +0200)]
Add DirectoryCollection class for creating directory-backed collections
Mikko Rasa [Fri, 20 Jan 2012 20:27:43 +0000 (22:27 +0200)]
Allow creator function to return null to indicate failure
Mikko Rasa [Sun, 15 Jan 2012 12:26:05 +0000 (14:26 +0200)]
Fix collection necessity detection
Mikko Rasa [Thu, 8 Sep 2011 07:07:32 +0000 (10:07 +0300)]
Fix pointer loading
Mikko Rasa [Tue, 6 Sep 2011 08:37:57 +0000 (11:37 +0300)]
Fix a stray header name
Mikko Rasa [Wed, 31 Aug 2011 21:43:29 +0000 (00:43 +0300)]
The fs library was absorbed into core
Mikko Rasa [Tue, 26 Jul 2011 10:09:07 +0000 (13:09 +0300)]
Rename CollectionItemType::create method to creator
Mikko Rasa [Mon, 25 Jul 2011 14:55:33 +0000 (17:55 +0300)]
Update .gitignore
Mikko Rasa [Mon, 25 Jul 2011 14:55:27 +0000 (17:55 +0300)]
Add unit tests
Mikko Rasa [Mon, 25 Jul 2011 14:54:16 +0000 (17:54 +0300)]
Redesign the Collection class
Mikko Rasa [Mon, 25 Jul 2011 14:28:18 +0000 (17:28 +0300)]
Exception rework for loader components
Mikko Rasa [Mon, 25 Jul 2011 14:24:22 +0000 (17:24 +0300)]
Update the tool to use the new RegisteredApplication class
Mikko Rasa [Mon, 25 Jul 2011 14:23:33 +0000 (17:23 +0300)]
Remove dependencies on discontinued packages
Mikko Rasa [Mon, 25 Jul 2011 14:20:41 +0000 (17:20 +0300)]
Remove pointer reload prevention feature; the purpose it was added for is now gone
Mikko Rasa [Mon, 25 Jul 2011 14:12:40 +0000 (17:12 +0300)]
Remove deprecated BasicLoader classes
Mikko Rasa [Mon, 25 Jul 2011 14:10:57 +0000 (17:10 +0300)]
Exception rework for parser components
Mikko Rasa [Mon, 25 Jul 2011 14:10:01 +0000 (17:10 +0300)]
Let Variant take care of detecting type mismatches
Mikko Rasa [Mon, 25 Jul 2011 14:07:49 +0000 (17:07 +0300)]
Style update: remove alignment
Mikko Rasa [Mon, 25 Jul 2011 14:02:34 +0000 (17:02 +0300)]
Use the functions from maputils.h in various places
Mikko Rasa [Mon, 25 Jul 2011 09:30:43 +0000 (12:30 +0300)]
Update formatter.h -> format.h
Mikko Rasa [Sat, 25 Jun 2011 13:34:22 +0000 (16:34 +0300)]
Drop copyright and license notices from source files
Mikko Rasa [Sat, 18 Jun 2011 18:31:27 +0000 (21:31 +0300)]
Use IO::BufferedFile instead of separate File and Buffered objects
Mikko Rasa [Sat, 18 Jun 2011 14:04:29 +0000 (17:04 +0300)]
Convert svn:ignore to .gitignore
Mikko Rasa [Wed, 27 Oct 2010 20:24:17 +0000 (20:24 +0000)]
Fix creating Symbols from arbitary types
Allow a few other delimiters in symbols
Allow symbols to begin with a non-alphanumeric if escaped
Fix a bug where another token was accepted immediately after a string
Mikko Rasa [Sun, 26 Sep 2010 09:29:47 +0000 (09:29 +0000)]
Don't throw on empty files
Mikko Rasa [Tue, 23 Feb 2010 14:39:45 +0000 (14:39 +0000)]
Make ignored keywords work properly
Mikko Rasa [Sat, 20 Feb 2010 19:05:09 +0000 (19:05 +0000)]
Add some optional (for now) extra checks for Loader
Remove argument count checks from LoaderActions, the signatures take care of that now
Mikko Rasa [Thu, 4 Feb 2010 17:58:31 +0000 (17:58 +0000)]
Create improvement replacements for BasicLoader* in objectloader.h
Mark the old ones as deprecated
Mikko Rasa [Thu, 4 Feb 2010 13:17:48 +0000 (13:17 +0000)]
Allow overloading keywords with different signatures
Mikko Rasa [Thu, 4 Feb 2010 11:06:40 +0000 (11:06 +0000)]
Some more code reformatting
Remove an old and incomplete file that was not used for anything
Mikko Rasa [Thu, 4 Feb 2010 10:18:10 +0000 (10:18 +0000)]
Rewrite the type system
Values are now stored as native types instead of strings
Value stores its signature instead of an arbitary enum value
Statement can now report its signature directly
Mikko Rasa [Wed, 3 Feb 2010 11:54:06 +0000 (11:54 +0000)]
Style update: add spaces around assignments
Mikko Rasa [Mon, 21 Sep 2009 16:57:45 +0000 (16:57 +0000)]
Bump version to 1.1.1
Update Build file for upcoming Builder release
Mikko Rasa [Mon, 15 Dec 2008 11:49:33 +0000 (11:49 +0000)]
Use lexical_cast instead of istringstream in Value::get
Mikko Rasa [Tue, 14 Oct 2008 15:29:05 +0000 (15:29 +0000)]
Add Changelog.txt
Bump version
Mikko Rasa [Sat, 13 Sep 2008 18:03:04 +0000 (18:03 +0000)]
Emit source file markers in compiled files
Use said markers in reporting errors
Mikko Rasa [Fri, 12 Sep 2008 18:58:06 +0000 (18:58 +0000)]
Add a compile mode to mspdatatool
Mikko Rasa [Fri, 12 Sep 2008 16:07:50 +0000 (16:07 +0000)]
Move mspdatatool source to its own directory
Add an overload of LoaderFunc1 that passes the statement as-is
Make Loader::load(const Statement &) private since it's called through a base class reference now