diff --git a/MString.cpp b/MString.cpp index 23b82d8..7f7258f 100644 --- a/MString.cpp +++ b/MString.cpp @@ -232,7 +232,7 @@ namespace coreutils { return *this; } - MString &MString::write(ZString &value) { + MString &MString::write(ZString value) { int len = length; setSize(length + value.getLength()); memcpy(data + len, value.getData(), value.getLength()); diff --git a/MString.h b/MString.h index d7617bb..52b8ef4 100644 --- a/MString.h +++ b/MString.h @@ -212,7 +212,7 @@ namespace coreutils { /// /// - MString &write(ZString &value); + MString &write(ZString value); /// /// Read data from a socket and store in MString. diff --git a/ZString.cpp b/ZString.cpp index b313f23..56e69c8 100644 --- a/ZString.cpp +++ b/ZString.cpp @@ -250,6 +250,10 @@ namespace coreutils { return strncmp(cursor, value, strlen(value)) == 0; } + int ZString::compare(ZString zstring) { + + } + bool ZString::equals(const char *value) { if (strlen(value) != length) return false; @@ -311,6 +315,19 @@ namespace coreutils { return len; } + bool ZString::lineIsWhitespace() { + char *end = data + length; + char *temp = cursor; + while(temp < end) { + if(*temp == '\n') + return true; + if((*temp != ' ') && (*temp != '\t')) + return false; + ++temp; + } + return true; + } + ZString ZString::goeol() { bool set = false; char *temp = cursor; diff --git a/ZString.h b/ZString.h index e9fd32f..e253c77 100644 --- a/ZString.h +++ b/ZString.h @@ -243,6 +243,12 @@ namespace coreutils { /// bool startsWith(const char *value); + + /// + /// + /// + + int compare(ZString zstring); /// /// @@ -293,6 +299,12 @@ namespace coreutils { /// int skipWhitespace(); + + /// + /// + /// + + bool lineIsWhitespace(); /// /// diff --git a/cmake_install.cmake b/cmake_install.cmake deleted file mode 100644 index 7d37f74..0000000 --- a/cmake_install.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# Install script for directory: /home/bradarant/barant/CoreUtils - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Install shared libraries without execute permission? -if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) - set(CMAKE_INSTALL_SO_NO_EXE "1") -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -if(CMAKE_INSTALL_COMPONENT) - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") -else() - set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") -endif() - -string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT - "${CMAKE_INSTALL_MANIFEST_FILES}") -file(WRITE "/home/bradarant/barant/CoreUtils/${CMAKE_INSTALL_MANIFEST}" - "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/coreutils.code-workspace b/coreutils.code-workspace deleted file mode 100644 index 876a149..0000000 --- a/coreutils.code-workspace +++ /dev/null @@ -1,8 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": {} -} \ No newline at end of file diff --git a/testing/mstring_test b/testing/mstring_test deleted file mode 100755 index a800872..0000000 Binary files a/testing/mstring_test and /dev/null differ diff --git a/testing/zstring_test b/testing/zstring_test deleted file mode 100755 index 2dad5e3..0000000 Binary files a/testing/zstring_test and /dev/null differ diff --git a/testing/zstring_test.cpp b/testing/zstring_test.cpp index 7d15c8e..6d329a5 100644 --- a/testing/zstring_test.cpp +++ b/testing/zstring_test.cpp @@ -63,5 +63,12 @@ int main(int argc, char **argv) { coreutils::ZString test5 = "this is a test of the Exclude tokenization without\n a line end."; coreutils::ZString test6 = test5.getTokenExclude("\n"); std::cout << test6 << std::endl; + + coreutils::ZString test7 = "this is a line\n \nthis is another line\n "; + std::cout << test7.lineIsWhitespace() << test7.goeol() << std::endl; + std::cout << test7.lineIsWhitespace() << test7.goeol() << std::endl; + std::cout << test7.lineIsWhitespace() << test7.goeol() << std::endl; + std::cout << test7.lineIsWhitespace() << test7.goeol() << std::endl; + }