Skip to content
Snippets Groups Projects
Commit 85ec635b authored by ilor's avatar ilor
Browse files

add valid_variable_names accesor to ParsedExpression

parent 30c172ea
Branches
No related merge requests found
...@@ -139,6 +139,11 @@ public: ...@@ -139,6 +139,11 @@ public:
*/ */
boost::shared_ptr<ParsedExpression> clone_clean_ptr() const; boost::shared_ptr<ParsedExpression> clone_clean_ptr() const;
/**
* @returns vector of strings corresponfing to valid variable names
* in this operator.
*/
std::vector<std::string> valid_variable_names() const;
/** /**
* @returns String with representation of all held variables, * @returns String with representation of all held variables,
...@@ -232,6 +237,17 @@ boost::shared_ptr<ParsedExpression> ParsedExpression::clone_clean_ptr() const { ...@@ -232,6 +237,17 @@ boost::shared_ptr<ParsedExpression> ParsedExpression::clone_clean_ptr() const {
return copy; return copy;
} }
inline
std::vector<std::string> ParsedExpression::valid_variable_names() const {
std::vector<std::string> valid;
typedef std::pair<std::string, boost::shared_ptr<Wccl::Value> > v_t;
// ja chcę c++1x i auto/decltype
foreach (const v_t& v, variables_->get_all<Wccl::Value>()) {
valid.push_back(v.first);
}
return valid;
}
inline inline
std::ostream& ParsedExpression::dump_variables( std::ostream& ParsedExpression::dump_variables(
std::ostream &ostream, std::ostream &ostream,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment