MI - Fimex
ReplaceStringTemplateObject.h
Go to the documentation of this file.
1 /*
2  * Fimex, ReplaceStringTemplateObject.h
3  *
4  * (C) Copyright 2013, met.no
5  *
6  * Project Info: https://wiki.met.no/fimex/start
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21  * USA.
22  *
23  * Created on: Jun 6, 2013
24  * Author: heikok
25  */
26 
27 #ifndef REPLACESTRINGTEMPLATEOBJECT_H_
28 #define REPLACESTRINGTEMPLATEOBJECT_H_
29 
30 #include "ReplaceStringObject.h"
31 
32 namespace MetNoFimex
33 {
34 
42 template<typename T>
44 {
45 public:
46  ReplaceStringTemplateObject(T obj) : obj_(obj) {}
48  virtual std::ostream& put(std::ostream& s) const { s << obj_; return s; }
50  virtual void setFormatString(const std::string& format) {}
52  virtual void setFormatStringAndOptions(const std::string& format, const std::vector<std::string>& options) {}
53 private:
54  T obj_;
55 };
56 
57 } /* namespace MetNoFimex */
58 #endif /* REPLACESTRINGTEMPLATEOBJECT_H_ */
virtual void setFormatStringAndOptions(const std::string &format, const std::vector< std::string > &options)
set the formatting string and additional options for this object, does nothing
Definition: ReplaceStringTemplateObject.h:52
Definition: ReplaceStringObject.h:40
basic_string< char > string
virtual std::ostream & put(std::ostream &s) const
Definition: ReplaceStringTemplateObject.h:48
basic_ostream< char > ostream
Definition: C_CDMReader.h:35
virtual ~ReplaceStringTemplateObject()
Definition: ReplaceStringTemplateObject.h:47
ReplaceStringTemplateObject(T obj)
Definition: ReplaceStringTemplateObject.h:46
Definition: ReplaceStringTemplateObject.h:43
virtual void setFormatString(const std::string &format)
set the formatting string for this object, does nothing
Definition: ReplaceStringTemplateObject.h:50