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