diff --git a/crop.cpp b/crop.cpp index 00c23d0fab2a506ba544a22d9d122ca6350747bd..7888e987d10c2a735a46127ecfd0dc014500ef61 100644 --- a/crop.cpp +++ b/crop.cpp @@ -2,7 +2,6 @@ #include <iostream> #include <iomanip> #include <string> -#include <cstring> #include "simple/file.hpp" #include "simple/support/enum.hpp" @@ -194,6 +193,6 @@ int main(int argc, char const* argv[]) try catch(...) { if(errno) - std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + std::perror("Oh nooo!"); throw; } diff --git a/diff.cpp b/diff.cpp index a686f3880cdcd2358fc68594253b7ee63e906a00..001657d3bbccb5fe0264de6589056869f3dea398 100644 --- a/diff.cpp +++ b/diff.cpp @@ -1,7 +1,5 @@ #include <iostream> #include <algorithm> -#include <cmath> -#include <cstring> #include "simple/file.hpp" #include "simple/geom/vector.hpp" #include "simple/support/arithmetic.hpp" @@ -95,6 +93,6 @@ int main(int argc, char const* argv[]) try } catch(...) { - if(errno) std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + if(errno) std::perror("Oh nooo!"); throw; } diff --git a/glue.cpp b/glue.cpp index a6bd8ca17305d3ea0873f7aed1955cd5857b237e..236e77dfde364ab11bc61e8e141ab67ff91bb8d2 100644 --- a/glue.cpp +++ b/glue.cpp @@ -1,5 +1,4 @@ #include <iostream> -#include <cstring> #include "simple/file.hpp" using namespace std; @@ -54,6 +53,6 @@ int main(int argc, char const * argv[]) try catch(...) { if(errno) - std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + std::perror("Oh nooo!"); throw; } diff --git a/pop_test.cpp b/pop_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c70f5b62f35a325678db19af265d14a07aa152f --- /dev/null +++ b/pop_test.cpp @@ -0,0 +1,31 @@ +#include "simple/file.hpp" +#include <string> +#include <iostream> + +using namespace std; +using namespace simple; +using file::string_stack::pop; +using file::string_stack::push; + +int main() +{ + string one, two; + string command; + while(cin >> one) + { + cout << one << "\n\n"; + while(cin >> command) + { + if("pop" == command) + push( two, pop(one) ); + else if("push" == command) + push( one, pop(two) ); + cout << "one: " << one << '\n'; + cout << "two: " << two << "\n\n"; + } + two.clear(); + cin.ignore(); + cin.clear(); + } + return 0; +} diff --git a/shred.cpp b/shred.cpp index b2e08b1d92fa646d734e1c591e11e12130809327..443479f862263d58c653c92678d1233f204e263e 100644 --- a/shred.cpp +++ b/shred.cpp @@ -5,7 +5,6 @@ #include <map> #include <functional> #include <algorithm> -#include <cstring> #include "simple/file.hpp" #include "simple/support/enum.hpp" @@ -147,6 +146,6 @@ int main(int argc, char const * argv[]) try catch(...) { if(errno) - std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + std::perror("Oh nooo!"); throw; } diff --git a/swap.cpp b/swap.cpp index 98c9b298c7f53ad2cb0bde135b17e69835eeb3c0..1023b31700935b06d71418189e3dbe387bacfa0b 100644 --- a/swap.cpp +++ b/swap.cpp @@ -1,5 +1,4 @@ #include <iostream> -#include <cstring> #include "simple/file.hpp" using namespace simple; @@ -35,6 +34,6 @@ int main(int argc, char const* argv[]) try catch(...) { if(errno) - std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + std::perror("Oh nooo!"); throw; }