PolyBoRi
CStringLiteral.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
33 //*****************************************************************************
34 
35 // include basic definitions
36 #include "pbori_defs.h"
37 
38 // get standard string capability
39 #include <string>
40 
41 // get literal codes (enumeration)
42 #include "CLiteralCodes.h"
43 
44 #ifndef CStringLiteral_h_
45 #define CStringLiteral_h_
46 
48 
54 template <unsigned LitCode = CLiteralCodes::first_code>
56 public:
57 
59  typedef std::string literal_type;
60 
63 
66 
68  literal_type operator()() const;
69 };
70 
71 
72 #define GENERATE_CSTRINGLITERAL(CODE, STRING) \
73 template <> inline CStringLiteral<>::literal_type \
74 CStringLiteral<CLiteralCodes::CODE>::operator()() const{ return STRING; }
75 
79 GENERATE_CSTRINGLITERAL(term_separator, " + ")
82 GENERATE_CSTRINGLITERAL(list_separator, ", ")
83 GENERATE_CSTRINGLITERAL(default_variable_name, "x")
84 GENERATE_CSTRINGLITERAL(variable_head, "(")
85 GENERATE_CSTRINGLITERAL(variable_tail, ")")
86 GENERATE_CSTRINGLITERAL(between_list_separator, "}, {")
87 
88 #undef GENERATE_CSTRINGLITERAL
89 
90 END_NAMESPACE_PBORI
91 
92 #endif