OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
t_xsd_generator Class Reference
Inheritance diagram for t_xsd_generator:
Collaboration diagram for t_xsd_generator:

Public Member Functions

 t_xsd_generator (t_program *program, const std::map< std::string, std::string > &parsed_options, const std::string &option_string)
 
virtual ~t_xsd_generator ()
 
void init_generator ()
 
void close_generator ()
 
void generate_typedef (t_typedef *ttypedef)
 
void generate_enum (t_enum *tenum)
 
void generate_service (t_service *tservice)
 
void generate_struct (t_struct *tstruct)
 
- Public Member Functions inherited from t_generator
 t_generator (t_program *program)
 
virtual ~t_generator ()
 
virtual void generate_program ()
 
const t_programget_program () const
 
void generate_docstring_comment (std::ofstream &out, const std::string &comment_start, const std::string &line_prefix, const std::string &contents, const std::string &comment_end)
 
virtual std::string escape_string (const std::string &in) const
 
std::string get_escaped_string (t_const_value *constval)
 

Private Member Functions

void generate_element (std::ostream &out, std::string name, t_type *ttype, t_struct *attrs=NULL, bool optional=false, bool nillable=false, bool list_element=false)
 
std::string ns (std::string in, std::string ns)
 
std::string xsd (std::string in)
 
std::string type_name (t_type *ttype)
 
std::string base_type_name (t_base_type::t_base tbase)
 

Private Attributes

std::ofstream f_xsd_
 
std::ofstream f_php_
 
std::ostringstream s_xsd_types_
 

Additional Inherited Members

- Static Public Member Functions inherited from t_generator
static bool is_valid_namespace (const std::string &sub_namespace)
 
static t_typeget_true_type (t_type *type)
 
- Protected Member Functions inherited from t_generator
virtual void generate_consts (std::vector< t_const * > consts)
 
virtual void generate_const (t_const *tconst)
 
virtual void generate_xception (t_struct *txception)
 
virtual std::string get_program_name (t_program *tprogram)
 
virtual std::string get_service_name (t_service *tservice)
 
virtual std::string get_out_dir () const
 
std::string tmp (std::string name)
 
void indent_up ()
 
void indent_down ()
 
std::string indent ()
 
std::ostream & indent (std::ostream &os)
 
std::string capitalize (std::string in)
 
std::string decapitalize (std::string in)
 
std::string lowercase (std::string in)
 
std::string uppercase (std::string in)
 
std::string underscore (std::string in)
 
std::string camelcase (std::string in)
 
- Protected Attributes inherited from t_generator
t_programprogram_
 
std::string program_name_
 
std::string service_name_
 
std::string out_dir_base_
 
std::map< char, std::string > escape_
 

Detailed Description

XSD generator, creates an XSD for the base types etc.

Definition at line 36 of file t_xsd_generator.cc.

Constructor & Destructor Documentation

t_xsd_generator::t_xsd_generator ( t_program program,
const std::map< std::string, std::string > &  parsed_options,
const std::string &  option_string 
)
inline

Definition at line 38 of file t_xsd_generator.cc.

virtual t_xsd_generator::~t_xsd_generator ( )
inlinevirtual

Definition at line 49 of file t_xsd_generator.cc.

Member Function Documentation

string t_xsd_generator::base_type_name ( t_base_type::t_base  tbase)
private

Returns the XSD type that corresponds to the thrift type.

Parameters
tbaseThe base type
Returns
Explicit XSD type, i.e. xsd:string

Definition at line 387 of file t_xsd_generator.cc.

Here is the call graph for this function:

void t_xsd_generator::close_generator ( )
virtual

Reimplemented from t_generator.

Definition at line 121 of file t_xsd_generator.cc.

void t_xsd_generator::generate_element ( std::ostream &  out,
std::string  name,
t_type ttype,
t_struct attrs = NULL,
bool  optional = false,
bool  nillable = false,
bool  list_element = false 
)
private

Definition at line 219 of file t_xsd_generator.cc.

Here is the call graph for this function:

void t_xsd_generator::generate_enum ( t_enum tenum)
inlinevirtual

Implements t_generator.

Definition at line 63 of file t_xsd_generator.cc.

void t_xsd_generator::generate_service ( t_service tservice)
virtual

Implements t_generator.

Definition at line 303 of file t_xsd_generator.cc.

Here is the call graph for this function:

void t_xsd_generator::generate_struct ( t_struct tstruct)
virtual

Implements t_generator.

Definition at line 157 of file t_xsd_generator.cc.

Here is the call graph for this function:

void t_xsd_generator::generate_typedef ( t_typedef ttypedef)
virtual

Program-level generation functions

Implements t_generator.

Definition at line 131 of file t_xsd_generator.cc.

Here is the call graph for this function:

void t_xsd_generator::init_generator ( )
virtual

Init and close methods

Reimplemented from t_generator.

Definition at line 103 of file t_xsd_generator.cc.

std::string t_xsd_generator::ns ( std::string  in,
std::string  ns 
)
inlineprivate

Definition at line 78 of file t_xsd_generator.cc.

string t_xsd_generator::type_name ( t_type ttype)
private

Definition at line 355 of file t_xsd_generator.cc.

Here is the call graph for this function:

std::string t_xsd_generator::xsd ( std::string  in)
inlineprivate

Definition at line 82 of file t_xsd_generator.cc.

Member Data Documentation

std::ofstream t_xsd_generator::f_php_
private

Definition at line 93 of file t_xsd_generator.cc.

std::ofstream t_xsd_generator::f_xsd_
private

Output xsd/php file

Definition at line 92 of file t_xsd_generator.cc.

std::ostringstream t_xsd_generator::s_xsd_types_
private

Output string stream

Definition at line 98 of file t_xsd_generator.cc.


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