Home | Develop | Download | Contact
example_ra_string_split_object.cpp
1
33#include <iostream>
34#include <Pds/Ra>
35
36
37int main(void)
38{
39 std::string str;
40 std::vector<std::string> data;
41
42 str = " {etiqueta1} \t ; \t {etiqueta2} ; {etiqueta3} ";
43 data = Pds::Ra::SplitMultipleObjectsAndSeparator(str,'{','}',';');
44 std::cout<<str<<std::endl;
46 std::cout<<std::endl;
47
48 str = " {etiqueta1 { child } other text} \t ; \t {etiqueta2} ; {etiqueta3{ child } other text 3} ";
49 data = Pds::Ra::SplitMultipleObjectsAndSeparator(str,'{','}',';');
50 std::cout<<str<<std::endl;
52 std::cout<<std::endl;
53
54 str = " {etiqueta1 { child {sub child} } other text} \t ; \t {etiqueta2} ";
55 data = Pds::Ra::SplitMultipleObjectsAndSeparator(str,'{','}',';');
56 std::cout<<str<<std::endl;
58 std::cout<<std::endl;
59
60 return 0;
61}
std::vector< std::string > SplitMultipleObjectsAndSeparator(const std::string &str, char DelL, char DelR, char sep)
Dado un par de caracteres y un caracter separador, retorna un vector con varios objetos....
bool PrintVectorString(const std::vector< std::string > &str)
Print each string of a vector string in a new line in a text file.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed