PhoenixGenerator  2.0.0
Set of tools to generate code
type_utils.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 
8 #include "type_utils.h"
9 
11 
14 bool generator_typeIsList(const PString & type){
15  return type.isSameBegining("std::list");
16 }
17 
19 
23  if(!generator_typeIsList(type)){return "";}
24  PString subType(type.substr(9lu));
25  return subType.eraseFirstLastChar("<> \t\n");
26 }
27 
28 
29 
Extends the std::string.
Definition: PString.h:16
bool isSameBegining(const PString &beginStr) const
Say if the current PString has the same begining of beginStr.
Definition: PString.cpp:306
PString eraseFirstLastChar(const PString &vecChar) const
Erase first and last char in a string.
Definition: PString.cpp:545
PString generator_getListNestedType(const PString &type)
Get the nested type inside a std::list.
Definition: type_utils.cpp:22
bool generator_typeIsList(const PString &type)
Say if a given type is a std::list.
Definition: type_utils.cpp:14