Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParseExp.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
11 /* This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This software is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public
22  * License along with this software. If not, see
23  * <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef PARSEEXP_H
28 #define PARSEEXP_H
29 #include <string>
30 #include <vector>
31 #include <iostream>
32 #include <hugin_shared.h>
33 #include "hugin_config.h"
34 #include "panodata/Panorama.h"
35 
36 namespace Parser
37 {
40 {
41  std::string varname;
42  // contains image number or -1 if it applies to all images
43  int imgNr;
44  std::string expression;
45  bool flag;
46  ParseVar();
47 };
48 typedef std::vector<ParseVar> ParseVarVec;
49 
52 IMPEX bool ParseVarNumber(const std::string&s, Parser::ParseVar& var);
54 IMPEX void ParseVariableString(ParseVarVec& parseVec, const std::string& input, std::ostream& errorStream, void(*func)(ParseVarVec&, const std::string&, std::ostream&));
55 
57 IMPEX void PanoParseExpression(HuginBase::Panorama& pano, const std::string& expression, std::ostream& statusStream = std::cout, std::ostream& errorStream = std::cerr);
58 };
59 
60 #endif
void ParseVariableString(ParseVarVec &parseVec, const std::string &input, std::ostream &errorStream, void(*func)(ParseVarVec &, const std::string &, std::ostream &))
parse complete variables string
Definition: ParseExp.cpp:699
IMPEX bool ParseVarNumber(const std::string &s, Parser::ParseVar &var)
parse string s and store result in ParseVar var
struct to save parsed variables and optional image numbers
Definition: ParseExp.h:39
IMPEX void PanoParseExpression(HuginBase::Panorama &pano, const std::string &expression, std::ostream &statusStream=std::cout, std::ostream &errorStream=std::cerr)
parses the given expression and apply the changes to the Panorama
std::string expression
Definition: ParseExp.h:44
Model for a panorama.
Definition: Panorama.h:152
std::vector< ParseVar > ParseVarVec
Definition: ParseExp.h:48
std::string varname
Definition: ParseExp.h:41
#define IMPEX
Definition: hugin_shared.h:39