| 945 | } |
| 946 | |
| 947 | bool gsoner::check_member(void) |
| 948 | { |
| 949 | //struct user_t{int id; |
| 950 | |
| 951 | if (status_ != e_struct_begin) { |
| 952 | return false; |
| 953 | } |
| 954 | |
| 955 | std::string lines; |
| 956 | skip_space(); |
| 957 | |
| 958 | while (true) { |
| 959 | if(codes_[pos_] == '/') { |
| 960 | if(!check_comment()) { |
| 961 | throw syntax_error(); |
| 962 | } |
| 963 | continue; |
| 964 | } |
| 965 | |
| 966 | if (codes_[pos_] == '"') { |
| 967 | std::string str = get_static_string(codes_, pos_); |
| 968 | lines.push_back('"'); |
| 969 | lines += str; |
| 970 | lines.push_back('"'); |
| 971 | } |
| 972 | |
| 973 | if(codes_[pos_] == ';') { |
| 974 | break; |
| 975 | } |
| 976 | lines.push_back(codes_[pos_]); |
| 977 | pos_++; |
| 978 | } |
| 979 | std::cout << current_obj_.name_ << " "; |
| 980 | std::cout << lines << std::endl; |
| 981 | //skip ; |
| 982 | pos_++; |
| 983 | |
| 984 | //skip current field; |
| 985 | if (skip_) { |
| 986 | skip_ = false; |
| 987 | return true; |
| 988 | } |
| 989 | std::string name; |
| 990 | std::string types; |
| 991 | // remove assignment =, |
| 992 | if (lines.find('=') != std::string::npos) { |
| 993 | lines = lines.substr(0, lines.find('=')); |
| 994 | } |
| 995 | |
| 996 | int e = (int) lines.size() - 1; |
| 997 | while (lines[e] == ' ' || |
| 998 | lines[e] == '\r' || |
| 999 | lines[e] == '\n' || |
| 1000 | lines[e] == '\t') { |
| 1001 | |
| 1002 | e--; |
| 1003 | } |
| 1004 | |