Home | Develop | Download | Contact
example_ra_string_is.cpp
1
37#include <iostream>
38#include <Pds/Ra>
39
40
41int main(void)
42{
43
44 std::cout<<"Pds::Ra::IsInteger(\"\"): "<<Pds::Ra::IsInteger("")<<std::endl;
45 std::cout<<"Pds::Ra::IsReal(\"\"): "<<Pds::Ra::IsReal("")<<std::endl;
46
47 std::cout<<std::endl;
48
49 std::cout<<"Pds::Ra::IsInteger(\"-\"): "<<Pds::Ra::IsInteger("-")<<std::endl;
50 std::cout<<"Pds::Ra::IsReal(\"-\"): "<<Pds::Ra::IsReal("-")<<std::endl;
51
52 std::cout<<std::endl;
53
54 std::cout<<"Pds::Ra::IsInteger(\"+\"): "<<Pds::Ra::IsInteger("+")<<std::endl;
55 std::cout<<"Pds::Ra::IsReal(\"+\"): "<<Pds::Ra::IsReal("+")<<std::endl;
56
57 std::cout<<std::endl;
58
59 std::cout<<"Pds::Ra::IsInteger(\"-1\"): "<<Pds::Ra::IsInteger("-1")<<std::endl;
60 std::cout<<"Pds::Ra::IsReal(\"-1\"): "<<Pds::Ra::IsReal("-1")<<std::endl;
61 std::cout<<std::endl;
62
63 std::cout<<"Pds::Ra::IsInteger(\"-1234\"): "<<Pds::Ra::IsInteger("-1234")<<std::endl;
64 std::cout<<"Pds::Ra::IsReal(\"-1234\"): "<<Pds::Ra::IsReal("-1234")<<std::endl;
65
66 std::cout<<std::endl;
67
68 std::cout<<"Pds::Ra::IsInteger(\"-1.234e-3\"): "<<Pds::Ra::IsInteger("-1.234e-3")<<std::endl;
69 std::cout<<"Pds::Ra::IsReal(\"-1.234e-3\"): "<<Pds::Ra::IsReal("-1.234e-3")<<std::endl;
70
71 return 0;
72}
bool IsReal(const std::string &str)
Retorna true si es un real (double) o false si no.
bool IsInteger(const std::string &str)
Retorna true si es un entero (positivo o negativo) o false si no.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed