nl::Weave::Profiles::ReferencedString

#include <src/lib/profiles/common/WeaveMessage.h>

Here's how to handle strings in Weave.

Summary

This class has 8-bit and 16-bit variants.

Inheritance

Inherits from: nl::Weave::Profiles::RetainedPacketBuffer

Constructors and Destructors

ReferencedString(void)
The no-arg constructor for referenced strings.

Public attributes

isShort
bool
theLength
uint16_t
theString
char *

Public functions

init(uint16_t aLength, char *aString, System::PacketBuffer *aBuffer)
init(uint16_t aLength, char *aString)
init(uint8_t aLength, char *aString, System::PacketBuffer *aBuffer)
init(uint8_t aLength, char *aString)
operator==(const ReferencedString &) const
bool
pack(MessageIterator &)
printString(void)
char *

Public static functions

parse(MessageIterator &, ReferencedString &)

Public attributes

isShort

bool isShort

theLength

uint16_t theLength

theString

char * theString

Public functions

ReferencedString

 ReferencedString(
  void
)

The no-arg constructor for referenced strings.

init

WEAVE_ERROR init(
  uint16_t aLength,
  char *aString,
  System::PacketBuffer *aBuffer
)

init

WEAVE_ERROR init(
  uint16_t aLength,
  char *aString
)

init

WEAVE_ERROR init(
  uint8_t aLength,
  char *aString,
  System::PacketBuffer *aBuffer
)

init

WEAVE_ERROR init(
  uint8_t aLength,
  char *aString
)

operator==

bool operator==(
  const ReferencedString &
) const 

Details
Parameters
&aReferencedString
A string to check against.
Return Values
true
The strings are equal.
false
The strings are not equal.

pack

WEAVE_ERROR pack(
  MessageIterator &
)

Details
Parameters
&i
An iterator over the message being packed.
Returns
WEAVE_ERROR

printString

char * printString(
  void
)

Details
Returns
A printable string

Public static functions

parse

WEAVE_ERROR parse(
  MessageIterator &,
  ReferencedString &
)

Details
Parameters
&i
An iterator over the message being parsed.
&aString
A place to put the result of parsing.
Return Values
WEAVE_NO_ERROR
String parsed successfully.
WEAVE_ERROR_INVALID_STRING_LENGTH
The string is too long for the buffer (this should never happen).