Lines Matching +full:input +full:- +full:value

51 /// A template statement is a particular line in the input file that is
52 /// preceeded by a template marker. This class provides a high-level
54 /// the textual line into this high-level representation.
190 if (words.size() - 1 != descriptor.n_arguments) in parse()
195 new_arguments.resize(words.size() - 1); in parse()
216 /// Position in the input to which to rewind to on looping.
220 /// we can maintain the data about the loop without having to re-process it.
236 /// Stateful class to instantiate the templates in an input stream.
238 /// The goal of this parser is to scan the input once and not buffer anything in
240 /// iteration from the same input file by rewidining the stream to the
260 /// Under these circumstances, we need to continue scanning the input stream
264 /// if-else clauses.
270 /// Level of the top-most conditional that evaluated to false.
276 /// Level of the top-most loop that does not have any iterations left.
303 /// \throw text::syntax_error If the input is not a valid statement.
311 /// Processes a line from the input when not in skip mode.
314 /// \param input The input stream from which the line was read. The current
318 /// \throw text::syntax_error If the input is not valid.
320 handle_normal(const std::string& line, std::istream& input, in handle_normal() argument
338 _if_level--; in handle_normal()
350 input.seekg(loop.position); in handle_normal()
352 _loop_level--; in handle_normal()
360 const std::string value = _templates.evaluate( in handle_normal() local
362 if (value.empty() || value == "0" || value == "false") { in handle_normal()
374 input.tellg()); in handle_normal()
387 /// Processes a line from the input when in skip mode.
391 /// \throw text::syntax_error If the input is not valid.
411 _if_level--; in handle_skip()
419 _loop_level--; in handle_skip()
438 /// Evaluates expressions on a given input line.
442 /// them out and call templates_def::evaluate() to get their value.
444 /// Lonely or unbalanced appearances of _delimiter on the input line are
448 /// \param in_line The input line from which to evaluate expressions.
472 out_line += in_line.substr(last_pos, open_pos - last_pos); in evaluate()
475 close_pos - open_pos - _delimiter.length())); in evaluate()
503 /// Applies the templates to a given input.
505 /// \param input The stream to which to apply the templates.
508 /// \throw text::syntax_error If the input is not valid. Note that the
512 instantiate(std::istream& input, std::ostream& output) in instantiate() argument
515 while (std::getline(input, line).good()) { in instantiate()
519 handle_normal(evaluate(line), input, output); in instantiate()
536 /// If the variable already exists, its value is replaced. This behavior is
543 /// \param value The value to set the given variable to.
546 const std::string& value) in add_variable() argument
549 _variables[name] = value; in add_variable()
585 /// Adds a value to an existing vector in the templates.
589 /// \param name The name of the vector to append the value to.
590 /// \param value The textual value to append to the vector.
593 const std::string& value) in add_to_vector() argument
597 _vectors[name].push_back(value); in add_to_vector()
617 /// Gets the value of a variable.
621 /// \return The value of the requested variable.
651 /// Indexes a vector and gets the value.
657 /// \return The value of the vector at the given index.
672 throw text::syntax_error(F("Index '%s' not an integer, value '%s'") % in get_vector()
686 /// value. The value is always returned as a string, as this is how templates
690 /// of the delimiters used in the user input, as otherwise the expression
709 if (paren_close != expression.length() - 1) in evaluate()
715 paren_open + 1, paren_close - paren_open - 1); in evaluate()
727 /// Applies a set of templates to an input stream.
730 /// \param input The input to process.
733 /// \throw text::syntax_error If there is any problem processing the input.
736 std::istream& input, std::ostream& output) in instantiate() argument
739 parser.instantiate(input, output); in instantiate()
743 /// Applies a set of templates to an input file and writes an output file.
746 /// \param input_file The path to the input to process.
749 /// \throw text::error If the input or output files cannot be opened.
750 /// \throw text::syntax_error If there is any problem processing the input.
755 std::ifstream input(input_file.c_str()); in instantiate() local
756 if (!input) in instantiate()
763 instantiate(templates, input, output); in instantiate()