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

#include <ndefmessage.hpp>

Inheritance diagram for logicalaccess::NdefMessage:
logicalaccess::NfcData logicalaccess::XmlSerializable

Public Member Functions

 NdefMessage ()
 
 NdefMessage (const ByteVector &data)
 
virtual ~NdefMessage ()
 
ByteVector encode ()
 
void addRecord (std::shared_ptr< NdefRecord > record)
 
void removeRecord (unsigned int i)
 
void addTextRecord (std::string text, std::string language, UTF utf=UTF_8)
 
void addEmptyRecord ()
 
void addUriRecord (std::string uri, UriType uritype)
 
void addMimeMediaRecord (std::string mimeType, ByteVector payload)
 
size_t getRecordCount () const
 
std::vector< std::shared_ptr< NdefRecord > > & getRecords ()
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize object to Xml Node.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize object from a Xml Node.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
- Public Member Functions inherited from logicalaccess::NfcData
 NfcData ()
 
 NfcData (char type)
 
 ~NfcData ()
 
void serialize (boost::property_tree::ptree &parentNode) override
 Serialize object to Xml Node.
 
void unSerialize (boost::property_tree::ptree &node) override
 UnSerialize object from a Xml Node.
 
std::string getDefaultXmlNodeName () const override
 Get the default Xml Node name for this object.
 
char getType () const
 
void setType (char type)
 
- 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.
 

Static Public Member Functions

static std::shared_ptr< NdefMessageTLVToNdefMessage (ByteVector tlv)
 
static ByteVector NdefMessageToTLV (std::shared_ptr< NdefMessage > record)
 
- Static Public Member Functions inherited from logicalaccess::NfcData
static ByteVector dataToTLV (std::shared_ptr< NfcData > data)
 
static std::vector< std::shared_ptr< NfcData > > tlvToData (ByteVector tlv)
 
- 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.
 

Private Attributes

std::vector< std::shared_ptr< NdefRecord > > m_records
 

Additional Inherited Members

- Static Protected Member Functions inherited from logicalaccess::XmlSerializable
static unsigned long long atoull (const std::string &str)
 
- Protected Attributes inherited from logicalaccess::NfcData
char m_type
 

Constructor & Destructor Documentation

◆ NdefMessage() [1/2]

logicalaccess::NdefMessage::NdefMessage ( )

◆ NdefMessage() [2/2]

logicalaccess::NdefMessage::NdefMessage ( const ByteVector data)
explicit

◆ ~NdefMessage()

virtual logicalaccess::NdefMessage::~NdefMessage ( )
inlinevirtual

Member Function Documentation

◆ addEmptyRecord()

void logicalaccess::NdefMessage::addEmptyRecord ( )

◆ addMimeMediaRecord()

void logicalaccess::NdefMessage::addMimeMediaRecord ( std::string  mimeType,
ByteVector  payload 
)

◆ addRecord()

void logicalaccess::NdefMessage::addRecord ( std::shared_ptr< NdefRecord record)
inline

◆ addTextRecord()

void logicalaccess::NdefMessage::addTextRecord ( std::string  text,
std::string  language,
UTF  utf = UTF_8 
)

◆ addUriRecord()

void logicalaccess::NdefMessage::addUriRecord ( std::string  uri,
UriType  uritype 
)

◆ encode()

ByteVector logicalaccess::NdefMessage::encode ( )

◆ getDefaultXmlNodeName()

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

Get the default Xml Node name for this object.

Returns
The Xml node name.

Implements logicalaccess::XmlSerializable.

◆ getRecordCount()

size_t logicalaccess::NdefMessage::getRecordCount ( ) const
inline

◆ getRecords()

std::vector< std::shared_ptr< NdefRecord > > & logicalaccess::NdefMessage::getRecords ( )
inline

◆ NdefMessageToTLV()

ByteVector logicalaccess::NdefMessage::NdefMessageToTLV ( std::shared_ptr< NdefMessage record)
static

◆ removeRecord()

void logicalaccess::NdefMessage::removeRecord ( unsigned int  i)

◆ serialize()

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

Serialize object to Xml Node.

Parameters
osThe XML stream.

Implements logicalaccess::XmlSerializable.

◆ TLVToNdefMessage()

std::shared_ptr< NdefMessage > logicalaccess::NdefMessage::TLVToNdefMessage ( ByteVector  tlv)
static

◆ unSerialize()

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

UnSerialize object from a Xml Node.

Parameters
nodeThe Xml node.

Implements logicalaccess::XmlSerializable.

Member Data Documentation

◆ m_records

std::vector<std::shared_ptr<NdefRecord> > logicalaccess::NdefMessage::m_records
private

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