stumpless 2.2.0
Loading...
Searching...
No Matches
stumpless::Param Class Reference

A parameter within a structured data element. More...

#include <Param.hpp>

Public Member Functions

 Param (struct stumpless_param *param)
 Creates a new Param based on a stumpless_param struct.
 
 Param (const char *name, const char *value)
 Creates a new Param with the given name and value.
 
 Param (const Param &param)
 Creates a Param as a copy of another Param.
 
 ~Param (void)
 Destroys this parameter and releases all memory allocated for it.
 
const char * GetName (void)
 The name of this Param.
 
const char * GetValue (void)
 The value of this Param.
 
ParamSetName (const char *name)
 Set the name of this Param.
 
ParamSetValue (const char *value)
 Set the value of this Param.
 
const char * ToString (void)
 Gives a string representation of this Param.
 

Public Attributes

struct stumpless_param * equivalent
 

Detailed Description

A parameter within a structured data element.

Constructor & Destructor Documentation

◆ Param() [1/3]

stumpless::Param::Param ( struct stumpless_param * param)

Creates a new Param based on a stumpless_param struct.

The struct is copied to create this Param, and therefore can be freed later without affecting the new instance.

Parameters
paramThe struct to base this param on.

◆ Param() [2/3]

stumpless::Param::Param ( const char * name,
const char * value )

Creates a new Param with the given name and value.

Parameters
nameThe name of the parameter.
valueThe value of the parameter

◆ Param() [3/3]

stumpless::Param::Param ( const Param & param)

Creates a Param as a copy of another Param.

Available since release v1.6.0.

Parameters
paramThe Param to copy.

◆ ~Param()

stumpless::Param::~Param ( void )

Destroys this parameter and releases all memory allocated for it.

Member Function Documentation

◆ GetName()

const char * stumpless::Param::GetName ( void )

The name of this Param.

The returned character buffer must be freed by the caller when it is no longer needed to avoid memory leaks. In versions prior to v2.0.0, the returned pointer was to the internal buffer was not to be modified by the caller. This behavior changed in v2.0.0 in order to avoid thread safety issues. Available since release v1.6.0.

Returns
The name of this Param.

◆ GetValue()

const char * stumpless::Param::GetValue ( void )

The value of this Param.

The returned character buffer must be freed by the caller when it is no longer needed to avoid memory leaks. In versions prior to v2.0.0, the returned pointer was to the internal buffer was not to be modified by the caller. This behavior changed in v2.0.0 in order to avoid thread safety issues. Available since release v1.6.0.

Returns
The value of this Param.

◆ SetName()

Param & stumpless::Param::SetName ( const char * name)

Set the name of this Param.

Available since release v1.6.0.

Parameters
nameThe new name.
Returns
The modified Param.

◆ SetValue()

Param & stumpless::Param::SetValue ( const char * value)

Set the value of this Param.

Available since release v1.6.0.

Parameters
valueThe new value.
Returns
The modified Param.

◆ ToString()

const char * stumpless::Param::ToString ( void )

Gives a string representation of this Param.

This is not intended for parsing or formatted output, but simply gives a human-readable form. The returned character buffer must be freed by the caller when it is no longer needed to avoid memory leaks. Available since release v2.0.0.

Returns
The name and value of this Param in a human-readable string.

Member Data Documentation

◆ equivalent

struct stumpless_param* stumpless::Param::equivalent

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