output.hh

Go to the documentation of this file.
1 
6 #ifndef Output_hh
7 #define Output_hh
8 
9 #include <fstream>
10 #include <typeinfo>
11 
12 namespace concepts {
13 
14  // *********************************************************** ensureEnding **
15 
20  std::string ensureEnding(const std::string& filename,
21  const std::string ending);
22 
34  std::string demangle(const char* name);
35 
42  template <class T>
43  std::string typeOf(const T& t) {
44 
45  return demangle(typeid(t).name());
46  }
47 
55  template<class TagT>
56  struct getTypeOfObject {
57  static const std::string name() {
58  return demangle(typeid(TagT()).name());
59  }
60  };
61 
62 } // namespace concepts
63 
64 #endif // Output_hh
Return the dynamic type of a polymorphic object.
Definition: output.hh:56
std::string ensureEnding(const std::string &filename, const std::string ending)
Returns a string with particular ending.
static const std::string name()
Definition: output.hh:57
std::string demangle(const char *name)
Returns the class name of a typeid name return statement.
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich