aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2016-09-21 12:56:11 -0600
committerMike Buland <mike@xagasoft.com>2016-09-21 12:56:11 -0600
commit10f61f1285190986498221cfa82b2d3b9fe9f391 (patch)
tree78a469517d56aa423dbc231cd49544ffb4969738
parenta9e52e201f401860e394a87ec3634206aedc440b (diff)
downloadlibgats-10f61f1285190986498221cfa82b2d3b9fe9f391.tar.gz
libgats-10f61f1285190986498221cfa82b2d3b9fe9f391.tar.bz2
libgats-10f61f1285190986498221cfa82b2d3b9fe9f391.tar.xz
libgats-10f61f1285190986498221cfa82b2d3b9fe9f391.zip
Accumulated changes.
-rw-r--r--.gitignore10
-rw-r--r--c++-libbu++/Makefile21
-rw-r--r--c++-libbu++/src/boolean.cpp1
-rw-r--r--c++-libbu++/src/gatsc/main.cpp11
-rw-r--r--c++-qt/gats-qt/dictionary.h1
-rw-r--r--c++-qt/gats-qt/list.h1
-rw-r--r--c++-qt/src/gatsstream.cpp1
-rw-r--r--c++-qt/src/list.cpp1
8 files changed, 46 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6020bc1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
1*.o
2*.a
3.*.swp
4/c++-libbu++/gats
5/c++-qt/Makefile*
6*.dll
7/c++-qt/object_script.*
8/c++-qt/release
9/c++-qt/debug
10/c++-qt/tmp
diff --git a/c++-libbu++/Makefile b/c++-libbu++/Makefile
new file mode 100644
index 0000000..5ff9292
--- /dev/null
+++ b/c++-libbu++/Makefile
@@ -0,0 +1,21 @@
1OBJECTS := $(patsubst %.cpp,%.o,$(wildcard src/*.cpp))
2
3.PHONY: default all headers clean tests install
4
5default: libgats.a
6
7all: default tests
8
9clean:
10 -rm ${HEADERS} ${OBJECTS} libgats.a ${TOOLS} ${UNITS} ${TESTS}
11
12$(foreach fn,$(wildcard src/*.h),bu/$(notdir ${fn})): bu/%: src/%
13 ln -s ../$< $@
14
15${OBJECTS}: %.o: %.cpp
16 ${CXX} -ggdb -W -Wall -I. -I../../libbu++ ${CXXFLAGS} $< -c -o $@
17
18libgats.a: ${HEADERS} ${OBJECTS}
19 ar -r libgats.a ${OBJECTS}
20
21
diff --git a/c++-libbu++/src/boolean.cpp b/c++-libbu++/src/boolean.cpp
index 2ee0227..e442c2c 100644
--- a/c++-libbu++/src/boolean.cpp
+++ b/c++-libbu++/src/boolean.cpp
@@ -8,6 +8,7 @@
8#include "gats/boolean.h" 8#include "gats/boolean.h"
9 9
10#include <bu/formatter.h> 10#include <bu/formatter.h>
11#include <bu/string.h>
11#include <bu/stream.h> 12#include <bu/stream.h>
12 13
13Gats::Boolean::Boolean() : 14Gats::Boolean::Boolean() :
diff --git a/c++-libbu++/src/gatsc/main.cpp b/c++-libbu++/src/gatsc/main.cpp
index 5291a33..c95b914 100644
--- a/c++-libbu++/src/gatsc/main.cpp
+++ b/c++-libbu++/src/gatsc/main.cpp
@@ -11,6 +11,7 @@
11#include <bu/sio.h> 11#include <bu/sio.h>
12#include <bu/streamstack.h> 12#include <bu/streamstack.h>
13#include <bu/deflate.h> 13#include <bu/deflate.h>
14#include <bu/hex.h>
14 15
15#include "gats/types.h" 16#include "gats/types.h"
16#include "gats/gatsstream.h" 17#include "gats/gatsstream.h"
@@ -22,7 +23,8 @@ class Options : public OptParser
22public: 23public:
23 Options( int argc, char *argv[] ) : 24 Options( int argc, char *argv[] ) :
24 bCompile( true ), 25 bCompile( true ),
25 bCompress( false ) 26 bCompress( false ),
27 bHex( false )
26 { 28 {
27 addHelpBanner("Gats Compiler\nUsage: gatsc [options] [input]\n"); 29 addHelpBanner("Gats Compiler\nUsage: gatsc [options] [input]\n");
28 30
@@ -33,6 +35,7 @@ public:
33 "Convert binary gats to text gats."); 35 "Convert binary gats to text gats.");
34 36
35 addOption( bCompress, 'z', "compress", "Compress with deflate."); 37 addOption( bCompress, 'z', "compress", "Compress with deflate.");
38 addOption( bHex, 'x', "hex", "Encode output as hex.");
36 39
37 addHelpOption('h', "help", "This Help"); 40 addHelpOption('h', "help", "This Help");
38 41
@@ -40,6 +43,7 @@ public:
40 43
41 setOverride("decompile", false ); 44 setOverride("decompile", false );
42 setOverride("compress", true ); 45 setOverride("compress", true );
46 setOverride("hex", true );
43 47
44 parse( argc, argv ); 48 parse( argc, argv );
45 } 49 }
@@ -52,6 +56,7 @@ public:
52 56
53 bool bCompile; 57 bool bCompile;
54 bool bCompress; 58 bool bCompress;
59 bool bHex;
55 String sInput; 60 String sInput;
56 String sOutput; 61 String sOutput;
57}; 62};
@@ -83,6 +88,10 @@ int main( int argc, char *argv[] )
83 { 88 {
84 ssOut.pushFilter<Deflate>(); 89 ssOut.pushFilter<Deflate>();
85 } 90 }
91 if( opt.bHex )
92 {
93 ssOut.pushFilter<Hex>();
94 }
86 Gats::GatsStream gs( ssOut ); 95 Gats::GatsStream gs( ssOut );
87 Gats::Object *pObj = Gats::Object::strToGats( fIn.readAll() ); 96 Gats::Object *pObj = Gats::Object::strToGats( fIn.readAll() );
88 gs.writeObject( pObj ); 97 gs.writeObject( pObj );
diff --git a/c++-qt/gats-qt/dictionary.h b/c++-qt/gats-qt/dictionary.h
index 4f1d6e0..b1b6051 100644
--- a/c++-qt/gats-qt/dictionary.h
+++ b/c++-qt/gats-qt/dictionary.h
@@ -11,6 +11,7 @@
11#include "gats-qt/object.h" 11#include "gats-qt/object.h"
12#include "gats-qt/string.h" 12#include "gats-qt/string.h"
13#include <QHash> 13#include <QHash>
14#include <stdint.h>
14 15
15namespace Gats 16namespace Gats
16{ 17{
diff --git a/c++-qt/gats-qt/list.h b/c++-qt/gats-qt/list.h
index f39043f..27c17c3 100644
--- a/c++-qt/gats-qt/list.h
+++ b/c++-qt/gats-qt/list.h
@@ -10,6 +10,7 @@
10 10
11#include "gats-qt/object.h" 11#include "gats-qt/object.h"
12#include <QList> 12#include <QList>
13#include <stdint.h>
13 14
14namespace Gats 15namespace Gats
15{ 16{
diff --git a/c++-qt/src/gatsstream.cpp b/c++-qt/src/gatsstream.cpp
index 498b403..cb6b53c 100644
--- a/c++-qt/src/gatsstream.cpp
+++ b/c++-qt/src/gatsstream.cpp
@@ -14,6 +14,7 @@
14#include <arpa/inet.h> 14#include <arpa/inet.h>
15#endif 15#endif
16 16
17#include <stdint.h>
17#include <QBuffer> 18#include <QBuffer>
18 19
19Gats::GatsStream::GatsStream( QIODevice &rStream ) : 20Gats::GatsStream::GatsStream( QIODevice &rStream ) :
diff --git a/c++-qt/src/list.cpp b/c++-qt/src/list.cpp
index 19ff4b5..fae51d1 100644
--- a/c++-qt/src/list.cpp
+++ b/c++-qt/src/list.cpp
@@ -12,6 +12,7 @@
12#include "gats-qt/float.h" 12#include "gats-qt/float.h"
13#include "gats-qt/boolean.h" 13#include "gats-qt/boolean.h"
14#include "gats-qt/dictionary.h" 14#include "gats-qt/dictionary.h"
15#include <stdint.h>
15 16
16Gats::List::List() 17Gats::List::List()
17{ 18{