UTILLib 2.0
Common C++ library with utilities.
Loading...
Searching...
No Matches
util::syslog::StructuredData Class Reference

Defines a simple interface against structured data item. More...

#include "uril/structureddata.h"

Public Types

using ParameterList = std::vector<std::pair<std::string, std::string>>

Public Member Functions

void Identity (const std::string &identity)
 Sets the identifier for the data item;.
const std::string & Identity () const
 Returns the data raw identifier.
const std::string & IdentityStem () const
 Return the main (stem) part of the identifier.
const std::string & EnterpriseId () const
 Returns the enterprise ID.
const ParameterListParameters () const
 Returns a list of name value pairs.
void AddParameter (const std::string &name, const std::string &value)
 Adds a name value pair.

Detailed Description

A structured data item is used to tag extra information onto a syslog message. The item has a unique identifier and one or more name value pairs.

Member Typedef Documentation

◆ ParameterList

using util::syslog::StructuredData::ParameterList = std::vector<std::pair<std::string, std::string>>

The list holds name value pairs. The name and values are always strings.

Member Function Documentation

◆ AddParameter()

void util::syslog::StructuredData::AddParameter ( const std::string & name,
const std::string & value )

Adds a new name value pair. The name and values are always strings.

Parameters
nameName of value.
valueThe value.

◆ EnterpriseId()

const std::string & util::syslog::StructuredData::EnterpriseId ( ) const
inlinenodiscard

The identifier may be split into 2 parts. The at symbol ('@'), is used as token that divide the stem and the enterprise ID.

Returns
The enterprise ID.

◆ Identity() [1/2]

const std::string & util::syslog::StructuredData::Identity ( ) const
inlinenodiscard
Returns
Raw message structured data name.

◆ Identity() [2/2]

void util::syslog::StructuredData::Identity ( const std::string & identity)

Sets the identifier for the structure data.

Parameters
identityString

◆ IdentityStem()

const std::string & util::syslog::StructuredData::IdentityStem ( ) const
inlinenodiscard

The identifier may be split into 2 parts. The at symbol ('@'), is used as token that divide the stem and the enterprise ID.

Returns
The stem part of the identifier.

◆ Parameters()

const ParameterList & util::syslog::StructuredData::Parameters ( ) const
inlinenodiscard

Returns the list of name value pairs belonging to this data item.

Returns
List of name value pairs

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