LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
logicalaccess::StringDataField Class Reference

A string data field. More...

#include <stringdatafield.hpp>

Inheritance diagram for logicalaccess::StringDataField:
logicalaccess::ValueDataField logicalaccess::DataField logicalaccess::XmlSerializable

Public Member Functions

 StringDataField ()
 Constructor.
 
virtual ~StringDataField ()
 Destructor.
 
DataFieldType getDFType () const override
 Get the field type.
 
void setValue (const std::string &value)
 Set the field value.
 
std::string getValue () const
 Get the field value.
 
void setRawValue (const ByteVector &value)
 Set the field value.
 
ByteVector getRawValue () const
 Get the field value.
 
void setCharset (const std::string &charset)
 Set the field charset.
 
std::string getCharset () const
 Get the field charset.
 
void setPaddingChar (unsigned char padding)
 Set the padding char.
 
unsigned char getPaddingChar () const
 Get the padding char.
 
BitsetStream getLinearData (const BitsetStream &data) const override
 Get linear data.
 
void setLinearData (const ByteVector &data) override
 Set linear data.
 
bool checkSkeleton (std::shared_ptr< DataField > field) const override
 Check the current field skeleton with another field.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize a XML node to the current object.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
- Public Member Functions inherited from logicalaccess::ValueDataField
 ValueDataField ()
 Constructor.
 
virtual ~ValueDataField ()
 Destructor.
 
DataFieldType getDFType () const override
 Get the field type.
 
virtual void setDataLength (unsigned int length)
 Set data length in bits.
 
std::shared_ptr< DataRepresentationgetDataRepresentation () const
 Get the Data Representation for the field.
 
void setDataRepresentation (std::shared_ptr< DataRepresentation > &encoding)
 Set the Data Representation for the field.
 
std::shared_ptr< DataTypegetDataType () const
 Get the Data Type for the field.
 
void setDataType (const std::shared_ptr< DataType > &encoding)
 Set the Data Type for the field.
 
void setIsFixedField (bool isFixed)
 Set if the field is a fixed field.
 
bool getIsFixedField () const
 Get if the field is a fixed field.
 
void setIsIdentifier (bool isIdentifier)
 Set if the field is used as identifier.
 
bool getIsIdentifier () const
 Get if the field is used as identifier.
 
void convertNumericData (BitsetStream &data, unsigned long long field, unsigned int fieldlen) const
 Convert a numeric data into the configured DataRepresentation and DataType.
 
void convertBinaryData (const BitsetStream &data, unsigned int fieldlen, BitsetStream &convertedData) const
 Convert a binary data into the configured DataRepresentation.
 
unsigned long long revertNumericData (const BitsetStream &data, unsigned int pos, unsigned int fieldlen) const
 Revert a numeric data using the configured DataRepresentation and DataType.
 
BitsetStream revertBinaryData (const BitsetStream &data, unsigned int pos, unsigned int fieldlen) const
 Revert a binary data using the configured DataRepresentation.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize a XML node to the current object.
 
- Public Member Functions inherited from logicalaccess::DataField
 DataField ()
 Constructor.
 
virtual ~DataField ()
 Destructor.
 
virtual unsigned int getDataLength () const
 Get data length in bits.
 
virtual void setPosition (unsigned int position)
 Set the field position in bits.
 
unsigned int getPosition () const
 Get the field position in bits.
 
virtual DataFieldType getDFType () const =0
 Get the field type.
 
void setName (const std::string &name)
 Set the field name.
 
std::string getName () const
 Get the field name.
 
virtual BitsetStream getLinearData (const BitsetStream &data) const =0
 Get linear data.
 
virtual void setLinearData (const ByteVector &data)=0
 Set linear data.
 
virtual bool checkSkeleton (std::shared_ptr< DataField > field) const =0
 Check the current field skeleton with another field.
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize the current object to XML.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize a XML node to the current object.
 
- Public Member Functions inherited from logicalaccess::XmlSerializable
virtual ~XmlSerializable ()=default
 
virtual std::string serialize ()
 Serialize object to Xml Node string.
 
virtual std::string serializeWithHeaders ()
 Serialize object to Xml Node string, with xml headers.
 
virtual void serialize (boost::property_tree::ptree &parentNode)=0
 Serialize object to Xml Node.
 
virtual void serializeToFile (const std::string &filename)
 Serialize object to a Xml file.
 
virtual void unSerialize (boost::property_tree::ptree &node)=0
 UnSerialize object from a Xml Node.
 
virtual void unSerialize (const std::string &xmlstring, const std::string &rootNode)
 UnSerialize object from a Xml Node string.
 
virtual void unSerialize (std::istream &is, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerialize (boost::property_tree::ptree &node, const std::string &rootNode)
 UnSerialize object from a Xml node.
 
virtual void unSerializeFromFile (const std::string &filename)
 UnSerialize object from a Xml file.
 
virtual std::string getDefaultXmlNodeName () const =0
 Get the default Xml Node name for this object.
 

Protected Attributes

ByteVector d_value
 
unsigned char d_padding
 
std::string d_charset
 
- Protected Attributes inherited from logicalaccess::ValueDataField
std::shared_ptr< DataRepresentationd_dataRepresentation
 The Data Representation.
 
std::shared_ptr< DataTyped_dataType
 The Data Type.
 
bool d_isFixedField
 The field is a value field.
 
bool d_isIdentifier
 The field is used as identifier.
 
- Protected Attributes inherited from logicalaccess::DataField
std::string d_name
 The field name.
 
unsigned int d_length
 The field length in bits.
 
unsigned int d_position
 The field position in bits.
 

Additional Inherited Members

- Static Public Member Functions inherited from logicalaccess::XmlSerializable
static std::string removeXmlDeclaration (const std::string &xmlstring)
 Remove Xml declaration from a xml string.
 
static ByteVector formatHexString (std::string hexstr)
 Format hex string to hex string with space.
 
- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 

Detailed Description

A string data field.

Constructor & Destructor Documentation

◆ StringDataField()

logicalaccess::StringDataField::StringDataField ( )

Constructor.

◆ ~StringDataField()

logicalaccess::StringDataField::~StringDataField ( )
virtual

Destructor.

Member Function Documentation

◆ checkSkeleton()

bool logicalaccess::StringDataField::checkSkeleton ( std::shared_ptr< DataField field) const
overridevirtual

Check the current field skeleton with another field.

Parameters
fieldThe field to check.
Returns
True on success, false otherwise.

Implements logicalaccess::DataField.

◆ getCharset()

std::string logicalaccess::StringDataField::getCharset ( ) const

Get the field charset.

Returns
The field charset.

◆ getDefaultXmlNodeName()

std::string logicalaccess::StringDataField::getDefaultXmlNodeName ( ) const
overridevirtual

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getDFType()

DataFieldType logicalaccess::StringDataField::getDFType ( ) const
inlineoverridevirtual

Get the field type.

Returns
The field type.

Implements logicalaccess::DataField.

◆ getLinearData()

BitsetStream logicalaccess::StringDataField::getLinearData ( const BitsetStream data) const
overridevirtual

Get linear data.

Parameters
dataWhere to put data
dataLengthBytesLength in byte of data
posThe first position bit. Will contain the position bit after the field.

Implements logicalaccess::DataField.

◆ getPaddingChar()

unsigned char logicalaccess::StringDataField::getPaddingChar ( ) const

Get the padding char.

Returns
The padding char.

◆ getRawValue()

ByteVector logicalaccess::StringDataField::getRawValue ( ) const

Get the field value.

Returns
The field value.

◆ getValue()

std::string logicalaccess::StringDataField::getValue ( ) const

Get the field value.

Returns
The field value.

◆ serialize()

void logicalaccess::StringDataField::serialize ( boost::property_tree::ptree &  parentNode)
overridevirtual

Serialize the current object to XML.

Parameters
parentNodeThe parent node.

Reimplemented from logicalaccess::DataField.

◆ setCharset()

void logicalaccess::StringDataField::setCharset ( const std::string &  charset)

Set the field charset.

Parameters
charsetThe field charset.

◆ setLinearData()

void logicalaccess::StringDataField::setLinearData ( const ByteVector data)
overridevirtual

Set linear data.

Parameters
dataWhere to get data
dataLengthBytesLength of data in bytes
posThe first position bit. Will contain the position bit after the field.

Implements logicalaccess::DataField.

◆ setPaddingChar()

void logicalaccess::StringDataField::setPaddingChar ( unsigned char  padding)

Set the padding char.

Parameters
paddingThe padding char.

◆ setRawValue()

void logicalaccess::StringDataField::setRawValue ( const ByteVector value)

Set the field value.

Parameters
valueThe field value.

◆ setValue()

void logicalaccess::StringDataField::setValue ( const std::string &  value)

Set the field value.

Parameters
valueThe field value.

◆ unSerialize()

void logicalaccess::StringDataField::unSerialize ( boost::property_tree::ptree &  node)
overridevirtual

UnSerialize a XML node to the current object.

Parameters
nodeThe XML node.

Reimplemented from logicalaccess::DataField.

Member Data Documentation

◆ d_charset

std::string logicalaccess::StringDataField::d_charset
protected

◆ d_padding

unsigned char logicalaccess::StringDataField::d_padding
protected

◆ d_value

ByteVector logicalaccess::StringDataField::d_value
protected

The documentation for this class was generated from the following files: