git repos / oastat

commit f400c79f

sago007 · 2015-08-04 18:15
f400c79fc118262bc621d2c4327dc3323193bc74 patch · browse files
parent e536e642a06d4da5fc143f459af05d557ffeda22

Removed out commented code. Also updated the build instructions.

Changed files

M README.md before
M src/Makefile before
M src/oastat.cpp before
M src/oastatstruct.cpp before
diff --git a/README.md b/README.md index 14e4028..a5567ce 100644 --- a/README.md +++ b/README.md
@@ -2,8 +2,27 @@
Here you will be introduced on how to get data into oastat and how to get the data out again. Oastat can read both from file or pipe and can write output to either an SQL server or an XML file.
-Homepage: https://code.google.com/p/oastat/
-Mirror of the code: https://github.com/sago007/oastat-copy
+Homepage: https://github.com/sago007/oastat/
+
+# Building
+
+## Dependencies
+
+ * CppDb - http://cppcms.com/sql/cppdb/
+ * libgcrypt
+ * boost_program_options
+
+On Ubuntu (15.04 or later) all requirements can be installed with: sudo apt-get install build-essential libboost-program-options-dev libcppdb-dev libgcrypt20-dev
+On earlier versions CppDb must be installed manually.
+
+CppDb can be disabled from the build by adding the line:
+USECPPDB=0 to src/Makefile.local (file must be created)
+
+libdbi-dev can be used instead by adding:
+USEDBIXX=1 to src/Makefile.local (file must be created)
+
+Go to ./src and type "make"
+The executable will be in the same folder.
# Details
@@ -56,4 +75,4 @@ For looking at the sqlite-file generated I recommend Sqliteman (http://sqliteman
## License
The program is licences under GNU GPL v2 or any later version. See COPYING for details.
The Windows version may include files from CPPDB (http://cppcms.com/sql/cppdb/) that are licensed under the Boost Software License 1.0 or The MIT license at your opinion.
-The windows version may also be packed with sqlite3.exe that are in the public domain.
\ No newline at end of file
+The windows version may also be packed with sqlite3.exe that are in the public domain.
diff --git a/src/Makefile b/src/Makefile index f79713b..8be81a1 100644 --- a/src/Makefile +++ b/src/Makefile
@@ -1,5 +1,5 @@
#ifndef USEDBIXX
-USEDBIXX=1
+USEDBIXX=0
#endif
#ifndef USECPPDB
USECPPDB=1
@@ -12,7 +12,7 @@ CXX=$(CROSS)g++
#endif
BASE_LIBS=-lgcrypt -lboost_program_options -lgpg-error
-BASE_CFLAGS=-c -g -O2 -Wall -std=c++0x
+BASE_CFLAGS=-c -g -O2 -Wall -std=c++11
-include Makefile.local
diff --git a/src/oastat.cpp b/src/oastat.cpp index 71911d9..e782c20 100644 --- a/src/oastat.cpp +++ b/src/oastat.cpp
@@ -191,7 +191,6 @@ string getHashedId(string unhashedID)
unhashedID = hash_hex;
- //free(out);
return unhashedID; //Replace with md5 at some point
}
@@ -216,7 +215,7 @@ int main (int argc, const char* argv[])
("backend", boost::program_options::value<string>(), "The DB backend to use")
("dbargs", boost::program_options::value<string>(), "Arguments passed to the DB backend")
("filename,f", boost::program_options::value<string>(), "Filename to read. Providing a blank string will read from stdin")
- ("tail", "Use tail on the filename given to read the file")
+ ("tail", "Use tail on the filename given to read the file. This will be ignored on Windows.")
("integration-test", "Perform integration test")
;
boost::program_options::variables_map vm;
diff --git a/src/oastatstruct.cpp b/src/oastatstruct.cpp index 5df6f7c..157fe80 100644 --- a/src/oastatstruct.cpp +++ b/src/oastatstruct.cpp
@@ -144,12 +144,10 @@ map<string,string> OaStatStruct::GetInfostring(string restOfLine) const
key = restOfLine.substr(lastPos,curPos-lastPos);
} else {
value = restOfLine.substr(lastPos,curPos-lastPos);
- //list.insert(pair<string,string>(key,value));
makeLower(key);
if (key.length()>0) {
list[key] = value;
}
- //cout << key << ":" << value << endl;
}
iskey = !iskey;
lastPos = curPos+1;