NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
websocketpp::utf8_validator Namespace Reference

Classes

class  validator
 Provides streaming UTF8 validation functionality. More...
 

Functions

uint32_t decode (uint32_t *state, uint32_t *codep, uint8_t byte)
 Decode the next byte of a UTF8 sequence. More...
 
bool validate (std::string const &s)
 Validate a UTF8 string. More...
 

Variables

static unsigned int const utf8_accept = 0
 State that represents a valid utf8 input sequence. More...
 
static unsigned int const utf8_reject = 1
 State that represents an invalid utf8 input sequence. More...
 
static uint8_t const utf8d []
 Lookup table for the UTF8 decode state machine. More...
 

Function Documentation

uint32_t websocketpp::utf8_validator::decode ( uint32_t *  state,
uint32_t *  codep,
uint8_t  byte 
)
inline

Decode the next byte of a UTF8 sequence.

Parameters
[out]stateThe decoder state to advance
[out]codepThe codepoint to fill in
[in]byteThe byte to input
Returns
The ending state of the decode operation

Definition at line 69 of file utf8_validator.hpp.

References utf8_accept.

Referenced by websocketpp::utf8_validator::validator::consume(), websocketpp::utf8_validator::validator::decode(), ndn::lp::Packet::get(), and ndn::lp::Packet::list().

bool websocketpp::utf8_validator::validate ( std::string const &  s)
inline

Validate a UTF8 string.

convenience function that creates a validator, validates a complete string and returns the result.

Definition at line 143 of file utf8_validator.hpp.

References websocketpp::utf8_validator::validator::complete(), and websocketpp::utf8_validator::validator::decode().

Referenced by websocketpp::close::extract_reason(), websocketpp::processor::hybi00< stub_config >::prepare_data_frame(), and websocketpp::processor::hybi13< stub_config >::prepare_data_frame().

Variable Documentation

unsigned int const websocketpp::utf8_validator::utf8_accept = 0
static

State that represents a valid utf8 input sequence.

Definition at line 40 of file utf8_validator.hpp.

Referenced by websocketpp::utf8_validator::validator::complete(), decode(), and websocketpp::utf8_validator::validator::reset().

unsigned int const websocketpp::utf8_validator::utf8_reject = 1
static

State that represents an invalid utf8 input sequence.

Definition at line 42 of file utf8_validator.hpp.

uint8_t const websocketpp::utf8_validator::utf8d[]
static
Initial value:
= {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3,
0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1,
1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,
1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1,
1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
}

Lookup table for the UTF8 decode state machine.

Definition at line 45 of file utf8_validator.hpp.