![]() |
Rosetta
3.7
|
Various helper functions. More...
#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 (string &r, string const &from, string const &to) |
Replace all occurrences of string. 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... | |
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 *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) |
calcualte line in source file for NamedDecl More... | |
string | binder::mangle_type_name (string const &name, bool mark_template) |
string | binder::generate_comment_for_declaration (clang::NamedDecl const *decl) |
std::string | binder::generate_documentation_string_for_declaration (clang::Decl const *decl) |
Various helper functions.