X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fftacmp%2Ffield_list.h;h=8e202e9abc31dc326b3c9eb3c798329a7d0f958e;hb=07495effe193ca3f73c3bf0ce417068f9ac9dcdd;hp=9b0e1d6bf370c8598183af71f98c5f732506697f;hpb=c9783d8ea8b85d810483559e50dbf2297109e349;p=com%2Fgs-lite.git diff --git a/src/ftacmp/field_list.h b/src/ftacmp/field_list.h index 9b0e1d6..8e202e9 100644 --- a/src/ftacmp/field_list.h +++ b/src/ftacmp/field_list.h @@ -1,49 +1,49 @@ -/* ------------------------------------------------ -Copyright 2014 AT&T Intellectual Property - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------- */ - -#ifndef __FIELD_LIST_H_ -#define __FIELD_LIST_H_ - -#include -#include -#include"xml_t.h" - - -class field_list{ -public: - std::map type_verifier; - std::map fields; - - field_list(xml_t *x); - - int verify_field(std::string name, std::string type, std::string &err){ - if(fields.count(name) == 0){ - err += "\tCould not find field "+name+" in the field list\n"; - return 1; - } - if(fields[name] == "") - return 0; - if(type_verifier[fields[name]] != type_verifier[type]){ - err += "\tfield "+name+" has type "+type+", which isn't compatible with field list type "+fields[name]+"\n"; - return 2; - } - return 0; - } - -}; - - -#endif - +/* ------------------------------------------------ +Copyright 2014 AT&T Intellectual Property + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ------------------------------------------- */ + +#ifndef __FIELD_LIST_H_ +#define __FIELD_LIST_H_ + +#include +#include +#include"xml_t.h" + + +class field_list{ +public: + std::map type_verifier; + std::map fields; + + field_list(xml_t *x); + + int verify_field(std::string name, std::string type, std::string &err){ + if(fields.count(name) == 0){ + err += "\tCould not find field "+name+" in the field list\n"; + return 1; + } + if(fields[name] == "") + return 0; + if(type_verifier[fields[name]] != type_verifier[type]){ + err += "\tfield "+name+" has type "+type+", which isn't compatible with field list type "+fields[name]+"\n"; + return 2; + } + return 0; + } + +}; + + +#endif +