X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FConstants.cpp;fp=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FConstants.cpp;h=186e58cec9246f25347a1bf889430e942efe0ee6;hp=bcff2bcdd3f1bab7708a50eee5fbd6014761531f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Constants.cpp b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Constants.cpp index bcff2bcdd..186e58cec 100644 --- a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Constants.cpp +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/Constants.cpp @@ -1,68 +1,68 @@ -#include "Constants.h" - -#include - -namespace Databoard { - - void printout(pANTLR3_BASE_TREE type) - { - std::cout << type->getText(type)->chars << " : " << type->getType(type) << std::endl; - } - - std::string removeQuotes(std::string str) - { - if(str.length() > 0) - { - if(str.at(0) == '"') - { - str = str.substr(1, str.length()-1); - } - } - - if(str.length() > 0) - { - if(str.at(str.length()-1) == '"') - { - str = str.substr(0, str.length()-1); - } - } - - return str; - } - - bool strEquals(const char* a, const char* b) - { - while(*a != '\0' && *b != '\0') - { - char c1 = *a; - char c2 = *b; - - if(c1 >= 'a' && c1 <= 'z') - { - c1 += 'A'-'a'; - } - - if(c2 >= 'a' && c2 <= 'z') - { - c2 += 'A'-'a'; - } - - if(c1 != c2) - { - return false; - } - - ++a; - ++b; - } - - if((*a == *b) && (*a == 0)) - { - return true; - } - else - { - return false; - } - } -} +#include "Constants.h" + +#include + +namespace Databoard { + + void printout(pANTLR3_BASE_TREE type) + { + std::cout << type->getText(type)->chars << " : " << type->getType(type) << std::endl; + } + + std::string removeQuotes(std::string str) + { + if(str.length() > 0) + { + if(str.at(0) == '"') + { + str = str.substr(1, str.length()-1); + } + } + + if(str.length() > 0) + { + if(str.at(str.length()-1) == '"') + { + str = str.substr(0, str.length()-1); + } + } + + return str; + } + + bool strEquals(const char* a, const char* b) + { + while(*a != '\0' && *b != '\0') + { + char c1 = *a; + char c2 = *b; + + if(c1 >= 'a' && c1 <= 'z') + { + c1 += 'A'-'a'; + } + + if(c2 >= 'a' && c2 <= 'z') + { + c2 += 'A'-'a'; + } + + if(c1 != c2) + { + return false; + } + + ++a; + ++b; + } + + if((*a == *b) && (*a == 0)) + { + return true; + } + else + { + return false; + } + } +}