diff options
-rw-r--r-- | build.conf | 14 | ||||
-rw-r--r-- | src/archive.cpp | 2 | ||||
-rw-r--r-- | src/tests/archive.cpp | 4 | ||||
-rw-r--r-- | src/tests/archive2.cpp | 95 | ||||
-rw-r--r-- | src/unit/file.cpp | 6 | ||||
-rw-r--r-- | src/unit/fstring.cpp | 4 | ||||
-rw-r--r-- | src/unit/taf.cpp | 6 |
7 files changed, 113 insertions, 18 deletions
@@ -15,7 +15,7 @@ set "CXXFLAGS" += "-ggdb -Wall" | |||
15 | set "CXXFLAGS" += "-pg" | 15 | set "CXXFLAGS" += "-pg" |
16 | set "LDFLAGS" += "-pg" | 16 | set "LDFLAGS" += "-pg" |
17 | 17 | ||
18 | filesIn("src") filter regexp("^src/(.*)\\.h$", "src/bu/{re:1}.h"): | 18 | filesIn("src") filter regexp("^src/(.*)\\.h$", "bu/{re:1}.h"): |
19 | rule "hln", | 19 | rule "hln", |
20 | group "lnhdrs", | 20 | group "lnhdrs", |
21 | target file, | 21 | target file, |
@@ -24,7 +24,7 @@ filesIn("src") filter regexp("^src/(.*)\\.h$", "src/bu/{re:1}.h"): | |||
24 | "libbu++.a": | 24 | "libbu++.a": |
25 | rule "lib", | 25 | rule "lib", |
26 | target file, | 26 | target file, |
27 | set "CXXFLAGS" += "-Isrc -fPIC", | 27 | set "CXXFLAGS" += "-I. -fPIC", |
28 | input filesIn("src") filter regexp("^.*\\.cpp$") | 28 | input filesIn("src") filter regexp("^.*\\.cpp$") |
29 | 29 | ||
30 | directoriesIn("src/tests","tests/"): | 30 | directoriesIn("src/tests","tests/"): |
@@ -32,7 +32,7 @@ directoriesIn("src/tests","tests/"): | |||
32 | target file, | 32 | target file, |
33 | group "tests", | 33 | group "tests", |
34 | requires "libbu++.a", | 34 | requires "libbu++.a", |
35 | set "CXXFLAGS" += "-Isrc", | 35 | set "CXXFLAGS" += "-I.", |
36 | set "LDFLAGS" += "-L. -lbu++", | 36 | set "LDFLAGS" += "-L. -lbu++", |
37 | input filesIn("{fulldir}") filter regexp("^.*\\.cpp$") | 37 | input filesIn("{fulldir}") filter regexp("^.*\\.cpp$") |
38 | 38 | ||
@@ -41,7 +41,7 @@ filesIn("src/tests") filter regexp("^src/tests/(.*)\\.cpp$", "tests/{re:1}"): | |||
41 | target file, | 41 | target file, |
42 | group "tests", | 42 | group "tests", |
43 | requires "libbu++.a", | 43 | requires "libbu++.a", |
44 | set "CXXFLAGS" += "-Isrc", | 44 | set "CXXFLAGS" += "-I.", |
45 | set "LDFLAGS" += "-L. -lbu++", | 45 | set "LDFLAGS" += "-L. -lbu++", |
46 | input "src/{target}.cpp" | 46 | input "src/{target}.cpp" |
47 | 47 | ||
@@ -54,7 +54,7 @@ filesIn("src/unit") filter regexp("^src/unit/(.*)\\.cpp$", "unit/{re:1}"): | |||
54 | group "tests", | 54 | group "tests", |
55 | group "unit", | 55 | group "unit", |
56 | requires "libbu++.a", | 56 | requires "libbu++.a", |
57 | set "CXXFLAGS" += "-Isrc", | 57 | set "CXXFLAGS" += "-I.", |
58 | set "LDFLAGS" += "-L. -lbu++", | 58 | set "LDFLAGS" += "-L. -lbu++", |
59 | input "src/{target}.cpp" | 59 | input "src/{target}.cpp" |
60 | 60 | ||
@@ -80,6 +80,6 @@ rule "cpp": | |||
80 | 80 | ||
81 | rule "hln": | 81 | rule "hln": |
82 | matches regexp("src/(.*)\\.h"), | 82 | matches regexp("src/(.*)\\.h"), |
83 | produces "src/bu/{re:1}.h", | 83 | produces "bu/{re:1}.h", |
84 | perform command("ln -s ../{re:1}.h {target}") | 84 | perform command("ln -s ../src/{re:1}.h {target}") |
85 | 85 | ||
diff --git a/src/archive.cpp b/src/archive.cpp index 5ac2877..78fa362 100644 --- a/src/archive.cpp +++ b/src/archive.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "archive.h" | 8 | #include "bu/archive.h" |
9 | 9 | ||
10 | Bu::Archive::Archive( Stream &rStream, bool bLoading ) : | 10 | Bu::Archive::Archive( Stream &rStream, bool bLoading ) : |
11 | bLoading( bLoading ), | 11 | bLoading( bLoading ), |
diff --git a/src/tests/archive.cpp b/src/tests/archive.cpp index b2778f1..10bb834 100644 --- a/src/tests/archive.cpp +++ b/src/tests/archive.cpp | |||
@@ -5,8 +5,8 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "archive.h" | 8 | #include "bu/archive.h" |
9 | #include "file.h" | 9 | #include "bu/file.h" |
10 | 10 | ||
11 | using namespace Bu; | 11 | using namespace Bu; |
12 | 12 | ||
diff --git a/src/tests/archive2.cpp b/src/tests/archive2.cpp new file mode 100644 index 0000000..6d3c2c1 --- /dev/null +++ b/src/tests/archive2.cpp | |||
@@ -0,0 +1,95 @@ | |||
1 | #include "bu/archive.h" | ||
2 | #include "bu/archival.h" | ||
3 | #include "bu/file.h" | ||
4 | |||
5 | int giId = 0; | ||
6 | |||
7 | class A : public Bu::Archival | ||
8 | { | ||
9 | public: | ||
10 | A() : | ||
11 | iId( giId++ ) | ||
12 | { | ||
13 | } | ||
14 | |||
15 | virtual ~A() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | virtual void archive( Bu::Archive &ar ) | ||
20 | { | ||
21 | ar && iId; | ||
22 | } | ||
23 | |||
24 | int iId; | ||
25 | }; | ||
26 | |||
27 | class B : public Bu::Archival | ||
28 | { | ||
29 | public: | ||
30 | B() : | ||
31 | iId( giId++ ), | ||
32 | a1( new A ), | ||
33 | a2( new A ) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | virtual ~B() | ||
38 | { | ||
39 | delete a1; | ||
40 | delete a2; | ||
41 | } | ||
42 | |||
43 | virtual void archive( Bu::Archive &ar ) | ||
44 | { | ||
45 | //ar && iId && a1 && a2; | ||
46 | ar << iId << a1 << a2; | ||
47 | } | ||
48 | |||
49 | int iId; | ||
50 | A *a1, *a2; | ||
51 | }; | ||
52 | |||
53 | class C : public Bu::Archival | ||
54 | { | ||
55 | public: | ||
56 | C() : | ||
57 | iId( giId++ ), | ||
58 | a( new A ), | ||
59 | b( new B ) | ||
60 | { | ||
61 | } | ||
62 | |||
63 | virtual ~C() | ||
64 | { | ||
65 | delete a; | ||
66 | delete b; | ||
67 | } | ||
68 | |||
69 | virtual void archive( Bu::Archive &ar ) | ||
70 | { | ||
71 | //ar && iId && a && b; | ||
72 | ar << iId; | ||
73 | ar << a << b; | ||
74 | } | ||
75 | |||
76 | int iId; | ||
77 | A *a; | ||
78 | B *b; | ||
79 | }; | ||
80 | |||
81 | void write() | ||
82 | { | ||
83 | C *c = new C; | ||
84 | |||
85 | Bu::File f( "test.archive", "wb"); | ||
86 | Bu::Archive ar( f, Bu::Archive::save ); | ||
87 | ar << c; | ||
88 | } | ||
89 | |||
90 | int main() | ||
91 | { | ||
92 | write(); | ||
93 | |||
94 | } | ||
95 | |||
diff --git a/src/unit/file.cpp b/src/unit/file.cpp index 5042350..abc816a 100644 --- a/src/unit/file.cpp +++ b/src/unit/file.cpp | |||
@@ -5,9 +5,9 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "unitsuite.h" | 8 | #include "bu/unitsuite.h" |
9 | #include "file.h" | 9 | #include "bu/file.h" |
10 | #include "exceptions.h" | 10 | #include "bu/exceptions.h" |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
diff --git a/src/unit/fstring.cpp b/src/unit/fstring.cpp index b00f11b..cd90835 100644 --- a/src/unit/fstring.cpp +++ b/src/unit/fstring.cpp | |||
@@ -5,8 +5,8 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "fstring.h" | 8 | #include "bu/fstring.h" |
9 | #include "unitsuite.h" | 9 | #include "bu/unitsuite.h" |
10 | 10 | ||
11 | class Unit : public Bu::UnitSuite | 11 | class Unit : public Bu::UnitSuite |
12 | { | 12 | { |
diff --git a/src/unit/taf.cpp b/src/unit/taf.cpp index f363c78..b3edf5c 100644 --- a/src/unit/taf.cpp +++ b/src/unit/taf.cpp | |||
@@ -5,9 +5,9 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include "unitsuite.h" | 8 | #include "bu/unitsuite.h" |
9 | #include "file.h" | 9 | #include "bu/file.h" |
10 | #include "tafreader.h" | 10 | #include "bu/tafreader.h" |
11 | 11 | ||
12 | #include <string.h> | 12 | #include <string.h> |
13 | #include <unistd.h> | 13 | #include <unistd.h> |