diff --git a/MString.cpp b/MString.cpp index f915461..4b48dd5 100644 --- a/MString.cpp +++ b/MString.cpp @@ -153,6 +153,16 @@ namespace coreutils { memcpy(data + temp, value.c_str(), value.length()); return *this; } + +// MString &MString::operator<<(std::ostream (*f)(std::ostream&)) { + MString &MString::operator<<(std::basic_ostream (*pf)(std::basic_ostream&)) { +// int temp = length; +// int len = length + value.length(); +// setSize(len); +// memcpy(data + temp, value.c_str(), value.length()); + std::cout << "xxx" << std::endl; + return *this; + } void MString::insert(char ch, int offset) { setSize(length + 1); diff --git a/MString.h b/MString.h index b24ae93..7413744 100644 --- a/MString.h +++ b/MString.h @@ -4,6 +4,7 @@ #include "ZString.h" #include #include +#include namespace coreutils { @@ -126,7 +127,9 @@ namespace coreutils MString &operator<<(const int value); - // MString& operator<<(coreutils::ZString &zstring); + /// + /// + /// MString &operator<<(coreutils::ZString zstring); @@ -135,6 +138,13 @@ namespace coreutils /// MString &operator<<(std::string value); + + /// + /// + /// + +// MString &operator<<(std::ostream (*f)(std::ostream&) ); + MString &operator<<(std::basic_ostream (*pf)(std::basic_ostream&)); /// /// diff --git a/testing/compile b/testing/compile index 1869368..af391cf 100755 --- a/testing/compile +++ b/testing/compile @@ -1,4 +1,4 @@ #!/bin/bash g++ -o zstring_test zstring_test.cpp -I.. -L.. -lCoreUtils g++ -o mstring_test mstring_test.cpp -I.. -L.. -lCoreUtils -g++ -o jstring_test jstring_test.cpp -I.. -L.. -lCoreUtils +#g++ -o jstring_test jstring_test.cpp -I.. -L.. -lCoreUtils diff --git a/testing/mstring_test b/testing/mstring_test index 5379889..4a1eda2 100755 Binary files a/testing/mstring_test and b/testing/mstring_test differ diff --git a/testing/mstring_test.cpp b/testing/mstring_test.cpp index 6a9987c..a258592 100644 --- a/testing/mstring_test.cpp +++ b/testing/mstring_test.cpp @@ -79,6 +79,9 @@ int main(int argc, char **argv) { test22 << test23; std::cout << "mstring << string: [" << test22 << "]" << std::endl; +// coreutils::MString test24 = std::endl; +// std::cout << "mstring << endl: " << test24 << std::endl; + return 0; } diff --git a/testing/zstring_test b/testing/zstring_test index d17a325..7d95339 100755 Binary files a/testing/zstring_test and b/testing/zstring_test differ