scsl 0.2.4
Shimmering Clarity Standard Library
Namespaces | Macros | Functions
TLV.cc File Reference

Tag-Length-Value records built on Arena. More...

#include <cassert>
#include <cstring>
#include "TLV.h"

Namespaces

namespace  scsl
 scsl is the top-level namespace containing all the code in this library.
 
namespace  scsl::TLV
 

Macros

#define REC_SIZE(x)   ((std::size_t)x.Len + 2)
 

Functions

uint8_t * scsl::TLV::WriteToMemory (Arena &arena, uint8_t *cursor, Record &rec)
 
void scsl::TLV::SetRecord (Record &rec, uint8_t tag, uint8_t length, const char *data)
 
void scsl::TLV::ReadFromMemory (Record &rec, uint8_t *cursor)
 
uint8_t * scsl::TLV::FindTag (Arena &arena, uint8_t *cursor, Record &rec)
 
uint8_t * scsl::TLV::LocateTag (Arena &arena, uint8_t *cursor, Record &rec)
 
uint8_t * scsl::TLV::FindEmpty (Arena &arena, uint8_t *cursor)
 
uint8_t * scsl::TLV::SkipRecord (Record &rec, uint8_t *cursor)
 
void scsl::TLV::DeleteRecord (Arena &arena, uint8_t *cursor)
 

Detailed Description

Tag-Length-Value records built on Arena.

Author
K. Isom kyle@.nosp@m.imap.nosp@m..cc
Date
2023-10-06

Copyright 2023 K. Isom kyle@.nosp@m.imap.nosp@m..cc

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all /// copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Macro Definition Documentation

◆ REC_SIZE

#define REC_SIZE (   x)    ((std::size_t)x.Len + 2)

REC_SIZE calculates the total length of a TLV record, including the two byte header.