aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.conf17
-rw-r--r--src/exceptions.cpp2
-rw-r--r--src/exceptions.h1
-rw-r--r--src/paramproc.cpp9
-rw-r--r--src/serializerbinary.cpp5
-rw-r--r--src/test/xmlreadtest/xmlreadtest.cpp6
6 files changed, 32 insertions, 8 deletions
diff --git a/build.conf b/build.conf
index f5626cf..a65878d 100644
--- a/build.conf
+++ b/build.conf
@@ -1,18 +1,29 @@
1# This is a build file for build 1# This is a build file for libbu++
2 2
3default action: check libbu++.a 3default action: check libbu++.a
4"clean" action: clean libbu++.a 4"tests" action: check /tests\/.*/
5"clean" action: clean /.*/
6"all" action: check /.*/
5 7
6create file libbu++.a from files in src using rule lib 8create file libbu++.a from files in src using rule lib
7 9
8set CXXFLAGS += "-ggdb" 10for directories matching /src\/test\/(.*)/ in src/test ...
11 create file "tests/{re:1}" from files in "{match}" using rule exe
9 12
13set CXXFLAGS += "-ggdb"
10set CXXFLAGS += "-Isrc -fPIC" 14set CXXFLAGS += "-Isrc -fPIC"
11 15
16for targets matching /tests\/.*/ set LDFLAGS += "-L. -lbu++"
17for testes/plugin set LDFLAGS += "-ldl"
18
12/(.*)\.o$/ requires from command "g++ {CXXFLAGS} -M {re:1}.c*" 19/(.*)\.o$/ requires from command "g++ {CXXFLAGS} -M {re:1}.c*"
20/tests\/.*/ requires libbu++.a
13 21
14rule lib matches all /(.*)\.o$/ perform command ... 22rule lib matches all /(.*)\.o$/ perform command ...
15 "ar cr {target} {match}" 23 "ar cr {target} {match}"
16 24
17rule cpp matches one /(.*)\.c(pp)?$/ produces "{re:1}.o" perform command ... 25rule cpp matches one /(.*)\.c(pp)?$/ produces "{re:1}.o" perform command ...
18 "g++ {CXXFLAGS} -c -o {target} {match}" 26 "g++ {CXXFLAGS} -c -o {target} {match}"
27
28rule exe matches all /(.*)\.o$/ perform command ...
29 "g++ -o {target} {match} {LDFLAGS}"
diff --git a/src/exceptions.cpp b/src/exceptions.cpp
index 441075d..8d30296 100644
--- a/src/exceptions.cpp
+++ b/src/exceptions.cpp
@@ -2,4 +2,4 @@
2#include <stdarg.h> 2#include <stdarg.h>
3 3
4subExceptionDef( XmlException ) 4subExceptionDef( XmlException )
5 5subExceptionDef( FileException )
diff --git a/src/exceptions.h b/src/exceptions.h
index 1cc891d..3bf2e0b 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -5,5 +5,6 @@
5#include <stdarg.h> 5#include <stdarg.h>
6 6
7subExceptionDecl( XmlException ) 7subExceptionDecl( XmlException )
8subExceptionDecl( FileException )
8 9
9#endif 10#endif
diff --git a/src/paramproc.cpp b/src/paramproc.cpp
index 90fa9ac..5cb815c 100644
--- a/src/paramproc.cpp
+++ b/src/paramproc.cpp
@@ -463,7 +463,14 @@ int ParamProc::help( int argc, char *argv[] )
463 printf(" "); 463 printf(" ");
464 if( (*i)->cChar ) 464 if( (*i)->cChar )
465 { 465 {
466 printf("-%c, ", (*i)->cChar ); 466 if( (*i)->sWord.getString() )
467 {
468 printf("-%c, ", (*i)->cChar );
469 }
470 else
471 {
472 printf("-%c ", (*i)->cChar );
473 }
467 } 474 }
468 else 475 else
469 { 476 {
diff --git a/src/serializerbinary.cpp b/src/serializerbinary.cpp
index d7143ab..23fb2b1 100644
--- a/src/serializerbinary.cpp
+++ b/src/serializerbinary.cpp
@@ -1,5 +1,6 @@
1#include "serializerbinary.h" 1#include "serializerbinary.h"
2#include "serializable.h" 2#include "serializable.h"
3#include "exceptions.h"
3 4
4SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading): 5SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading):
5 Serializer(bLoading), 6 Serializer(bLoading),
@@ -15,10 +16,14 @@ SerializerBinary::SerializerBinary(const char *sFileName, bool bLoading):
15 if (bLoading) 16 if (bLoading)
16 { 17 {
17 fhFile = fopen(sFileName, "rb"); 18 fhFile = fopen(sFileName, "rb");
19 if( fhFile == NULL )
20 throw FileException("Unable to open file: %s", sFileName );
18 } 21 }
19 else 22 else
20 { 23 {
21 fhFile = fopen(sFileName, "wb"); 24 fhFile = fopen(sFileName, "wb");
25 if( fhFile == NULL )
26 throw FileException("Unable to open file: %s", sFileName );
22 } 27 }
23} 28}
24 29
diff --git a/src/test/xmlreadtest/xmlreadtest.cpp b/src/test/xmlreadtest/xmlreadtest.cpp
index e2d2a0a..98d8a9e 100644
--- a/src/test/xmlreadtest/xmlreadtest.cpp
+++ b/src/test/xmlreadtest/xmlreadtest.cpp
@@ -1,6 +1,6 @@
1#include "../xmlfilereader.h" 1#include "xmlfilereader.h"
2#include "../xmlstringreader.h" 2#include "xmlstringreader.h"
3#include "../xmlfilewriter.h" 3#include "xmlfilewriter.h"
4 4
5int main( int argc, char *argv[] ) 5int main( int argc, char *argv[] )
6{ 6{