Commit Graph

34 Commits

Author SHA1 Message Date
Arne Morten Kvarving
670e8b692b changed: don't use parameter names that conflicts with member function names
quells warnings (with gcc 4.8)
2014-05-15 14:46:16 +02:00
Joakim Hove
d5bf1726f2 Verified behaviour of defaults (i.e. *) for multivalued items. 2014-04-11 13:42:22 +02:00
Joakim Hove
f59fd25668 Added boolan flag scalar = true to DeckItem.
The purpose of this flag is to keep track of whether a keyword is
supposed to have only one element, i.e. scalar, or several. The
defaultApplied method only makes sense in the case of scalar items, this
method will now throw if it is called on a non-scalar item.
2014-04-11 13:42:22 +02:00
Joakim Hove
084fc24174 Changed parserItem::scan to return modifyable DeckItem - this is required to push dimension later. 2013-12-14 10:11:59 +01:00
Roland Kaufmann
f8c6bfbaf2 Change unintended compile-time polymorphism to dynamic
equals(ParserIntItem&) has a different signature than equals(ParserItem&),
thus the former method does *not* overload the latter. Virtual just means
then only means that you have created a *new* entry in the v-table. If
you call equals through a pointer/reference to the base class ParserItem,
the defined method in the derived class is not called, and we miss out the
test for the equal default value.

Instead, we should take an argument of the base type and use a dynamic
cast to the derived type. If this downcast fails, then they are not equal;
otherwise we have gotten ourselves a pointer to get the properly typed
default value.

We must use pointers instead of references; if we cast to a reference,
a bad_cast exception is thrown if the expression is not in the proper
type hierarchy.
2013-10-23 20:54:56 +02:00
Joakim Hove
0aa416675a ??? 2013-10-16 09:59:32 +02:00
Joakim Hove
2d68ebe94c Merge remote-tracking branch 'upstream/master' into track-default 2013-10-15 14:24:42 +02:00
Joakim Hove
49ac9f4568 ParserIntItem::scan() implemented with (temporary) specialized code 2013-10-14 21:30:17 +02:00
Joakim Hove
d1f0a9f5f7 Moved some tests around 2013-10-14 14:15:44 +02:00
Joakim Hove
d5b6e84f18 Fixed bug with string items with embedded space - using an ugly template specialization hack 2013-10-09 17:04:08 +02:00
Joakim Hove
0afbcfc6e4 sizeType is default set to SINGLE - and optional in Json config 2013-09-18 07:16:09 +02:00
Joakim Hove
3992a32efc Made sizeType : SINGLE default 2013-09-17 22:27:53 +02:00
Joakim Hove
79a59fc629 Added indent parameter to ParserKeyword::inlineNew() to beautify generated cpp source 2013-09-14 22:14:58 +02:00
Joakim Hove
9bc8090c08 Added parserItem method inlineNew() which will create a cpp source representation of self 2013-09-12 23:50:16 +02:00
Joakim Hove
6d0ed41b29 Added property m_defaultSet to track if the default value has been explicitly set 2013-09-12 12:13:32 +02:00
Joakim Hove
5284b4ff89 Added equal() method for the ParserItem classes 2013-09-12 10:58:44 +02:00
Kristian Flikka
0e5593dc9e Removed removed extra layer of scan / scan__ 2013-08-23 15:45:20 +02:00
Kristian Flikka
cdf16c747a Removed the expectedItems concept from the scan functions 2013-08-23 15:39:08 +02:00
Kristian Flikka
64fb9a6cee Removed expectedItems param from readFromRawRecord method in ParserItem 2013-08-23 14:43:17 +02:00
Kristian Flikka
771167c02e Removed ParserXItem's scan with expected elements. Only SINGLE and ALL is now allowed 2013-08-23 14:35:47 +02:00
Joakim Hove
6c582a4b82 Added JsonConfig constructor to ParserIntItem 2013-07-31 16:15:22 +02:00
Kristian Flikka
5fa04e5377 Added/implemented XStringItem for Parser and Deck, with tests. Added integration test for WWCT keyword. Moved DeckItem tests into type-specific files. Removed unused file. 2013-06-20 13:56:11 +02:00
Kristian Flikka
2cce97f115 Split parser function, to make more modular and testable. Moved integrationtests from ParserTests into Integration tests. 2013-06-18 10:28:30 +02:00
Kristian Flikka
7998a84b81 Made the ParserIntItem's scan return DeckItem, and put a virtual scan in ParserItem. The ParserRecord now has a simple, but functioning parse method 2013-05-24 10:09:59 +02:00
Kristian Flikka
7bfe185998 Started working on the flow RawRecord->ParserRecord->DeckRecord. DeckRecord has some containers now. 2013-05-23 12:42:59 +02:00
Joakim Hove
b6c1da8c17 Rewritten scan functionality to the BaseClass and template functions 2013-05-13 16:41:09 +02:00
Joakim Hove
0524ac040f ParserIntItem can handle sizeType == ALL 2013-05-12 21:38:14 +02:00
Joakim Hove
9e1b00ef63 The ParserIntItem::scan() function will push unused values back on the front of the RawRecord. 2013-05-10 13:56:41 +02:00
Joakim Hove
f516cc6833 Added default value to Parser. Rewrote the ParserIntItem::scan() method to use homemade C-sscanf obscurity from h..l 2013-05-09 14:18:36 +02:00
Joakim Hove
c963c7d768 Changed to use only enum for ItemSize. FIXED -> SCALAR with value 1 2013-05-09 12:17:00 +02:00
Kristian Flikka
a874d667db Added some tests 2013-05-08 15:50:20 +02:00
Kristian Flikka
2a331e1a3a ParserIntItem's scan function now supports ITEM_FIXED parsing 2013-05-08 15:29:58 +02:00
Kristian Flikka
2088c3e96d Simple scan implementation in ParserIntItem added. DeckIntItem now support push_back 2013-05-08 14:31:20 +02:00
Kristian Flikka
2d6e6842d6 Changed ParserItem from template based to a base-inheritance based system. Corresponds to and creates DeckItem objects 2013-05-07 21:55:49 +02:00