https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RepeatEvaler Class Reference

#include <Parser.h>

Inheritance diagram for RepeatEvaler:
[legend]

Public Member Functions

virtual std::string eval (hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)
 

Detailed Description

Definition at line 50 of file Parser.h.

Member Function Documentation

◆ eval()

std::string RepeatEvaler::eval ( hit::Field *  n,
const std::list< std::string > &  args,
hit::BraceExpander &  exp 
)
virtual

Definition at line 262 of file Parser.C.

263{
264 std::vector<std::string> argv;
265 argv.insert(argv.begin(), args.begin(), args.end());
266
267 if (argv.size() != 2)
268 {
269 exp.errors.emplace_back(
270 "repeat error: Expected 2 arguments ${repeat name count} in '" + n->fullpath() + "'", n);
271 return n->val();
272 }
273
274 const auto & count_arg = argv[1];
275 if (count_arg.empty() || count_arg.find_first_not_of("0123456789") != std::string::npos)
276 {
277 exp.errors.emplace_back("repeat error: count '" + count_arg +
278 "' is not a non-negative integer in '" + n->fullpath() + "'",
279 n);
280 return n->val();
281 }
282
283 const std::vector<std::string> values(MooseUtils::convert<int>(count_arg), argv[0]);
285}
std::array< Real, 2 > values
Definition MortarUtils.C:52
auto exp(const T &)
std::string stringJoin(const std::vector< std::string > &values, const std::string &separator=" ")
Concatenates value into a single string separated by separator.

The documentation for this class was generated from the following files: