class TLVUpdater

Defined at line 388 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

Provides a unified Reader/Writer interface for editing/adding/deleting elements in TLV encoding.

The TLVUpdater is a union of the TLVReader and TLVWriter objects and provides interface methods

for editing/deleting data in an encoding as well as adding new elements to the TLV encoding. The

TLVUpdater object essentially acts like two cursors, one for reading existing encoding and

another for writing (either for copying over existing data or writing new data).

Semantically, the TLVUpdater object functions like a union of the TLVReader and TLVWriter. The

TLVUpdater methods have more or less similar meanings as similarly named counterparts in

TLVReader/TLVWriter. Where there are differences in the semantics, the differences are clearly

documented in the function's comment section in WeaveTLVUpdater.cpp.

One particularly important note about the TLVUpdater's PutBytes() and PutString() methods is that

it can leave the encoding in a corrupt state with only the element header written when an

overflow occurs. Applications can call GetRemainingFreeLength() to make sure there is

enough free space to write the encoding. Note that GetRemainingFreeLength()

only tells you the available free bytes and there is

way for the application to know the

length of encoded data that gets written. In the event of an overflow, both PutBytes() and

PutString() will return WEAVE_ERROR_BUFFER_TOO_SMALL to the caller.

Also, note that Next() method is overloaded to both skip the current element and also advance the

internal reader to the next element. Because skipping already encoded elements requires changing

the internal writer's free space state variables to account for the new freed space (made

available by skipping), the application is expected to call Next() on the updater after a Get()

method whose value it doesn't wish to write back (which is equivalent to skipping the current

element).

Public Methods

WEAVE_ERROR Finalize ()

Defined at line 393 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint32_t GetImplicitProfileId ()

Defined at line 397 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (double & v)

Defined at line 417 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR DupBytes (uint8_t *& buf, uint32_t & dataLen)

Defined at line 419 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR GetString (char * buf, uint32_t bufSize)

Defined at line 420 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR DupString (char *& buf)

Defined at line 421 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR EnterContainer (TLVType & outerContainerType)
WEAVE_ERROR ExitContainer (TLVType outerContainerType)
void GetReader (TLVReader & containerReader)

Defined at line 402 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (bool & v)

Defined at line 407 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (int8_t & v)

Defined at line 408 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (int16_t & v)

Defined at line 409 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (int32_t & v)

Defined at line 410 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (int64_t & v)

Defined at line 411 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (uint8_t & v)

Defined at line 412 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (uint16_t & v)

Defined at line 413 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (uint32_t & v)

Defined at line 414 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (uint64_t & v)

Defined at line 415 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Get (float & v)

Defined at line 416 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR GetBytes (uint8_t * buf, uint32_t bufSize)

Defined at line 418 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

TLVType GetType ()

Defined at line 423 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint64_t GetTag ()

Defined at line 424 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint32_t GetLength ()

Defined at line 425 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR GetDataPtr (const uint8_t *& data)

Defined at line 426 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR VerifyEndOfContainer ()

Defined at line 427 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

TLVType GetContainerType ()

Defined at line 428 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint32_t GetLengthRead ()

Defined at line 429 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint32_t GetRemainingLength ()

Defined at line 430 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int8_t v)

Writer methods

Defined at line 433 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int16_t v)

Defined at line 434 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int32_t v)

Defined at line 435 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int64_t v)

Defined at line 436 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint8_t v)

Defined at line 437 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint16_t v)

Defined at line 438 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint32_t v)

Defined at line 439 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint64_t v)

Defined at line 440 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int8_t v, bool preserveSize)

Defined at line 441 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int16_t v, bool preserveSize)

Defined at line 442 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int32_t v, bool preserveSize)

Defined at line 443 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, int64_t v, bool preserveSize)

Defined at line 444 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint8_t v, bool preserveSize)

Defined at line 445 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint16_t v, bool preserveSize)

Defined at line 446 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint32_t v, bool preserveSize)

Defined at line 447 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, uint64_t v, bool preserveSize)

Defined at line 448 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, float v)

Defined at line 449 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Put (uint64_t tag, double v)

Defined at line 450 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR PutBoolean (uint64_t tag, bool v)

Defined at line 451 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR PutNull (uint64_t tag)

Defined at line 452 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR PutBytes (uint64_t tag, const uint8_t * buf, uint32_t len)

Defined at line 453 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR PutString (uint64_t tag, const char * buf)

Defined at line 454 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR PutString (uint64_t tag, const char * buf, uint32_t len)

Defined at line 455 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR CopyElement (TLVReader & reader)

Defined at line 456 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR CopyElement (uint64_t tag, TLVReader & reader)

Defined at line 457 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR StartContainer (uint64_t tag, TLVType containerType, TLVType & outerContainerType)

Defined at line 458 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR EndContainer (TLVType outerContainerType)

Defined at line 459 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint32_t GetLengthWritten ()

Defined at line 460 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

uint32_t GetRemainingFreeLength ()

Defined at line 461 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Core/WeaveTLV.h

WEAVE_ERROR Init (uint8_t * buf, uint32_t dataLen, uint32_t maxLen)
WEAVE_ERROR Init (TLVReader & aReader, uint32_t freeLen)
void SetImplicitProfileId (uint32_t profileId)

Common methods

WEAVE_ERROR Move ()
void MoveUntilEnd ()
WEAVE_ERROR Next ()

Reader methods