GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
chaiscript_prelude_docs.hpp
Go to the documentation of this file.
1
3
6{
7
15
16
23class Object
24{
25 public:
28
30 bool is_type(string) const;
31
33 bool is_type(Type_Info) const;
34
36 bool is_var_const() const;
37
39 bool is_var_null() const;
40
42 bool is_var_pointer() const;
43
45 bool is_var_reference() const;
46
48 bool is_var_undef() const;
49
53 string type_name() const;
54};
55
58{
59 public:
61 const string first();
62
65};
66
67
88class Map
89{
90 public:
93
96
98 int size() const;
99
102
104 void clear();
105
107 int count(string) const;
108
110 bool empty() const;
111
112};
113
114
117{
118 public:
122};
123
124
132
133
141void puts(Object o);
142
143
152void print(Object o);
153
168{
169 public:
175 int find(string s) const;
176
177
183 int rfind(string s) const;
184
191 int find_first_of(string list) const;
192
199 int find_last_of(string list) const;
200
207 int find_first_not_of(string list) const;
208
215 int find_last_not_of(string list) const;
216
227 string lstrim() const;
228
239 string rtrim() const;
240
253 string trim() const;
254
256 const char &operator[](int t_index) const;
257
259 char &operator[](int t_index);
260
262 const char *c_str() const;
263
265 const char *data() const;
266
268 void clear();
269
271 bool empty() const;
272
277 int size() const;
278
281
284};
285
292class Range
293{
294 public:
297
300 bool empty() const;
301
304
308 void pop_back();
309
313 void pop_front();
314
315};
316
324{
325 public:
327 const Object back();
328
331 bool empty() const;
332
334 const Object front();
335
339 void pop_back();
340
344 void pop_front();
345
346};
347
366{
367 public:
369 Object operator[](int t_index);
370
372 const Object operator[](int t_index) const;
373
376
378 void clear();
379
381 bool empty();
382
384 void erase_at(int t_index);
385
388
393
397 void insert_at(int, Object);
398
400 void pop_back();
401
406
411
414
417
419 int size() const;
420
421};
422
424{
425 public:
428 bool bare_equal(Type_Info t_ti) const;
429
431 string cpp_bare_name() const;
432
434 string cpp_name() const;
435
437 bool is_type_const() const;
438
440 bool is_type_pointer() const;
441
443 bool is_type_reference() const;
444
446 bool is_type_undef() const;
447
449 bool is_type_void() const;
450
452 string name() const;
453
454};
455
456
478{
479 public:
481 string get_annotation() const;
482
492 int get_arity() const;
493
507
518
536
538 bool has_guard() const;
539
547 Object call(Vector t_params) const;
548}
549
550
551
563Object max(Object a, Object b);
564
578
588bool even(Object x);
589
599bool even(Object x);
600
601
612
613
622
623
633
634
647Numeric sum(Range c);
648
649
662Numeric product(Range c);
663
664
675
676
687
688
699
700
709
710
719
720
729
730
738string join(Range c, string delim);
739
740
749
750
761
762
771
772
781
782
791
792
801
802
811
814
817
818
828void throw(Object);
829}
830
A concept in ChaiScript that is implemented by string, Vector and Map. It provides easy iteration ove...
Definition chaiscript_prelude_docs.hpp:324
const Object back()
Returns the last item of the range.
const Object front()
Returns the first item of the range.
void pop_back()
Moves the back pointer back one.
bool empty() const
Returns true if the front and back pointers have passed each other, if no items are left in the Range...
void pop_front()
Moves the front pointer forward one.
A concept implemented by string, Vector and Map. It is convertible to Range, default constructable an...
Definition chaiscript_prelude_docs.hpp:117
Const_Range range() const
Represents a function object in ChaiScript.
Definition chaiscript_prelude_docs.hpp:478
Vector get_contained_functions() const
Returns a vector of the contained functions.
Object call(Vector t_params) const
Calls the function with the given set of parameters and returns the value;.
string get_annotation() const
Returns the annotation description of the function.
Function get_guard() const
Returns a function guard as function.
Vector get_param_types() const
Returns a vector of Type_Info objects that represent the param types for this function....
int get_arity() const
Returns the arity of the function, -1 if the function takes a variable number of parameters.
bool has_guard() const
Returns true if the function has a guard to it. Always returns false for a conglomerate function.
Item returned from a Range object from a Map.
Definition chaiscript_prelude_docs.hpp:58
const string first()
Returns the key of the Map entry.
Object second()
Returns the value Object of the Map entry.
Maps strings to Objects.
Definition chaiscript_prelude_docs.hpp:89
Object operator[](string)
Returns the item at the given key, creating an undefined Object if the key does not yet exist in the ...
void clear()
Clears the map of all items.
bool empty() const
Returns true if the map contains no items.
Range range()
Returns an object that implements the Range concept for the Map_Pair's in this Map.
int size() const
Returns the number of elements in the Map.
Const_Range range() const
Returns an object that implements the Const_Range concept for the Map_Pair's in this Map.
int count(string) const
Returns the number of items in the Map with the given key. Returns 0 or 1 since this is not an std::m...
Generic concept of a value in ChaiScript.
Definition chaiscript_prelude_docs.hpp:24
bool is_var_pointer() const
Returns true if the Object is stored as a pointer.
bool is_type(Type_Info) const
Returns true if the Object is of the Type_Info passed in.
string type_name() const
Returns the registered name of the type of the object.
bool is_var_undef() const
Returns true if the Object does not contain a value is is undefined.
bool is_var_null() const
Returns true if the Object is a pointer and the pointer is null.
bool is_type(string) const
Returns true if the Object is of the named type.
bool is_var_reference() const
Returns true if the Object is stored as a reference.
Type_Info get_type_info() const
Returns the Type_Info value for this Object.
bool is_var_const() const
Returns true if the Object is immutable.
A concept in ChaiScript that is implemented by string, Vector and Map. It provides easy iteration ove...
Definition chaiscript_prelude_docs.hpp:293
void pop_front()
Moves the front pointer forward one.
void pop_back()
Moves the back pointer back one.
Object back()
Returns the last item of the range.
bool empty() const
Returns true if the front and back pointers have passed each other, if no items are left in the Range...
Object front()
Returns the first item of the range.
Definition chaiscript_prelude_docs.hpp:424
string cpp_bare_name() const
Returns the mangled C++ name for the type given by the compiler after const, pointer,...
bool is_type_reference() const
Returns true if the type is a reference.
bool is_type_const() const
Returns true if the type is const.
bool is_type_undef() const
Returns true if the type is undefined.
string cpp_name() const
Returns the mangled C++ name for the type given by the compiler.
string name() const
Returns the ChaiScript registered name for the type if one exists.
bool bare_equal(Type_Info t_ti) const
Compares this Type_Info object with another one and returns true if the two types are the same after ...
bool is_type_void() const
Returns true if the type is "void".
bool is_type_pointer() const
Returns true if the type is a pointer.
A vector of Objects.
Definition chaiscript_prelude_docs.hpp:366
void clear()
Clears the Vector of all items.
void push_back(Object)
Adds an item to the end of the Vector. The item is cloned.
Object back()
returns the last item in the Vector
void erase_at(int t_index)
Erases the element at the given index.
void insert_at(int, Object)
Inserts a new item in the Vector at the given index. The item is cloned on insert.
const Object operator[](int t_index) const
returns a const Object at the given index. Throws an exception if the index does not exist.
int size() const
Returns the number of elements in the Vector.
Object operator[](int t_index)
returns the Object at the given index. Throws an exception if the index does not exist
void pop_back()
Removes the last item from the Vector.
Object front()
Returns the first item in the Vector.
Range range()
Returns a Range object for the entire vector.
bool empty()
Returns true if the Vector is contains 0 items.
void insert_ref_at(int, Object)
Inserts a new item in the Vector at the given index. The item is not cloned on insert.
void push_back_ref(Object)
Adds an item to the end of the Vector. The item is not cloned.
Const_Range range() const
Returns a Const_Range object for the entire vector.
ChaiScript representation of std::string. It is an std::string but only some member are exposed to Ch...
Definition chaiscript_prelude_docs.hpp:168
char & operator[](int t_index)
Returns the character at the given index in the string.
const char * data() const
Returns a pointer to the raw data in the string.
int rfind(string s) const
Finds the last instance of substr.
int size() const
Returns the size of the string in bytes.
int find(string s) const
Finds the first instance of substr.
string lstrim() const
Removes whitespace from the front of the string, returning a new string.
void clear()
Resets the string to empty.
const char & operator[](int t_index) const
Returns the character at the given index in the string, const version.
int find_first_not_of(string list) const
Finds the first non-matching character to list in the str string.
bool empty() const
Returns true if the string is empty.
string rtrim() const
Removes whitespace from the back of the string, returning a new string.
int find_last_of(string list) const
Finds the last of characters in list in the string.
string trim() const
Removes whitespace from the front and back of the string, returning a new string.
const char * c_str() const
Returns underlying const char * for C api compatibility.
int find_first_of(string list) const
Finds the first of characters in list in the string.
Range range()
Returns an object that implements the Range concept for the characters of this string.
Const_Range range() const
Returns an object that implements the Const_Range concept for the characters of this string.
int find_last_not_of(string list) const
Finds the last non-matching character to list in the list string.
Items in this namespace exist in the ChaiScript language runtime. They are not part of the C++ API.
Definition chaiscript_prelude_docs.hpp:6
Vector collate(Object x, Object y)
Returns a new Vector with x and y as its values.
Range retro(Range)
Reverses a Range object so that the elements are accessed in reverse.
Object drop(Range c, int num)
Drops num elements from the Range c, returning the remainder.
Object concat(Range x, Range y)
Returns a new Range with x and y concatenated.
Object foldl(Range c, Function f, Object initial)
Starts with the initial value and applies the function f to it and the first element of the Range c....
void for_each(Range c, Function f)
Applies the function f over each element in the Range c.
string to_string(Object o)
Converts o into a string.
Numeric sum(Range c)
Returns the sum total of the values in the Range c.
Vector zip(Range x, Range y)
Collates elements of x and y, returning a new Vector with the result.
Object min(Object a, Object b)
Returns the min of a or b. Requires that operator<(a, b) exists.
Object map(Range c, Function f)
Applies f over each element in the Range c, joining all the results.
void puts(Object o)
Prints o to the terminal, without a trailing carriage return. Applies conversions to string automatic...
Object take_while(Range c, Function f)
Takes elements from the Range c that match function f, stopping at the first non-match,...
void print(Object o)
Prints o to the terminal, with a trailing carriage return. Applies conversions to string automaticall...
Object take(Range c, int num)
Takes num elements from the Range c, returning them.
Container reverse(Container c)
Returns the contents of the Container c in reversed order.
bool even(Object x)
Returns true if x is an even integer.
Object drop_while(Range c, Function f)
Drops elements from the Range c that match f, stopping at the first non-match, returning the remainde...
Vector zip_with(Function f, Range x, Range y)
Applies f to elements of x and y, returning a new Vector with the result of each application.
Vector generate_range(Object x, Object y)
Generates a new Vector filled with values starting at x and ending with y.
class ChaiScript_Language::Function max(Object a, Object b)
Returns the max of a or b. Requires that operator>(a, b) exists Equivalent to.
Object reduce(Range c, Function f)
Similar to foldl, this takes the first two elements as its starting values for f. This assumes Range ...
string join(Range c, string delim)
Joins the elements of the Range c into a string, delimiting each with the delim string.
Object filter(Container c, Function f)
Takes elements from Container c that match function f, return them.
Numeric product(Range c)
Returns the product of the value in the Range c.
bool call_exists(Function f,...)
returns true if there exists a call to the Function f that takes the given parameters
double f(const std::string &, double, bool) noexcept
Definition profile_cpp_calls_2.cpp:4
num
Definition view.php:2821