1 /* ------------------------------------------------
2 Copyright 2014 AT&T Intellectual Property
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
7 http://www.apache.org/licenses/LICENSE-2.0
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ------------------------------------------- */
16 #ifndef __FIELD_LIST_H_
17 #define __FIELD_LIST_H_
26 std::map<std::string, std::string> type_verifier;
27 std::map<std::string, std::string> fields;
31 int verify_field(std::string name, std::string type, std::string &err){
32 // Perhaps re-enable this at some point but for now its an annoyance.
33 // if(fields.count(name) == 0){
34 // err += "\tCould not find field "+name+" in the field list\n";
37 if(fields[name] == "")
39 if(type_verifier[fields[name]] != type_verifier[type]){
40 err += "\tfield "+name+" has type "+type+", which isn't compatible with field list type "+fields[name]+"\n";