X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdbms%2FString.cpp;fp=source%2Fdbms%2FString.cpp;h=0000000000000000000000000000000000000000;hb=851ff2962362fd5bad874e8ed91445b296eaca24;hp=2e7e6fb666a89ad253e982b5ed082cf2ca3c2568;hpb=78be86969d2f26a9084b0c4af6ce43d5fa4ed3fd;p=anna.git diff --git a/source/dbms/String.cpp b/source/dbms/String.cpp deleted file mode 100644 index 2e7e6fb..0000000 --- a/source/dbms/String.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// ANNA - Anna is Not Nothingness Anymore // -// // -// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // -// // -// See project site at http://redmine.teslayout.com/projects/anna-suite // -// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // - - -#include - -using namespace anna; -using namespace anna::dbms; - -String& String::operator = (const String & other) -throw(RuntimeException) { - if(this == &other) - return *this; - - if(other.isNull() == true) { - setNull(true); - a_value [0] = 0; - return *this; - } - - return operator= (other.a_value); -} - -String& String::operator = (const char * str) -throw(RuntimeException) { - if(a_value != str) { - if(anna_strlen(str) > Data::getMaxSize()) - throw RuntimeException( - functions::asString("'%s' out of range | MaxLen: %d | Len: %d ", str, Data::getMaxSize(), anna_strlen(str)), - ANNA_FILE_LOCATION - ); - - anna_strcpy(a_value, str); - } - - Data::setNull(false); - return *this; -} - -char* String::strip(char *str) -throw() { - int len; - - if(str == NULL || (len = anna_strlen(str)) == 0) - return str; - - int end = len - 1; - - while(end >= 0 && str [end] == ' ') end --; - - if(end >= 0) - str [++ end] = 0; - - return str; -} - -std::string dbms::String::asString() const -throw() { - std::string result("dbms::String { "); - result += dbms::Data::asString(); - result += " | Value: "; - result += a_value; - return result += " }"; -} -