Nostrduino
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes
nostr::NostrEventTags Class Reference

#include <NostrEvent.h>

Public Member Functions

 NostrEventTags ()
 
unsigned int count ()
 
const std::vector< NostrEventTag > & getTags () const
 
const std::vector< NostrString > & getTag (NostrString key) const
 
unsigned int addTag (NostrString key, std::initializer_list< NostrString > values)
 
unsigned int addTag (NostrString key, std::vector< NostrString > values)
 
bool removeTag (size_t index)
 
void removeTags (NostrString key)
 
void clearTags ()
 
void toJson (JsonArray doc) const
 

Static Public Attributes

static const std::vector< NostrStringemptyTags
 

Protected Attributes

std::vector< NostrEventTagtags
 

Constructor & Destructor Documentation

◆ NostrEventTags()

nostr::NostrEventTags::NostrEventTags ( )
inline

Member Function Documentation

◆ addTag() [1/2]

unsigned int NostrEventTags::addTag ( NostrString  key,
std::initializer_list< NostrString values 
)

Add a tag with a given key and set of values NB. You can add multiple tags with the same key

◆ addTag() [2/2]

unsigned int NostrEventTags::addTag ( NostrString  key,
std::vector< NostrString values 
)

Add a tag with a given key and set of values NB. You can add multiple tags with the same key

◆ clearTags()

void NostrEventTags::clearTags ( )

Remove all tags

◆ count()

unsigned int nostr::NostrEventTags::count ( )
inline

Get the number of tags

◆ getTag()

const std::vector< NostrString > & NostrEventTags::getTag ( NostrString  key) const

Get the first occurrence of a tag with the given key

◆ getTags()

const std::vector< NostrEventTag > & NostrEventTags::getTags ( ) const

Get all tags

◆ removeTag()

bool NostrEventTags::removeTag ( size_t  index)

Remove a tag at a given index

◆ removeTags()

void NostrEventTags::removeTags ( NostrString  key)

Remove all occurrences of a tag with the given key

◆ toJson()

void NostrEventTags::toJson ( JsonArray  doc) const

Output to json

Field Documentation

◆ emptyTags

const std::vector< NostrString > NostrEventTags::emptyTags
static

◆ tags

std::vector<NostrEventTag> nostr::NostrEventTags::tags
protected

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