840{
842
844 {
846 {
847 Oks::Tokenizer t(
range,
",");
848 std::string token, token1, token2;
849
850 while (t.next(token))
851 {
853 {
854 TLOG_DEBUG(2) <<
"token \'" << token <<
"\' of \'" <<
range <<
"\' allows any value";
856 return;
857 }
858
859 static const char __dot_dot_str[] = "..";
860 std::string::size_type p = token.find(__dot_dot_str, 0, (sizeof(__dot_dot_str) - 1));
861
862 bool pi;
863
864 if (p != std::string::npos)
865 {
866 token1.assign(token, 0, p);
867 token2.assign(token, p + 2, std::string::npos);
869 }
870 else
871 {
872 token1.assign(token);
873 token2.clear();
874 pi = false;
875 }
876
878
879 if (mi && pi)
880 {
881 TLOG_DEBUG(2) <<
"token \'" << token <<
"\' of \'" <<
range <<
"\' allows any value";
883 return;
884 }
885
886 OksData d1, d2;
887
888 if (!mi)
889 {
890 d1.type = a->get_data_type();
891 d1.ReadFrom(token1, a);
892 }
893
894 if (token2.empty())
895 {
896 TLOG_DEBUG(2) <<
"token \'" << token <<
"\' of \'" <<
range <<
"\' defines equality condition";
898 }
899 else
900 {
901 if (!pi)
902 {
903 d2.type = a->get_data_type();
904 d2.ReadFrom(token2, a);
905 }
906
907 if (mi)
908 {
909 TLOG_DEBUG(2) <<
"token \'" << token <<
"\' of \'" <<
range <<
"\' defines smaller condition";
911 }
912 else if (pi)
913 {
914 TLOG_DEBUG(2) <<
"token \'" << token <<
"\' of \'" <<
range <<
"\' defines greater condition";
916 }
917 else
918 {
919 TLOG_DEBUG(2) <<
"token \'" << token <<
"\' of \'" <<
range <<
"\' defines interval condition";
921 }
922 }
923 }
924 }
925 }
926 else
927 {
928 try
929 {
931 }
932 catch (std::exception& ex)
933 {
934 throw BadReqExp(
range, ex.what());
935 }
936 }
937}
#define TLOG_DEBUG(lvl,...)
bool is_star(const std::string &s)