From 2517b19673291d9f546588bd8581358049682c8b Mon Sep 17 00:00:00 2001 From: Valentin Noel Date: Mon, 5 Aug 2013 16:59:09 +0200 Subject: [PATCH] move type enums to specReader library issue #31 --- libraries/basicElement/SConscript | 1 + libraries/basicElement/src/Data/Data.cpp | 24 +++--- libraries/basicElement/src/Data/Data.hpp | 4 +- libraries/basicElement/src/Element.cpp | 4 +- libraries/basicElement/src/Element.hpp | 34 +-------- libraries/basicElement/src/Number/Number.tcc | 24 +++--- .../basicElement/tests/element/dataTests.hpp | 52 ++++++------- .../tests/element/numberTests.hpp | 26 +++---- libraries/report/src/Report/ReportNode.hpp | 7 +- libraries/report/src/Transform/Transform.tcc | 34 ++++----- libraries/specReader/src/specDefinition.hpp | 76 +++++++++++++++---- 11 files changed, 152 insertions(+), 134 deletions(-) diff --git a/libraries/basicElement/SConscript b/libraries/basicElement/SConscript index c753dd3..23d39c0 100644 --- a/libraries/basicElement/SConscript +++ b/libraries/basicElement/SConscript @@ -7,6 +7,7 @@ project.StaticLibrary( libraries = [ libs.common, libs.boost_python, + libs.specReader, ], shared = True ) diff --git a/libraries/basicElement/src/Data/Data.cpp b/libraries/basicElement/src/Data/Data.cpp index c8c72b3..099cf1f 100644 --- a/libraries/basicElement/src/Data/Data.cpp +++ b/libraries/basicElement/src/Data/Data.cpp @@ -8,15 +8,15 @@ namespace data_element { Data::Data() - : Element( Element::eTypeData ) + : Element( eTypeData ) , _data( NULL ) { - _subType = Element::eDataTypeRaw; + _subType = eDataTypeRaw; _size = 0; } -Data::Data( const Element::EDataType& subType ) - : Element( Element::eTypeData ) +Data::Data( const EDataType& subType ) + : Element( eTypeData ) , _data( NULL ) { _subType = subType; @@ -158,10 +158,10 @@ std::string Data::getStringFromType() std::string type; switch( getDataSubType() ) { - case Element::eStatusUnknown : type = "unknown"; break; - case Element::eDataTypeAscii : type = "ascii"; break; - case Element::eDataTypeHexa : type = "hexa"; break; - case Element::eDataTypeRaw : type = "raw"; break; + case eStatusUnknown : type = "unknown"; break; + case eDataTypeAscii : type = "ascii"; break; + case eDataTypeHexa : type = "hexa"; break; + case eDataTypeRaw : type = "raw"; break; } return type; } @@ -171,10 +171,10 @@ std::string Data::getStringFromData() std::string data; switch( getDataSubType() ) { - case Element::eStatusUnknown : data = ""; break; - case Element::eDataTypeAscii : data = getAscii(); break; - case Element::eDataTypeHexa : data = getHexa(); break; - case Element::eDataTypeRaw : data = ""; break; + case eStatusUnknown : data = ""; break; + case eDataTypeAscii : data = getAscii(); break; + case eDataTypeHexa : data = getHexa(); break; + case eDataTypeRaw : data = ""; break; } return data; } diff --git a/libraries/basicElement/src/Data/Data.hpp b/libraries/basicElement/src/Data/Data.hpp index 47e095e..5334257 100644 --- a/libraries/basicElement/src/Data/Data.hpp +++ b/libraries/basicElement/src/Data/Data.hpp @@ -12,7 +12,7 @@ class Data : public Element { public: Data(); - Data( const Element::EDataType& subType ); + Data( const EDataType& subType ); ~Data(); void setData ( const char* data, const size_t& size ); @@ -24,7 +24,7 @@ class Data : public Element void setSpecData( const std::string& specValue ); - EStatus checkData(); + Element::EStatus checkData(); std::vector< std::pair< std::string, std::string > > getElementInfo(); Data& operator=( const Data& other ); diff --git a/libraries/basicElement/src/Element.cpp b/libraries/basicElement/src/Element.cpp index 1133d85..6b34dfa 100644 --- a/libraries/basicElement/src/Element.cpp +++ b/libraries/basicElement/src/Element.cpp @@ -25,14 +25,14 @@ void Element::setLabel( const std::string& label ) _label = label; } -Element::ENumberType Element::getNumberSubType() +ENumberType Element::getNumberSubType() { if( _type != eTypeNumber ) return eNumberTypeUnknown; return ( ENumberType ) _subType; } -Element::EDataType Element::getDataSubType() +EDataType Element::getDataSubType() { if( _type != eTypeData ) return eDataTypeUnknown; diff --git a/libraries/basicElement/src/Element.hpp b/libraries/basicElement/src/Element.hpp index 4011cba..0e44ccc 100644 --- a/libraries/basicElement/src/Element.hpp +++ b/libraries/basicElement/src/Element.hpp @@ -3,6 +3,7 @@ #include #include "common.hpp" +#include namespace basic_element { @@ -10,39 +11,6 @@ namespace basic_element class Element { public: - enum EType - { - eTypeUnknown = 0, - eTypeNumber, - eTypeExif, - eTypeData, - eTypeKlv - }; - - enum ENumberType - { - eNumberTypeUnknown = 0, - eNumberTypeInt8, - eNumberTypeUInt8, - eNumberTypeInt16, - eNumberTypeUInt16, - eNumberTypeInt32, - eNumberTypeUInt32, - eNumberTypeInt64, - eNumberTypeUInt64, - eNumberTypeFloat, - eNumberTypeDouble, - eNumberTypeIeeeExtended - }; - - enum EDataType - { - eDataTypeUnknown = 0, - eDataTypeAscii, - eDataTypeHexa, - eDataTypeRaw - }; - enum EStatus { eStatusUnknown = 0, diff --git a/libraries/basicElement/src/Number/Number.tcc b/libraries/basicElement/src/Number/Number.tcc index 533a604..aa69420 100644 --- a/libraries/basicElement/src/Number/Number.tcc +++ b/libraries/basicElement/src/Number/Number.tcc @@ -7,7 +7,7 @@ namespace number_element template< typename NumberType > Number< NumberType >::Number() - : Element( Element::eTypeNumber ) + : Element( eTypeNumber ) { setSubType(); setSize(); @@ -189,37 +189,37 @@ std::string Number< ieeeExtended >::getStringFromType() { return "ieeeExtended"; template< > -void Number< int8 >::setSubType() { _subType = Element::eNumberTypeInt8; } +void Number< int8 >::setSubType() { _subType = eNumberTypeInt8; } template< > -void Number< uint8 >::setSubType() { _subType = Element::eNumberTypeUInt8; } +void Number< uint8 >::setSubType() { _subType = eNumberTypeUInt8; } template< > -void Number< int16 >::setSubType() { _subType = Element::eNumberTypeInt16; } +void Number< int16 >::setSubType() { _subType = eNumberTypeInt16; } template< > -void Number< uint16 >::setSubType() { _subType = Element::eNumberTypeUInt16; } +void Number< uint16 >::setSubType() { _subType = eNumberTypeUInt16; } template< > -void Number< int32 >::setSubType() { _subType = Element::eNumberTypeInt32; } +void Number< int32 >::setSubType() { _subType = eNumberTypeInt32; } template< > -void Number< uint32 >::setSubType() { _subType = Element::eNumberTypeUInt32; } +void Number< uint32 >::setSubType() { _subType = eNumberTypeUInt32; } template< > -void Number< int64 >::setSubType() { _subType = Element::eNumberTypeInt64; } +void Number< int64 >::setSubType() { _subType = eNumberTypeInt64; } template< > -void Number< uint64 >::setSubType() { _subType = Element::eNumberTypeUInt64; } +void Number< uint64 >::setSubType() { _subType = eNumberTypeUInt64; } template< > -void Number< float >::setSubType() { _subType = Element::eNumberTypeFloat; } +void Number< float >::setSubType() { _subType = eNumberTypeFloat; } template< > -void Number< double >::setSubType() { _subType = Element::eNumberTypeDouble; } +void Number< double >::setSubType() { _subType = eNumberTypeDouble; } template< > -void Number< ieeeExtended >::setSubType() { _subType = Element::eNumberTypeIeeeExtended; } +void Number< ieeeExtended >::setSubType() { _subType = eNumberTypeIeeeExtended; } } } diff --git a/libraries/basicElement/tests/element/dataTests.hpp b/libraries/basicElement/tests/element/dataTests.hpp index 068e7aa..022306e 100644 --- a/libraries/basicElement/tests/element/dataTests.hpp +++ b/libraries/basicElement/tests/element/dataTests.hpp @@ -13,7 +13,7 @@ BOOST_AUTO_TEST_CASE( basic_element_data ) BOOST_CHECK_EQUAL( data.getLabel(), label ); } { - dbe::Data data( be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); char buffer[] = { 0x7f, 0x05, 0x32 }; data.setData( buffer, 3 ); @@ -27,14 +27,14 @@ BOOST_AUTO_TEST_CASE( basic_element_data ) BOOST_CHECK_EQUAL( data.getHexa(), "7f0532" ); } { - dbe::Data data( be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); char buffer[] = { 0x48, 0x65, 0x6c, 0x6c, 0x6f }; data.setData( buffer, 5 ); BOOST_CHECK_EQUAL( data.getAscii(), "Hello" ); } { - dbe::Data data( be::Element::eDataTypeRaw ); + dbe::Data data( eDataTypeRaw ); char buffer[] = {'d','a','t','a'}; data.setData( buffer, 4 ); @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE( basic_element_data ) ref.push_back( 32 ); ref.push_back( 255 ); - dbe::Data data( be::Element::eDataTypeRaw ); + dbe::Data data( eDataTypeRaw ); char buffer[ ref.size() ]; for( size_t i = 0; i < ref.size(); i++ ) buffer[i] = ref.at(i); @@ -74,30 +74,30 @@ BOOST_AUTO_TEST_CASE( basic_element_data_hexa ) { LOG_INFO( "\n>>> basic_element_data_hexa <<<" ); { - dbe::Data data( be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusPassOver ); } { - dbe::Data data( be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); data.setSpecData( "ff00" ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusInvalid ); } { - dbe::Data data( be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); data.setSpecData( "ff00" ); char buffer[] = { static_cast< char >( 0xff ), 0x00 }; data.setData( buffer, sizeof( buffer ) ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusValid ); } { - dbe::Data data( be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); data.setSpecData( "ff00" ); char buffer[] = { 0x00, static_cast< char >( 0xff ) }; data.setData( buffer, sizeof( buffer ) ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusInvalid ); } { - dbe::Data data( be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); data.setSpecData( "ff00" ); data.setBigEndianness( false ); char buffer[] = { 0x00, static_cast< char >( 0xff ) }; @@ -110,30 +110,30 @@ BOOST_AUTO_TEST_CASE( basic_element_data_ascii ) { LOG_INFO( "\n>>> basic_element_data_ascii <<<" ); { - dbe::Data data( be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusPassOver ); } { - dbe::Data data( be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); data.setSpecData( "data" ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusInvalid ); } { - dbe::Data data( be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); data.setSpecData( "data" ); char buffer[] = {'d','a','t','a'}; data.setData( buffer, sizeof( buffer ) ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusValid ); } { - dbe::Data data( be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); data.setSpecData( "atad" ); char buffer[] = {'d','a','t','a'}; data.setData( buffer, sizeof( buffer ) ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusInvalid ); } { - dbe::Data data( be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); data.setSpecData( "atad" ); data.setBigEndianness( false ); char buffer[] = {'d','a','t','a'}; @@ -146,12 +146,12 @@ BOOST_AUTO_TEST_CASE( basic_element_data_other ) { LOG_INFO( "\n>>> basic_element_data_other <<<" ); { - dbe::Data data( be::Element::eDataTypeUnknown ); + dbe::Data data( eDataTypeUnknown ); data.setSpecData( "anything" ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusUnknown ); } { - dbe::Data data( be::Element::eDataTypeRaw ); + dbe::Data data( eDataTypeRaw ); data.setSpecData( "lotOfThings" ); BOOST_CHECK_EQUAL( data.checkData(), be::Element::eStatusPassOver ); } @@ -161,25 +161,25 @@ BOOST_AUTO_TEST_CASE( basic_element_data_subType ) { LOG_INFO( "\n>>> basic_element_data_subType <<<" ); { - dbe::Data data( be::Element::eDataTypeUnknown ); - BOOST_CHECK_EQUAL( data.getDataSubType(), be::Element::eDataTypeUnknown ); + dbe::Data data( eDataTypeUnknown ); + BOOST_CHECK_EQUAL( data.getDataSubType(), eDataTypeUnknown ); } { - dbe::Data data( be::Element::eDataTypeHexa ); - BOOST_CHECK_EQUAL( data.getDataSubType(), be::Element::eDataTypeHexa ); + dbe::Data data( eDataTypeHexa ); + BOOST_CHECK_EQUAL( data.getDataSubType(), eDataTypeHexa ); } { - dbe::Data data( be::Element::eDataTypeAscii ); - BOOST_CHECK_EQUAL( data.getDataSubType(), be::Element::eDataTypeAscii ); + dbe::Data data( eDataTypeAscii ); + BOOST_CHECK_EQUAL( data.getDataSubType(), eDataTypeAscii ); } { - dbe::Data data( be::Element::eDataTypeRaw ); - BOOST_CHECK_EQUAL( data.getDataSubType(), be::Element::eDataTypeRaw ); + dbe::Data data( eDataTypeRaw ); + BOOST_CHECK_EQUAL( data.getDataSubType(), eDataTypeRaw ); } { - dbe::Data data( be::Element::eDataTypeRaw ); - BOOST_CHECK_EQUAL( data.getNumberSubType(), be::Element::eNumberTypeUnknown ); + dbe::Data data( eDataTypeRaw ); + BOOST_CHECK_EQUAL( data.getNumberSubType(), eNumberTypeUnknown ); } } diff --git a/libraries/basicElement/tests/element/numberTests.hpp b/libraries/basicElement/tests/element/numberTests.hpp index 2ac7f6f..f022ddf 100644 --- a/libraries/basicElement/tests/element/numberTests.hpp +++ b/libraries/basicElement/tests/element/numberTests.hpp @@ -83,7 +83,7 @@ BOOST_AUTO_TEST_CASE( basic_element_number ) map.insert( std::pair< nbe::uint8, std::string >( 3, "Third number" ) ); { - BOOST_CHECK_EQUAL( num.getType(), be::Element::eTypeNumber ); + BOOST_CHECK_EQUAL( num.getType(), eTypeNumber ); BOOST_CHECK_EQUAL( num.getStatus(), be::Element::eStatusUnknown ); num.setId( id ); @@ -621,52 +621,52 @@ BOOST_AUTO_TEST_CASE( basic_element_number_subType ) LOG_INFO( "\n>>> basic_element_number_subType <<<" ); { nbe::Number< nbe::int8 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeInt8 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeInt8 ); } { nbe::Number< nbe::uint8 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeUInt8 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeUInt8 ); } { nbe::Number< nbe::int16 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeInt16 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeInt16 ); } { nbe::Number< nbe::uint16 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeUInt16 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeUInt16 ); } { nbe::Number< nbe::int32 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeInt32 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeInt32 ); } { nbe::Number< nbe::uint32 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeUInt32 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeUInt32 ); } { nbe::Number< nbe::int64 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeInt64 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeInt64 ); } { nbe::Number< nbe::uint64 > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeUInt64 ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeUInt64 ); } { nbe::Number< float > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeFloat ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeFloat ); } { nbe::Number< double > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeDouble ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeDouble ); } { nbe::Number< nbe::ieeeExtended > num; - BOOST_CHECK_EQUAL( num.getNumberSubType(), be::Element::eNumberTypeIeeeExtended ); + BOOST_CHECK_EQUAL( num.getNumberSubType(), eNumberTypeIeeeExtended ); } { nbe::Number< nbe::int8 > num; - BOOST_CHECK_EQUAL( num.getDataSubType(), be::Element::eDataTypeUnknown ); + BOOST_CHECK_EQUAL( num.getDataSubType(), eDataTypeUnknown ); } } diff --git a/libraries/report/src/Report/ReportNode.hpp b/libraries/report/src/Report/ReportNode.hpp index 9cfa1b9..f25b390 100644 --- a/libraries/report/src/Report/ReportNode.hpp +++ b/libraries/report/src/Report/ReportNode.hpp @@ -5,12 +5,11 @@ #include +static const std::string kReport = "report"; + namespace be = basic_element; namespace bpt = boost::property_tree; -static const std::string kGroup = "group"; -static const std::string kReport = "report"; - namespace report_generator { @@ -39,4 +38,4 @@ class ReportNode } -#endif \ No newline at end of file +#endif diff --git a/libraries/report/src/Transform/Transform.tcc b/libraries/report/src/Transform/Transform.tcc index 9c8f5d3..83e05d5 100644 --- a/libraries/report/src/Transform/Transform.tcc +++ b/libraries/report/src/Transform/Transform.tcc @@ -61,28 +61,28 @@ bpt::ptree Transform::extractElement( std::shared_ptr< be::Element > element ) switch( element->getType() ) { - case be::Element::eTypeUnknown : LOG_WARNING( "Element " << element->getUniqueId() << ": unknown type." ); break; - case be::Element::eTypeNumber : + case eTypeUnknown : LOG_WARNING( "Element " << element->getUniqueId() << ": unknown type." ); break; + case eTypeNumber : { switch( element->getNumberSubType() ) { - case be::Element::eNumberTypeUnknown : LOG_WARNING( "Number " << element->getUniqueId() << ": unknown type." ); break; - case be::Element::eNumberTypeInt8 : elemInfo = translateElement< ben::Number< ben::int8 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeUInt8 : elemInfo = translateElement< ben::Number< ben::uint8 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeInt16 : elemInfo = translateElement< ben::Number< ben::int16 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeUInt16 : elemInfo = translateElement< ben::Number< ben::uint16 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeInt32 : elemInfo = translateElement< ben::Number< ben::int32 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeUInt32 : elemInfo = translateElement< ben::Number< ben::uint32 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeInt64 : elemInfo = translateElement< ben::Number< ben::int64 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeUInt64 : elemInfo = translateElement< ben::Number< ben::uint64 > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeFloat : elemInfo = translateElement< ben::Number< float > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeDouble : elemInfo = translateElement< ben::Number< double > >( element )->getElementInfo(); break; - case be::Element::eNumberTypeIeeeExtended : elemInfo = translateElement< ben::Number< ben::ieeeExtended > >( element )->getElementInfo(); break; + case eNumberTypeUnknown : LOG_WARNING( "Number " << element->getUniqueId() << ": unknown type." ); break; + case eNumberTypeInt8 : elemInfo = translateElement< ben::Number< ben::int8 > >( element )->getElementInfo(); break; + case eNumberTypeUInt8 : elemInfo = translateElement< ben::Number< ben::uint8 > >( element )->getElementInfo(); break; + case eNumberTypeInt16 : elemInfo = translateElement< ben::Number< ben::int16 > >( element )->getElementInfo(); break; + case eNumberTypeUInt16 : elemInfo = translateElement< ben::Number< ben::uint16 > >( element )->getElementInfo(); break; + case eNumberTypeInt32 : elemInfo = translateElement< ben::Number< ben::int32 > >( element )->getElementInfo(); break; + case eNumberTypeUInt32 : elemInfo = translateElement< ben::Number< ben::uint32 > >( element )->getElementInfo(); break; + case eNumberTypeInt64 : elemInfo = translateElement< ben::Number< ben::int64 > >( element )->getElementInfo(); break; + case eNumberTypeUInt64 : elemInfo = translateElement< ben::Number< ben::uint64 > >( element )->getElementInfo(); break; + case eNumberTypeFloat : elemInfo = translateElement< ben::Number< float > >( element )->getElementInfo(); break; + case eNumberTypeDouble : elemInfo = translateElement< ben::Number< double > >( element )->getElementInfo(); break; + case eNumberTypeIeeeExtended : elemInfo = translateElement< ben::Number< ben::ieeeExtended > >( element )->getElementInfo(); break; } } break; - case be::Element::eTypeExif : LOG_INFO( "Exif !"); break; - case be::Element::eTypeData : elemInfo = translateElement< bed::Data >( element )->getElementInfo(); break; - case be::Element::eTypeKlv : LOG_INFO( "Klv !"); break; + case eTypeExif : LOG_INFO( "Exif !"); break; + case eTypeData : elemInfo = translateElement< bed::Data >( element )->getElementInfo(); break; + case eTypeKlv : LOG_INFO( "Klv !"); break; } switch( _type ) diff --git a/libraries/specReader/src/specDefinition.hpp b/libraries/specReader/src/specDefinition.hpp index 76ccac5..cdd499f 100644 --- a/libraries/specReader/src/specDefinition.hpp +++ b/libraries/specReader/src/specDefinition.hpp @@ -7,12 +7,10 @@ static const std::string kFooter = "footer"; static const std::string kHeader = "header"; static const std::string kStandard = "standard"; -// node labels +// node labels (left) static const std::string kId = "id"; static const std::string kLabel = "label"; -static const std::string kAscii = "ascii"; -static const std::string kHexa = "hexa"; static const std::string kType = "type"; static const std::string kCount = "count"; static const std::string kValues = "values"; @@ -21,25 +19,77 @@ static const std::string kRange = "range"; static const std::string kMin = "min"; static const std::string kMax = "max"; + static const std::string kGroup = "group"; static const std::string kGroupSize = "groupSize"; - static const std::string kRepetition = "repeated"; static const std::string kRequired = "required"; - static const std::string kEndian = "endian"; +static const std::string kOptional = "optional"; +static const std::string kOrdered = "ordered"; +// static const std::string kData = "data"; +static const std::string kDisplayType = "displayType"; + +// node values (right) +static const std::string kTrue = "true"; +static const std::string kFalse = "false"; static const std::string kEndianBig = "big"; static const std::string kEndianLittle = "little"; -static const std::string kOptional = "optional"; -static const std::string kOptionalTrue = "true"; -static const std::string kOptionalFalse = "false"; +static const std::string kAscii = "ascii"; +static const std::string kHexa = "hexa"; +static const std::string kRaw = "raw"; -static const std::string kOrdered = "ordered"; -static const std::string kOrderedTrue = "true"; -static const std::string kOrderedFalse = "false"; +static const std::string kInt8 = "int8"; +static const std::string kUInt8 = "uint8"; +static const std::string kInt16 = "int16"; +static const std::string kUInt16 = "uint16"; +static const std::string kInt32 = "int32"; +static const std::string kUInt32 = "uint32"; +static const std::string kInt64 = "int64"; +static const std::string kUInt64 = "uint64"; -static const std::string kData = "data"; -static const std::string kDisplayType = "displayType"; +static const std::string kFloat = "float"; +static const std::string kDouble = "double"; + +static const std::string kIeeeExtended = "ieeeExtended"; + +static const std::string kExif = "exif"; +static const std::string kKlv = "klv"; + + + +enum EType +{ + eTypeUnknown = 0, + eTypeNumber, + eTypeExif, + eTypeData, + eTypeKlv +}; + +enum ENumberType +{ + eNumberTypeUnknown = 0, + eNumberTypeInt8, + eNumberTypeUInt8, + eNumberTypeInt16, + eNumberTypeUInt16, + eNumberTypeInt32, + eNumberTypeUInt32, + eNumberTypeInt64, + eNumberTypeUInt64, + eNumberTypeFloat, + eNumberTypeDouble, + eNumberTypeIeeeExtended +}; + +enum EDataType +{ + eDataTypeUnknown = 0, + eDataTypeAscii, + eDataTypeHexa, + eDataTypeRaw +}; #endif