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 43 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 190 of file Parser.C.

191{
192 std::vector<std::string> argv;
193 argv.insert(argv.begin(), args.begin(), args.end());
194
195 if (argv.size() != 2)
196 {
197 exp.errors.emplace_back(
198 "repeat error: Expected 2 arguments ${repeat name count} in '" + n->fullpath() + "'", n);
199 return n->val();
200 }
201
202 const auto & count_arg = argv[1];
203 if (count_arg.empty() || count_arg.find_first_not_of("0123456789") != std::string::npos)
204 {
205 exp.errors.emplace_back("repeat error: count '" + count_arg +
206 "' is not a non-negative integer in '" + n->fullpath() + "'",
207 n);
208 return n->val();
209 }
210
211 const std::vector<std::string> values(MooseUtils::convert<int>(count_arg), argv[0]);
213}
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: