Fawkes API  Fawkes Development Version
InterfaceChecker Class Reference

Check interface type and identifier validity. More...

#include <>>

Static Public Member Functions

static bool validType (const std::string &type, std::vector< InterfaceEnumConstant > *enum_constants=0)
 Decide if a supplied type is correct and in the case of constants if the supplied value matches the field type. More...
 
static bool validValue (const std::string &type, const std::string &value)
 Check value validity for given type. More...
 
static bool validName (const std::string &name, const std::set< std::string > &reserved_names)
 Check identifiers. More...
 

Detailed Description

Check interface type and identifier validity.

Definition at line 33 of file checker.h.

Member Function Documentation

◆ validName()

bool InterfaceChecker::validName ( const std::string &  name,
const std::set< std::string > &  reserved_names 
)
static

Check identifiers.

Identifiers that are used by the implementation and cannot be used as field or message names are rejected.

Parameters
nameidentifier to check
reserved_namesreserved names to reject
Returns
true if name is valid, false otherwise

Definition at line 146 of file checker.cpp.

Referenced by InterfaceEnumConstant::add_item(), InterfaceConstant::InterfaceConstant(), InterfaceEnumConstant::InterfaceEnumConstant(), and InterfaceField::valid().

◆ validType()

bool InterfaceChecker::validType ( const std::string &  type,
std::vector< InterfaceEnumConstant > *  enum_constants = 0 
)
static

Decide if a supplied type is correct and in the case of constants if the supplied value matches the field type.

Valid types are:

  • int
  • long int
  • unsigned int
  • unsigned long int
  • bool
  • float
  • double
  • byte (unsigned 8-bit number)
  • string
    Parameters
    typetype string to check
    enum_constantsan optional vector of enumeration constants that are used for type validation.
    Returns
    true, if type is valid, false otherwise

Definition at line 60 of file checker.cpp.

Referenced by InterfaceConstant::InterfaceConstant(), and InterfaceField::valid().

◆ validValue()

bool InterfaceChecker::validValue ( const std::string &  type,
const std::string &  value 
)
static

Check value validity for given type.

Parameters
typetype if value
valuevalue to check
Returns
true, if value is valid for type, false otherwise

Definition at line 87 of file checker.cpp.

Referenced by InterfaceConstant::InterfaceConstant(), and InterfaceField::valid().


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