AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.7

Public Member Functions | Static Public Member Functions | List of all members
AMPS::Field Class Reference

Field represents the value of a single field in a Message. More...

`#include <Field.hpp>`

Inherited by AMPS::BookmarkRange.

## Public Member Functions
bool | empty () const
| Returns 'true' if empty, 'false' otherwise.
| operator std::string () const
| Conversion operator to std::string. More...
bool | operator== (const Field &rhs_) const
| Comparison operator Returns ‘true’ if self and rhs are equivalent, ‘false’ otherwise. More...
bool | operator== (const char *rhs_) const
| String comparison operator Returns ‘true’ if self and rhs are equivalent, ‘false’ otherwise. More...
bool | operator!= (const Field &rhs_) const
| Comparison operator Returns `true` if self and rhs are not equivalent. More...
bool | operator!= (const char *rhs_) const
| String comparison operator Returns `true` if self and rhs are not equivalent. More...
bool | operator!= (const std::string &rhs_) const
| String comparison operator Returns ‘true’ if self and rhs are not equivalent. More...
bool | operator== (const std::string &rhs_) const
| String comparison operator Returns ‘true’ if self and rhs are equivalent. More...
void | deepCopy (const Field &orig_)
| Makes self a deep copy of the original field. More...
Field | deepCopy () const
| Makes a deep copy of self, returns it.
void | clear ()
| Deletes the data associated with this Field, should only be used on Fields that were created as deepCopy of other Fields.
const char * | data () const
| Returns the (non-null-terminated) data underlying this field.
size_t | len () const
| Returns the length of the data underlying this field.

## Static Public Member Functions
static Field | stringCopy (const char *str_)
| Makes a copy of str_ in a new Field. More...

## Detailed Description

Field represents the value of a single field in a Message.

Field has limited string functionality, but doesn't require a copy of the data to be made until you want to copy it out to your own std::string.

## Member Function Documentation

## ◆ deepCopy()

void AMPS::Field::deepCopy | ( | const Field & | orig_ | ) |
| inline

Makes self a deep copy of the original field.

Parameters

  orig_ | Field to copy

## ◆ operator std::string()

AMPS::Field::operator std::string | ( |  | ) | const
| inline

Conversion operator to std::string.

Makes a copy of the data in self.

## ◆ operator!=() [1/3]

bool AMPS::Field::operator!= | ( | const char * | rhs_ | ) | const
| inline

String comparison operator Returns `true` if self and rhs are not equivalent.

Parameters

  rhs_ | Null-terminated string to compare against.

## ◆ operator!=() [2/3]

bool AMPS::Field::operator!= | ( | const Field & | rhs_ | ) | const
| inline

Comparison operator Returns `true` if self and rhs are not equivalent.

Parameters

  rhs_ | Field to compare against.

## ◆ operator!=() [3/3]

bool AMPS::Field::operator!= | ( | const std::string & | rhs_ | ) | const
| inline

String comparison operator Returns ‘true’ if self and rhs are not equivalent.

Parameters

  rhs_ | std::string to compare against.

## ◆ operator==() [1/3]

bool AMPS::Field::operator== | ( | const char * | rhs_ | ) | const
| inline

String comparison operator Returns ‘true’ if self and rhs are equivalent, ‘false’ otherwise.

Parameters

  rhs_ | Null-terminated string to compare against.

## ◆ operator==() [2/3]

bool AMPS::Field::operator== | ( | const Field & | rhs_ | ) | const
| inline

Comparison operator Returns ‘true’ if self and rhs are equivalent, ‘false’ otherwise.

Parameters

  rhs_ | Field to compare against.

## ◆ operator==() [3/3]

bool AMPS::Field::operator== | ( | const std::string & | rhs_ | ) | const
| inline

String comparison operator Returns ‘true’ if self and rhs are equivalent.

Parameters

  rhs_ | std::string to compare against.

## ◆ stringCopy()

static Field AMPS::Field::stringCopy | ( | const char * | str_ | ) |
| inline static

Makes a copy of str_ in a new Field.

Parameters

  str_ | NULL-terminated string to copy.

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

- include/amps/Field.hpp
- include/amps/Message.hpp