Rosetta
Namespaces | Functions
util.hpp File Reference
#include <context.hpp>
#include <clang/AST/Decl.h>
#include <clang/AST/DeclTemplate.h>
#include <string>
#include <vector>

Namespaces

 binder
 

Functions

vector< string > binder::split (string const &buffer, string const &separator)
 Split string using given separator. More...
 
void binder::replace (std::string &r, std::string const &from, std::string const &to)
 Replace all occurrences of string in-place. More...
 
string binder::replace_ (string const &s, string const &from, string const &to)
 Replace all occurrences of string and return result as new string. More...
 
bool binder::begins_with (std::string const &source, std::string const &prefix)
 check if string begins with given prefix More...
 
bool binder::ends_with (std::string const &source, std::string const &prefix)
 check if string ends with given prefix More...
 
string binder::indent (std::string const &code, std::string const &indentation)
 indent given code More...
 
std::string binder::trim (std::string const &s)
 remove leading and trailing tabs and spaces More...
 
void binder::update_source_file (std::string const &prefix, std::string const &file_name, std::string const &code)
 Try to read exisitng file and if content does not match to code - write a new version. Also create nested dirs starting from prefix if nessesary. More...
 
std::string binder::namespace_from_named_decl (clang::NamedDecl const *decl)
 calculate namespace path from given NamedDecl, like: std, core::pose More...
 
std::string binder::typename_from_type_decl (clang::TypeDecl const *decl)
 
string binder::base_namespace (string const &ns)
 Calculate base (upper) namespace for given one: core::pose::motif --> core::pose. More...
 
string binder::last_namespace (string const &ns)
 Calculate last namespace for given one: core::pose::motif --> motif. More...
 
void binder::fix_boolean_types (std::string &type)
 replace all _Bool types with bool More...
 
string binder::expresion_to_string (clang::Expr *e)
 Generate string representation of given expression. More...
 
string binder::template_argument_to_string (clang::TemplateArgument const &)
 Generate string representation of given TemplateArgument. More...
 
std::string binder::line_number (clang::NamedDecl const *decl)
 calculate line in source file for NamedDecl More...
 
string binder::mangle_type_name (std::string const &name, bool mark_template=true)
 generate string represeting class name that could be used in python More...
 
string binder::generate_comment_for_declaration (clang::NamedDecl const *decl)
 generate C++ comment line for given declaration along with file path and line number More...
 
std::string binder::generate_documentation_string_for_declaration (clang::Decl const *)
 extract doc string (Doxygen comments) for given declaration and convert it to C++ code More...