diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..5353861 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +# Makefile for GNU make + + +ifndef CXX +CXX = g++ +endif + +ifndef CXXFLAGS +CXXFLAGS = -Wall -pedantic -O2 -I/usr/local/include -I.. -L/usr/local/lib +endif + +export CXX +export CXXFLAGS + + +all: confparser mainparser utf8 + +confparser: FORCE + @cd confparser ; $(MAKE) -e + +mainparser: FORCE + @cd mainparser ; $(MAKE) -e + +utf8: FORCE + @cd utf8 ; $(MAKE) -e + + +FORCE: + + +clean: + @cd confparser ; $(MAKE) -e clean + @cd mainparser ; $(MAKE) -e clean + @cd utf8 ; $(MAKE) -e clean + +depend: + @cd confparser ; $(MAKE) -e depend + @cd mainparser ; $(MAKE) -e depend + @cd utf8 ; $(MAKE) -e depend diff --git a/confparser/Makefile b/confparser/Makefile index 37c2e80..631c784 100755 --- a/confparser/Makefile +++ b/confparser/Makefile @@ -1,29 +1,27 @@ -include Makefile.o.dep - -libname=confparser.a - -all: $(libname) - -$(libname): $(o) - ar rcs $(libname) $(o) - - -.SUFFIXES: .cpp .o - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $< - - - -depend: - makedepend -Y. -I.. -f- *.cpp > Makefile.dep - echo -n "o = " > Makefile.o.dep - ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep - - -clean: - rm -f *.o - rm -f $(libname) - - -include Makefile.dep +include Makefile.o.dep + +libname=confparser.a + +all: $(libname) + +$(libname): $(o) + ar rcs $(libname) $(o) + + +%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $< + + + +depend: + makedepend -Y. -I.. -f- *.cpp > Makefile.dep + echo -n "o = " > Makefile.o.dep + ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep + + +clean: + rm -f *.o + rm -f $(libname) + + +include Makefile.dep diff --git a/confparser/Makefile.dep b/confparser/Makefile.dep index b27e3c9..5753f95 100755 --- a/confparser/Makefile.dep +++ b/confparser/Makefile.dep @@ -1,4 +1,4 @@ # DO NOT DELETE -confparser.o: confparser.h ../utf8/utf8.h -space.o: confparser.h ../utf8/utf8.h +confparser.o: confparser.h space.h ../utf8/utf8.h +space.o: space.h ../utf8/utf8.h diff --git a/confparser/confparser.cpp b/confparser/confparser.cpp index 32b8012..a5c7524 100755 --- a/confparser/confparser.cpp +++ b/confparser/confparser.cpp @@ -1,5 +1,5 @@ /* - * This file is a part of PicoTools + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ diff --git a/confparser/confparser.h b/confparser/confparser.h index 7d129e1..9dcf00b 100755 --- a/confparser/confparser.h +++ b/confparser/confparser.h @@ -1,5 +1,5 @@ /* - * This file is a part of PicoTools + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ @@ -39,10 +39,6 @@ #define headerfile_picotools_confparser_confparser #include -#include -#include -#include -#include #include "space.h" diff --git a/confparser/space.cpp b/confparser/space.cpp index 6209203..a6f64d2 100755 --- a/confparser/space.cpp +++ b/confparser/space.cpp @@ -1,5 +1,5 @@ /* - * This file is a part of PicoTools + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ @@ -35,9 +35,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include +//#include #include -#include "confparser.h" +#include "space.h" #include "utf8/utf8.h" diff --git a/confparser/space.h b/confparser/space.h index 590f03d..d9a07a1 100755 --- a/confparser/space.h +++ b/confparser/space.h @@ -1,5 +1,5 @@ /* - * This file is a part of PicoTools + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ @@ -38,10 +38,8 @@ #ifndef headerfile_picotools_confparser_space #define headerfile_picotools_confparser_space -#include #include #include -#include #include diff --git a/mainparser/Makefile b/mainparser/Makefile index 41c38da..bb4ebca 100644 --- a/mainparser/Makefile +++ b/mainparser/Makefile @@ -1,29 +1,27 @@ -include Makefile.o.dep - -libname=mainparser.a - -all: $(libname) - -$(libname): $(o) - ar rcs $(libname) $(o) - - -.SUFFIXES: .cpp .o - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $< - - - -depend: - makedepend $(CXXFLAGS) -Y. -f- *.cpp > Makefile.dep - echo -n "o = " > Makefile.o.dep - ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep - - -clean: - rm -f *.o - rm -f $(libname) - - -include Makefile.dep +include Makefile.o.dep + +libname=mainparser.a + +all: $(libname) + +$(libname): $(o) + ar rcs $(libname) $(o) + + +%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $< + + + +depend: + makedepend -Y. -I.. -f- *.cpp > Makefile.dep + echo -n "o = " > Makefile.o.dep + ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep + + +clean: + rm -f *.o + rm -f $(libname) + + +include Makefile.dep diff --git a/mainparser/Makefile.o.dep b/mainparser/Makefile.o.dep index 0a6c3a7..bf313b1 100644 --- a/mainparser/Makefile.o.dep +++ b/mainparser/Makefile.o.dep @@ -1 +1 @@ -o = mainparser.o \ No newline at end of file +o = mainparser.o diff --git a/mainparser/mainparser.cpp b/mainparser/mainparser.cpp index 9612513..6a67449 100644 --- a/mainparser/mainparser.cpp +++ b/mainparser/mainparser.cpp @@ -1,11 +1,11 @@ /* - * This file is a part of MainParser -- simple parser for main() parameters + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ /* - * Copyright (c) 2011, Tomasz Sowa + * Copyright (c) 2011-2012, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,9 @@ #include +namespace PT +{ + MainParser::MainParser() { @@ -227,3 +230,8 @@ bool was_incremented = false; return was_incremented; } + + +} // namespace + + diff --git a/mainparser/mainparser.h b/mainparser/mainparser.h index 2c3f0f8..248f22a 100644 --- a/mainparser/mainparser.h +++ b/mainparser/mainparser.h @@ -1,11 +1,11 @@ /* - * This file is a part of MainParser -- simple parser for main() parameters + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ /* - * Copyright (c) 2011, Tomasz Sowa + * Copyright (c) 2011-2012, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,8 +35,12 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef headerfile_mainparser_mainparser -#define headerfile_mainparser_mainparser +#ifndef headerfile_picotools_mainparser_mainparser +#define headerfile_picotools_mainparser_mainparser + + +namespace PT +{ /* @@ -121,4 +125,8 @@ private: const char * last_double_param; }; + +} // namespace + + #endif diff --git a/utf8/Makefile b/utf8/Makefile new file mode 100755 index 0000000..6e87c15 --- /dev/null +++ b/utf8/Makefile @@ -0,0 +1,27 @@ +include Makefile.o.dep + +libname=utf8.a + +all: $(libname) + +$(libname): $(o) + ar rcs $(libname) $(o) + + +%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $< + + + +depend: + makedepend -Y. -I.. -f- *.cpp > Makefile.dep + echo -n "o = " > Makefile.o.dep + ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep + + +clean: + rm -f *.o + rm -f $(libname) + + +include Makefile.dep diff --git a/utf8/Makefile.dep b/utf8/Makefile.dep new file mode 100755 index 0000000..f2f3eba --- /dev/null +++ b/utf8/Makefile.dep @@ -0,0 +1,3 @@ +# DO NOT DELETE + +utf8.o: utf8.h diff --git a/utf8/Makefile.o.dep b/utf8/Makefile.o.dep new file mode 100755 index 0000000..33f18af --- /dev/null +++ b/utf8/Makefile.o.dep @@ -0,0 +1 @@ +o = utf8.o diff --git a/utf8/utf8.cpp b/utf8/utf8.cpp index b78d314..65ee931 100755 --- a/utf8/utf8.cpp +++ b/utf8/utf8.cpp @@ -1,11 +1,11 @@ /* - * This file is a part of EZC -- Easy templating in C++ + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ /* - * Copyright (c) 2010-2011, Tomasz Sowa + * Copyright (c) 2010-2012, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,7 @@ #include "utf8.h" -namespace Ezc +namespace PT { @@ -890,7 +890,7 @@ bool WideToUTF8(const std::wstring & wide_string, std::ostream & utf8, int mode) -} // namespace Ezc +} // namespace diff --git a/utf8/utf8.h b/utf8/utf8.h index 73fe8d0..8030fcd 100755 --- a/utf8/utf8.h +++ b/utf8/utf8.h @@ -1,11 +1,11 @@ /* - * This file is a part of EZC -- Easy templating in C++ + * This file is a part of PikoTools * and is distributed under the (new) BSD licence. * Author: Tomasz Sowa */ /* - * Copyright (c) 2010-2011, Tomasz Sowa + * Copyright (c) 2010-2012, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,14 +35,14 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef headerfile_ezc_utf8 -#define headerfile_ezc_utf8 +#ifndef headerfile_picotools_utf8_utf8 +#define headerfile_picotools_utf8_utf8 #include #include -namespace Ezc +namespace PT { /*! @@ -104,7 +104,7 @@ bool WideToUTF8(const std::wstring & wide_string, std::ostream & u -} // namespace Ezc +} // namespace #endif