-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringExpr.hpp
More file actions
34 lines (27 loc) · 817 Bytes
/
StringExpr.hpp
File metadata and controls
34 lines (27 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef STRINGEXPR_HPP
#define STRINGEXPR_HPP
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <map>
#include <set>
#include <string>
namespace oneandone {
namespace nms {
struct StringExprPrivate;
class StringExpr : boost::noncopyable
{
public:
// TODO this constructor should also take the list of available variable names for validation
// purposes
StringExpr(const std::string &expr);
~StringExpr();
const std::string Eval(const std::map<std::string, std::string> &vars) const;
const std::set<std::string> GetVars() const;
std::string GetStringExpr() const { return string_expr_; }
private:
boost::scoped_ptr<StringExprPrivate> string_parse_;
std::string string_expr_;
};
} // namespace oneandone
} // namespace nms
#endif // STRINGEXPR_HPP