GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Expression.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 
7 #ifndef GDCORE_EXPRESSION_H
8 #define GDCORE_EXPRESSION_H
9 
10 #include "GDCore/String.h"
11 #include <memory>
12 
13 namespace gd {
14 class ExpressionParser2;
15 class ObjectsContainer;
16 struct ExpressionNode;
17 } // namespace gd
18 
19 namespace gd {
20 
30 class GD_CORE_API Expression {
31  public:
35  Expression();
36 
40  Expression(gd::String plainString_);
41 
45  Expression(const char* plainString_);
46 
50  Expression(const Expression& copy);
51 
55  Expression& operator=(const Expression& expression);
56 
60  inline const gd::String& GetPlainString() const { return plainString; };
61 
66  gd::ExpressionNode* GetRootNode() const;
67 
71  inline const char* c_str() const { return plainString.c_str(); };
72 
73  virtual ~Expression();
74 
75  private:
76  gd::String plainString;
77  mutable std::unique_ptr<gd::ExpressionNode> node;
78 };
79 
80 } // namespace gd
81 
82 #endif // GDCORE_EXPRESSION_H
Class representing an expression used as a parameter of a gd::Instruction. This class is nothing more...
Definition: Expression.h:30
const gd::String & GetPlainString() const
Get the plain string representing the expression.
Definition: Expression.h:60
const char * c_str() const
Mimics std::string::c_str.
Definition: Expression.h:71
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24
The base node, from which all nodes in the tree of an expression inherits from.
Definition: ExpressionParser2Node.h:100