Skip to content
Snippets Groups Projects
Commit dac43fbb authored by Jan Trávníček's avatar Jan Trávníček
Browse files

update dummy library

parent bf8c0299
No related branches found
No related tags found
No related merge requests found
Pipeline #
/*
* CreateDataType.cpp
*
* Created on: Dec 7, 2017
* Author: Jan Travnicek
*/
#include "DataType.h"
#include <registration/AlgoRegistration.hpp>
#include <iostream>
......
/*
* DataType.cpp
*
* Created on: Dec 7, 2017
* Author: Jan Travnicek
*/
#include <typeinfo>
#include <registration/ValuePrinterRegistration.hpp>
#include "DataType.h"
......@@ -7,4 +14,3 @@ namespace {
static auto valuePrinter = registration::ValuePrinterRegister < DataType > ( );
 
}
/*
* DataType.h
*
* Created on: Dec 7, 2017
* Author: Jan Travnicek
*/
#include <ostream>
 
class DataType {
......
/*
* DataType.cpp
*
* Created on: Mar 26, 2013
* Author: Jan Travnicek
*/
#include "DataType.h"
#include <primitive/xml/Integer.h>
#include <object/Object.h>
#include <registration/XmlRegistration.hpp>
namespace alib {
DataType xmlApi < DataType >::parse ( ext::deque < sax::Token >::iterator & input ) {
sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) );
int value = xmlApi < int >::parse ( input );
sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, xmlTagName ( ) );
return DataType ( value );
}
bool xmlApi < DataType >::first ( const ext::deque < sax::Token >::const_iterator & input ) {
return sax::FromXMLParserHelper::isToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName ( ) );
}
const std::string & xmlApi < DataType >::xmlTagName ( ) {
static std::string xmlTagName = "DataType";
return xmlTagName;
}
void xmlApi < DataType >::compose ( ext::deque < sax::Token > & output, const DataType & data ) {
output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::START_ELEMENT);
xmlApi < int >::compose ( output, data.getA ( ) );
output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::END_ELEMENT );
}
} /* namespace alib */
namespace {
static auto xmlWrite = registration::XmlWriterRegister < DataType > ( );
static auto xmlRead = registration::XmlReaderRegister < DataType > ( );
} /* namespace */
/*
* DataType.h
*
* Created on: Dec 8, 2017
* Author: Jan Travnicek
*/
#ifndef _XML_DATA_TYPE_H_
#define _XML_DATA_TYPE_H_
#include <DataType.h>
#include <core/xmlApi.hpp>
namespace alib {
template < >
struct xmlApi < DataType > {
static DataType parse ( ext::deque < sax::Token >::iterator & input );
static bool first ( const ext::deque < sax::Token >::const_iterator & input );
static const std::string & xmlTagName ( );
static void compose ( ext::deque < sax::Token > & output, const DataType & data );
};
} /* namespace alib */
#endif /* _XML_DATA_TYPE_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment