#include <detokenize.h>
Public Member Functions | |
DetokenizedString (uint32_t token, const span< const TokenizedStringEntry > &entries, const span< const std::byte > &arguments) | |
bool | ok () const |
True if there was only one valid match and it decoded successfully. | |
const std::vector< DecodedFormatString > & | matches () const |
Returns the strings that matched the token, with the best matches first. | |
const uint32_t & | token () const |
std::string | BestString () const |
std::string | BestStringWithErrors () const |
A string that has been detokenized. This class tracks all possible results if there are token collisions.
std::string pw::tokenizer::DetokenizedString::BestString | ( | ) | const |
Returns the detokenized string or an empty string if there were no matches. If there are multiple possible results, the DetokenizedString
returns the first match.
std::string pw::tokenizer::DetokenizedString::BestStringWithErrors | ( | ) | const |
Returns the best match, with error messages inserted for arguments that failed to parse.