The namespace crp is the namespace for all ContRap core components and libraries.
More...
Data Structures |
class | Block |
| Class Block represents blocks in the control flow structure. More...
|
class | Call |
| Class Call is a command which calls a function. More...
|
class | CallBack |
| Class CallBack is a base class for call-back functions. More...
|
class | Class |
| Class Class represents the memory layout the static members in a ContRap class. More...
|
class | CMakeFolder |
| Class CMakeFolder represents a folder with a ContRap CMake file. More...
|
class | Command |
| Class Command is the base interface for all ContRap commands. More...
|
class | ArgCommand |
| Class ArgCommand is a command which has a list of arguments. More...
|
class | Assignment |
| Class Assignment represents assignments of identifiers. More...
|
class | Declaration |
| Class declaration is represents a list of assignments or identifiers, where each of them declares a local identifier. More...
|
class | Selector |
| Class Selector represents nested scope or class selection commands. More...
|
class | Load |
| Class Load represents the load command for libraries. More...
|
class | Statement |
| Class Statement represents system commands, which should not be overloaded by the user. More...
|
class | Conditional |
| Class Conditional represents conditional branches. More...
|
class | Console |
| Class Console implements the console stream communication with a process. More...
|
class | Engine |
| Class Engine is a combination of a parser and an interpreter. More...
|
class | Executable |
| Class Executable composes an expression, an engine and an evaluation scope. More...
|
class | Error |
| Class Error is the main error class thrown. More...
|
class | EoFError |
| Class EoFError is an error thrown by the parser in case of the input end. More...
|
class | Interrupt |
| Exception Interrupt is an exception thrown by the code if a break is requested. More...
|
class | Abort |
| Exception Abort is thrown within a procedure to indicate that it is not usable with the given arguments. More...
|
class | Quit |
| Exception Quit is a message thrown by the code if a quit is requested. More...
|
class | Stop |
| Exception Stop is a message thrown by the code if a interpreter stop is requested. More...
|
class | Option |
| Class Option represents an option to call in a function. More...
|
class | AtomicFunction |
| Class AtomicFunction is the base interface for ContRap atomic functions. More...
|
class | ExternalFunction |
| Class ExternalFunction encapsulates the external function type as an object. More...
|
class | InternalFunction |
| Class InternalFunction represents a function defined with the ContRap language. More...
|
class | Function |
| Class Function is the main structure for representing polymorphic functions of ContRap. More...
|
class | Identifier |
| Class Identifier is an object which represents identifiers. More...
|
class | Parameter |
| Class Parameter is an identifier type for representing parameters of functions. More...
|
class | Instance |
| Class Instance represents an instance of a ContRap native class. More...
|
class | State |
| Class State describes the state of the ContRap interpreter. More...
|
class | Return |
| Class Return is the exception thrown by a procedure when returning to the caller. More...
|
class | Break |
| Class Break is the exception thrown by within a loop when needed to break it. More...
|
class | Interpreter |
| Class Interpreter implements the command interpreter of ContRap. More...
|
class | Library |
| Class Library is a library descriptor. More...
|
class | List |
| Class List represents list objects. More...
|
class | ListRef |
| Class ListRef is a reference to list entries. More...
|
class | LoggerMessage |
| Class LoggerMessage represents a message with type, string, and sender. More...
|
class | Logger |
| Logger collects logging messages and returns them to a desired target on demand. More...
|
class | ModuleInfo |
| Class ModuleInfo is used to describe module properties at runtime. More...
|
class | Object |
| Class Object is the interface for all ContRap objects. More...
|
class | ObjectFactory |
| Object factory provides an interface for instantiating objects from a string holding the type. More...
|
class | Options |
| Class Options implements a singleton options container. More...
|
struct | Operator |
| Class Operator defines the properties of an operator. More...
|
class | Parser |
| Class Parser implements the parser of ContRap commands. More...
|
class | PluginManager |
| Class PluginManager implements a singleton plugin library management interface. More...
|
class | MetaInfo |
| Class MetaInfo contains objects meta-information. More...
|
class | Finalizer |
| Class Finalizer is a pair of an object pointer and the corresponding destructor. More...
|
class | DPtr |
| Class DPtr is a base weak typed class for smart pointers. More...
|
class | RefPtr |
| Class RefPtr is an internal pointer class which implements the reference counter. More...
|
class | SPtr |
| Class SPtr is a template typed reference counting pointer. More...
|
class | Scope |
| Class Scope defines a relation between identifier names and their values within name scopes. More...
|
class | Serializer |
| Class Serializer is a weak typed representation of objects for sending them through a serial stream. More...
|
class | Socket |
| Class Socket is a platform independent socket implementation. More...
|
class | ClientSocket |
| Class ClientSocket is a platform independent client socket. More...
|
class | ServerSocket |
| Class ServerSocket is a platform independent server socket implementation. More...
|
class | StringTokenizer |
| Class StringTokenizer implements a decomposition of a string into tokens separated by a set of delimiters. More...
|
class | Template |
| Class Template is the base interface class for template objects. More...
|
class | Mutex |
| Class Mutex is a platform-independent mutex wrapper. More...
|
class | WaitCondition |
| Class WaitCondition implements a wait condition variable. More...
|
class | Thread |
| Class Thread implements a user level thread. More...
|
class | EvalThread |
| Class EvalThread is a thread, which evaluates an expression. More...
|
class | Timer |
| Timer is a platform independent timer class. More...
|
class | String |
| Class String is the wrapped class for strings. More...
|
class | XMLDataPool |
| Class XMLDataPool is a query class object for XML-trees. More...
|
class | XMLGlyphPrinter |
| Class XMLGlyphPrinter is an abstract glyph printing interface. More...
|
class | XMLLayoutBox |
| Class XMLLayoutBox is an atomic layout item. More...
|
class | XMLRule |
| Class XMLRule is a descriptor of complex drawing objects like tables, lists, etc. More...
|
class | XMLLayout |
| Class XMLLayout is an abstract text layouter and printer of XML-formatted texts. More...
|
class | XMLError |
| Class XMLError is the base class for all XML errors. More...
|
class | XMLParser |
| Class XMLParser is an event driven base class to parse XML formatted strings. More...
|
class | XMLStreamParser |
| Class XMLStreamParser is a stream based XML parser for text strings. More...
|
class | XMLPool |
| Class XMLPool is a query class object for XML-trees. More...
|
class | LayoutBox |
| Class LayoutBox is an atomic layout item. More...
|
class | XMLTextLayout |
| Class XMLTextLayout is a layout class to print XML formatted strings to console or to a text file. More...
|
Typedefs |
typedef ModuleInfo *(* | InfoFunction )() |
| Type definition for a ContRap function.
|
typedef DPtr(* | MetaFunction )(SPtr< List > &arguments, SPtr< List > &options, SPtr< Scope > &scope, Engine *engine) |
| Type for external functions.
|
typedef DPtr(* | MapFunction )(DPtr, void *extra) |
typedef bool(* | DPtrCompare )(const DPtr &left, const DPtr &right) |
| Comparison function prototype for dptrs.
|
typedef bool(* | ConstructorFunction )(void *object) |
| Prototype for the constructor function.
|
typedef bool(* | CopyFunction )(const void *rvalue, void *lvalue) |
| Prototype for the copy function.
|
typedef bool(* | CastFunction )(const void *object) |
| Prototype of cast functions.
|
typedef void(* | DestructorFunction )(const void *object) |
| Prototype for the destructor function.
|
typedef std::pair< std::string,
std::string > | StringPair |
| StringPair is a pair of strings.
|
typedef long long | integer_t |
| Finite precision integer type.
|
typedef long double | floating_t |
| Floating point type.
|
typedef std::complex< floating_t > | complex_t |
| Floating point type.
|
typedef std::complex< double > | complex |
typedef std::vector
< std::vector< std::string > > | UTF8Field |
Enumerations |
enum | MessageType { DEBUG_MESSAGE = 1,
ERROR_MESSAGE = 2,
WARNING_MESSAGE = 4,
COMMENT_MESSAGE = 8
} |
| Enumerates message types of the logger.
More...
|
enum | MessageLevel { SHOW_NOTHING = 0,
SHOW_ERRORS = 2,
SHOW_WARNINGS = 4,
SHOW_ALL = 8
} |
| Enumerates debug levels.
More...
|
enum | PointerMode {
UNDEFINED,
PERSISTENT,
INSTANT,
DELAYED,
SOURCE
} |
| Deletion mode enumeration type.
More...
|
Functions |
SPtr< Call > | Equation (const SPtr< Object > &left, const SPtr< Object > &right) |
| Creates an equation from a left-hand side and a right-hand side.
|
CONTRAP_CORE_API SPtr< Call > | require (const DPtr &object, const std::string &name, const std::string &message) |
| Makes a dynamic cast and returns the converted type or an error message if the resulting object is not of the required type.
|
CONTRAP_CORE_API SPtr< Call > | check (const DPtr &object, const std::string &name) |
| Makes a dynamic cast to a call and checks the name of the operator.
|
CONTRAP_CORE_API std::map
< std::string, DPtr > | interpret_options (SPtr< List > options) |
| Interprets an options list.
|
CONTRAP_CORE_API void | add_callback (const std::string &name, CallBack *callback) |
| Adds a new call-back to the call-back list.
|
CONTRAP_CORE_API void | remove_callback (const std::string &name) |
| Removes a call-back from the call-back list.
|
CONTRAP_CORE_API void | process_callbacks () |
| Process call-backs.
|
CONTRAP_CORE_API std::string | console_read_nonblocking () |
| Method for reading from the console without blocking and calling call-backs during the input.
|
CONTRAP_CORE_API SPtr< Scope > | get_nested_class (SPtr< Scope > scope, const std::string &name, bool create) |
| Routes to the class which is pointed by an identifier.
|
CONTRAP_CORE_API void * | open_library (const std::string &library, bool local=false, bool lazy=false) |
| Opens a dynamic library in local or in global mode.
|
CONTRAP_CORE_API void * | get_function_from_so (const std::string &function, void *handle) |
| Platform independent dynamic loader function.
|
CONTRAP_CORE_API void | close_library (void *handle) |
| Closes library.
|
CONTRAP_CORE_API void | error (const std::string &message) |
| Creates and throws an error message from string.
|
CONTRAP_CORE_API void | warning (const std::string &message, const std::string &sender="Core") |
| Generates a warning.
|
CONTRAP_CORE_API void | comment (const std::string &message, const std::string &sender="Core") |
| Generates a comment.
|
CONTRAP_CORE_API void | debug (const std::string &message, const std::string &sender="Debugger") |
| Generates a comment.
|
CONTRAP_CORE_API void | abort (const std::string &message) |
| Creates and throws an abort message from string.
|
CONTRAP_CORE_API std::vector
< std::string > | get_files_in_folder (const std::string &path) |
| Returns all files in a folder.
|
CONTRAP_CORE_API std::vector
< std::string > | get_folder_contents (const std::string &path) |
| Returns all files in a folder including directories.
|
CONTRAP_CORE_API bool | directory_exists (const std::string &path) |
| Checks if a directory exists.
|
CONTRAP_CORE_API bool | is_symbolic_link (const std::string &path) |
| Checks if a file is a symbolic link.
|
CONTRAP_CORE_API bool | file_exists (const std::string &file_name) |
| Checks whether a file exists.
|
CONTRAP_CORE_API int | get_file_size (const std::string &file_name) |
| Returns the size of a file.
|
CONTRAP_CORE_API void | create_directory (const std::string &path) |
| Creates a directory.
|
CONTRAP_CORE_API std::string | to_native_path (const std::string &path) |
| Converts a path to the native system path.
|
CONTRAP_CORE_API std::string | to_simple_path (const std::string &path) |
| Simplifies a path not to contain trailing or double path delimiters.
|
CONTRAP_CORE_API bool | is_relative_path (const std::string &path) |
| Checks if a file path is a relative path or not.
|
CONTRAP_CORE_API std::string | get_name_component (const std::string &path) |
| Returns the name component of a file path.
|
CONTRAP_CORE_API std::string | get_path_component (const std::string &file_name) |
| Returns the path of a file name by splitting up the last component.
|
CONTRAP_CORE_API std::string | relative_path (const std::string &reference, const std::string relative) |
| Creates a path relative to a given path.
|
CONTRAP_CORE_API std::string | make_temporary_file () |
| Makes a temporary file name.
|
CONTRAP_CORE_API bool | read_file (const std::string &file_name, std::string &contents) |
| Reads a file to a string.
|
CONTRAP_CORE_API bool | write_file (const std::string &file_name, const std::string &contents) |
| Writes a string to a file.
|
CONTRAP_CORE_API time_t | time_of_last_change (const std::string &file_name) |
| Returns the date of last file change.
|
CONTRAP_CORE_API std::vector
< std::string > | break_paths (const std::string &paths) |
| Breaks a ":"-separeted list of paths into a vector.
|
CONTRAP_CORE_API std::string | is_library_path (const std::string &path) |
| Returns a non-empty string if the file path is a path to a ContRap library.
|
CONTRAP_CORE_API std::string | type_hash (const std::string &type) |
| Type hash function, which returns a hash of a type used to compare function interfaces efficiently.
|
CONTRAP_CORE_API void | dummy_destructor (void *) |
| Dummy destructor function which does nothing.
|
CONTRAP_CORE_API bool | add_extend (XMLDataPool *pool, const std::string &base_class, const std::string &super_class) |
| Adds a class extend definition.
|
CONTRAP_CORE_API MetaInfo * | get_global_meta_info (const char *type_name) |
| Returns the meta info for a type.
|
CONTRAP_CORE_API SPtr< Scope > | get_nested_scope (SPtr< Scope > scope, const std::string &name, bool create) |
| Routes to the scope which is pointed by an identifier.
|
std::string | encode_hexadecimal (const char *array, size_t size) |
| Converts a byte array to a string with hexadecimal numbers.
|
void | decode_hexadecimal (const std::string &code, char *buffer) |
| Decodes a string with hexadecimal numbers to a byte array.
|
template<typename T > |
T | round (const T &x) |
| Rounding function.
|
template<class T > |
T * | v2a (std::vector< T > &vector) |
| Converts a vector to a C array.
|
template<class T > |
T * | v2a (std::vector< T > *vector) |
| Converts a vector to a C array.
|
template<class T > |
void | clear_vector (std::vector< T > *vector) |
| Deletes all the entries from a vector and clears the vector.
|
template<class T > |
void | clear_vector (std::vector< T > &vector) |
| Deletes all the entries from a vector and clears the vector.
|
CONTRAP_CORE_API std::string | trim (const std::string &string) |
| Converts a string not to have leading, tail or subsequent.
|
CONTRAP_CORE_API std::string | trimlr (const std::string &string) |
| Converts a string not to have leading or tail subsequent.
|
CONTRAP_CORE_API std::string | up (const std::string &string) |
| Converts a string to upper case.
|
CONTRAP_CORE_API std::string | low (const std::string &string) |
| Converts a string to lower case.
|
CONTRAP_CORE_API std::string | b2s (const bool value) |
| Converts an boolean to a string.
|
CONTRAP_CORE_API std::string | p2s (const void *pointer) |
| Converts an pointer to a string.
|
CONTRAP_CORE_API std::string | i2s (integer_t value) |
| Converts an integer to a string.
|
CONTRAP_CORE_API std::string | d2s (floating_t value, size_t decimal=0) |
| Converts a double to a string.
|
CONTRAP_CORE_API floating_t | s2d (const std::string &value) |
| Converts a string to a double.
|
CONTRAP_CORE_API integer_t | s2i (const std::string &value) |
| Converts a string to an int.
|
CONTRAP_CORE_API integer_t | s2ih (const std::string &value) |
| Converts a string in hexadecimal representation to an int.
|
CONTRAP_CORE_API bool | is_number (const std::string &value) |
| Checks if the string is a number.
|
CONTRAP_CORE_API bool | is_float (const std::string &value) |
| Checks if the string is a floating point number.
|
CONTRAP_CORE_API bool | is_hex (const std::string &value) |
| Checks if the string is a hexdecimal number.
|
CONTRAP_CORE_API bool | starts_with (const std::string &string, const std::string &start) |
| Checks if a string starts with a certain phrase.
|
CONTRAP_CORE_API bool | matches (const std::string &text, size_t position, const std::string &phrase) |
| Checks if a string matches with a certain phrase a the given position.
|
CONTRAP_CORE_API bool | ends_with (const std::string &string, const std::string &end) |
| Checks if a string ends with a certain phrase.
|
CONTRAP_CORE_API std::string | underscore_string (const std::string &input) |
| Creates a new string from an input string, where each non-letter or number is replaced by "_".
|
CONTRAP_CORE_API std::string | remove_comments (const std::string &string) |
| Throws away all characters after a hash symbol.
|
CONTRAP_CORE_API std::string | remove_invisible_symbols (const std::string &input) |
| Removes all invisible and non ASCII symbols.
|
CONTRAP_CORE_API std::string | insert_line_breaks (const std::string &input, int length) |
| Inserts new lines into a string to ensure the text the given length in each line.
|
CONTRAP_CORE_API std::string | escape_symbol (const std::string &string, char symbol, const std::string &escape) |
| Escapes each occurrence of the given symbol.
|
CONTRAP_CORE_API std::string | replace (const std::string &string, const std::string &query, const std::string &replace) |
| Replaces a single query.
|
CONTRAP_CORE_API std::string | multiple_replace (const std::string &string, const std::vector< std::string > &queries, const std::vector< std::string > &replace) |
| Replaces a multiple set of queries one after another.
|
CONTRAP_CORE_API std::string | trim_size (const std::string &input, int length) |
| Trims a string to the given length by removing inner symbols and inserting a ...
|
CONTRAP_CORE_API std::vector
< std::string > | break_string (const std::string &input) |
| Creates an array of strings separated by the exactly the selector ':' excluding ':=' and '::'.
|
CONTRAP_CORE_API std::vector
< double > | break_string (const std::string &input, const std::string &delimiters) |
| Creates a double array from a string with given separators.
|
CONTRAP_CORE_API std::vector
< std::string > | break_strings (const std::string &input, const std::string &delimiters) |
| Creates an array of strings separated by the given delimiter.
|
CONTRAP_CORE_API bool | string_to_range (const std::string &input, double &min, double &max, const std::string &delimiter="..") |
| Interprets a string as a range separated by a given delimiter symbol ('..' by default)
|
CONTRAP_CORE_API std::vector
< std::string > | get_cpp_error (const std::string &input) |
| Finds compiler error messages for the GNU C++ compiler.
|
CONTRAP_CORE_API std::string | replace_tokens (const std::string &input, const std::string &query, const std::string &replacement, const std::string &delimiters) |
| Replaces in a given string occurrences of a query string, which are tokens with respect to a given set of delimiters.
|
CONTRAP_CORE_API std::string | to_rich_text (const std::string &text) |
| Prepares the string for meta-ritch text output.
|
CONTRAP_CORE_API std::string | to_cpp_text (const std::string &text) |
| Prepares a string for printing to a C++ file.
|
CONTRAP_CORE_API size_t | find_delimiter (const std::string &text) |
| Returns the position of a single ":" from the beginning in the string or std::string::npos.
|
CONTRAP_CORE_API int | count_occurrences (const std::string &text, const std::string &query) |
| Counts the number of occurrences of a substring in the string.
|
CONTRAP_CORE_API std::string | get_current_directory () |
| Returns the current directory.
|
CONTRAP_CORE_API std::string | get_home_directory () |
| Returns the path to the home directory (which is meant to be the user space to store local ContRap information)
|
CONTRAP_CORE_API const
std::string & | get_contrap_install_path () |
| Returns the installation path of ContRap.
|
CONTRAP_CORE_API std::string | get_environment_variable (const std::string &variable) |
| Returns the environment variable with the given name.
|
CONTRAP_CORE_API void | sleep_ms (int time) |
| Suspends the process for a given number of milliseconds.
|
CONTRAP_CORE_API void | set_user_signal (void(*callback)(int)) |
| Sets the callback for the user level interrupt.
|
template<class C , class T > |
SPtr< C > | cast (const SPtr< T > &object) |
| Casts a smart pointer to a different type.
|
template<class C , class T > |
SPtr< C > | abort_cast (const SPtr< T > &object, const std::string &message="Invalid cast") |
| Casts a smart pointer to a different type.
|
template<class C , class T > |
SPtr< C > | hard_cast (const SPtr< T > &object, const std::string &message="Invalid type cast") |
| Casts a smart pointer to a different type.
|
template<class T > |
SPtr< T > | cast (const DPtr &object) |
| Casts a data pointer to a smart pointer.
|
template<class T > |
SPtr< T > | abort_cast (const DPtr &object, const std::string &message="Invalid type cast") |
| Casts a data pointer to a smart pointer.
|
template<class T > |
SPtr< T > | hard_cast (const DPtr &object, const std::string &message) |
| Casts a data pointer to a smart pointer.
|
CONTRAP_CORE_API std::string | to_xml (const std::string &message) |
| Encodes a message to XML format by escaping all XML-tags.
|
CONTRAP_CORE_API std::string | from_xml (const std::string &message) |
| Decodes a message with escaped XML-charactes back to normal text.
|
Variables |
std::ostringstream | out |
| Stream for intermediate result output.
|
const Operator | internal_operators [] |
| List of built in operators.
|