Home | Develop | Download | Contact
example_ra_match.cpp

Programa para el testeo de las funciones.

Programa para el testeo de las funciones.Para compilar o código example_ra_match.cpp:

g++ -static -o example_ra_match example_ra_match.cpp -lpdsramm

Para executar o programa:

./example_ra_match

Retornando por consola:

Found a*f     in : abcdef ? 0
Found a*f     in : abcdee ? 1
Found [a-z]xx in : qxx    ? 0
Found [a-z]xx in : dqxx   ? 1
Found a??     in : abc    ? 0
Found a??     in : abcd   ? 1

Código example_ra_match.cpp:

#include <Pds/Ra>
int main(void)
{
std::cout<<"Found a*f in : abcdef ? ";
std::cout<<Pds::Ra::FnMatch("a*f","abcdef",Pds::Ra::FNM_CASEFOLD);
std::cout<<std::endl;
std::cout<<"Found a*f in : abcdee ? ";
std::cout<<Pds::Ra::FnMatch("a*f","abcdee",Pds::Ra::FNM_CASEFOLD);
std::cout<<std::endl;
std::cout<<"Found [a-z]xx in : qxx ? ";
std::cout<<Pds::Ra::FnMatch("[a-z]xx","qxx",Pds::Ra::FNM_CASEFOLD);
std::cout<<std::endl;
std::cout<<"Found [a-z]xx in : dqxx ? ";
std::cout<<Pds::Ra::FnMatch("[a-z]xx","dqxx",Pds::Ra::FNM_CASEFOLD);
std::cout<<std::endl;
std::cout<<"Found a?? in : abc ? ";
std::cout<<Pds::Ra::FnMatch("a??","abc",Pds::Ra::FNM_CASEFOLD);
std::cout<<std::endl;
std::cout<<"Found a?? in : abcd ? ";
std::cout<<Pds::Ra::FnMatch("a??","abcd",Pds::Ra::FNM_CASEFOLD);
std::cout<<std::endl;
return 0;
}
int FnMatch(const std::string &pattern, const std::string &string, int flags)
función similar a fnmatch(), creada para tener compatibilidad en MinGw (code From FreeBSD fnmatch....
const unsigned int FNM_CASEFOLD
Definition: RaMatch.hpp:101

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed