Permalink
Browse files

added fragment of hashlib++ v3.1 to project,

clean up with data dirs, additional changes in main classes
  • Loading branch information...
1 parent ea464f3 commit 83d8e823557d7e2fe89341b8757b58ce82b65a2e Daniel (dmilith) Dettlaff committed Aug 17, 2008
View
@@ -1,5 +1,7 @@
echo "Cleaning up.."
scons -c
+rm -f *.os
+rm -f *.so
cd tests/
rm -f test_*
echo "Done."
View
@@ -9,6 +9,9 @@ debug64 = Environment( CXX = 'g++ -g -W' )
#release = debug64
release = release64
+release.Library('hl-sha',
+ [ 'hashlib/hl_sha1.cpp', 'hashlib/hl_sha1wrapper.cpp', 'hashlib/hl_sha256.cpp', 'hashlib/hl_sha256wrapper.cpp' ] )
+
release.SharedLibrary('character', 'character.cpp')
release.SharedLibrary('coordinates', 'coordinates.cpp')
release.SharedLibrary('item', 'item.cpp')
@@ -19,5 +22,8 @@ release.SharedLibrary('theritory', 'theritory.cpp')
release.SharedLibrary('world', 'world.cpp')
release.SharedLibrary('job', 'job.cpp')
release.Program('world' , 'main.cpp',
- LIBS=[ 'boost_thread', 'boost_filesystem', 'job', 'character', 'coordinates', 'item', 'map', 'place', 'soul', 'theritory', 'world' ],
+ LIBS=[ 'boost_thread', 'boost_filesystem',
+ 'job', 'character', 'coordinates',
+ 'item', 'map', 'place', 'soul', 'theritory',
+ 'world', 'hl-sha' ],
LIBPATH=[ '.', '/usr/local/lib', '/usr/lib' ])
View
@@ -1,9 +1,15 @@
#include "coordinates.h"
+#include "hashlib/hashlibpp.h"
+
Ccoordinates::Ccoordinates() {
- tCoord.x = 0;
- tCoord.y = 0;
- pCoord.x = 0;
- pCoord.y = 0;
- mCoord = "somewhere there";
+ hashwrapper *myWrapper = new sha1wrapper();
+ position = "void";
+ parent_positions[0] = "void";
+ parent_positions[1] = "void";
+ parent_positions[2] = "void";
+ parent_positions[3] = "void";
+ parent_positions[4] = "void";
+ parent_positions[5] = "void";
+
}
View
@@ -1,19 +1,16 @@
#ifndef _CCOORDINATES_H_
#define _CCOORDINATES_H_
-#include <iostream>
-#include <string.h>
-
-struct Sposition {
- uint64_t x, y;
-};
+#include <boost/archive/binary_oarchive.hpp>
+#include <boost/archive/binary_iarchive.hpp>
+#include <boost/serialization/version.hpp>
class Ccoordinates {
public:
Ccoordinates(); //zerowanie koordynatow -zeby nie bylo zadnych krzakow
- Sposition tCoord,pCoord; //territory x,y place coord...
- std::string mCoord; //nazwa mapy jako koordynat gdzie jestes
+ std::string position; // sha1 identyfikujące daną pozycję mapy
+ std::string parent_positions[6]; // sha1 z sha sąsiadujących elementów liczone od lewego boku 6 kąta
};
#endif //_CCOORDINATES_H_
View
@@ -2,7 +2,7 @@
<!-- Komodo Project File - DO NOT EDIT -->
<project id="8cb9c3ff-8e71-433e-9447-85457cc4bb50" kpf_version="4" name="crealis.kpf">
<preference-set idref="8cb9c3ff-8e71-433e-9447-85457cc4bb50">
- <string id="import_exclude_matches">crealis;*.o;world;.git*;*.so;*.os;*.out;.gitignore;.sconsign.dblite;*.*~;*.bak;*.tmp;CVS;.#*;*.pyo;*.pyc;.svn;*%*;tmp*.html;.DS_Store</string>
+ <string id="import_exclude_matches">test_*;crealis;*.o;world;.git*;*.so;*.os;*.out;.gitignore;.sconsign.dblite;*.*~;*.bak;*.tmp;CVS;.#*;*.pyo;*.pyc;.svn;*%*;tmp*.html;.DS_Store</string>
<string id="import_include_matches"></string>
<boolean id="import_live">1</boolean>
<boolean id="import_recursive">1</boolean>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,7 @@
+This file contains some important changes to HEAD.
+For more detailed changes see the SVN logs.
+(This file will be cleared with every release)
+--------------------------------------------------
+
+17.02.2008
+hashlib++ version 0.3.1 has been released.
View
@@ -0,0 +1,25 @@
+hashlib++ - a simple hash library for C++
+
+Copyright (c) 2007,2008 Benjamin Gr�delbach
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1) Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2) Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
No changes.
View
@@ -0,0 +1,52 @@
+/*
+ * hashlib++ - a simple hash library for C++
+ *
+ * Copyright (c) 2007,2008 Benjamin Grüdelbach
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+//----------------------------------------------------------------------
+
+/**
+ * @file hashlibpp.h
+ * @brief This file is just an include wrapper
+ * @date Sa 2 Feb
+ */
+
+//----------------------------------------------------------------------
+#ifndef HASHLIBPP_H
+#define HASHLIBPP_H
+
+//----------------------------------------------------------------------
+
+#include "hl_hashwrapper.h"
+#include "hl_sha1wrapper.h"
+#include "hl_sha256wrapper.h"
+
+
+//----------------------------------------------------------------------
+#endif
+
+//----------------------------------------------------------------------
+//EOF
View
@@ -0,0 +1,115 @@
+/*
+ * hashlib++ - a simple hash library for C++
+ *
+ * Copyright (c) 2007,2008 Benjamin Grüdelbach
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+//----------------------------------------------------------------------
+
+/**
+ * @file hl_exception.h
+ * @brief This file contains the hashlib++ exception class
+ * @date Sa 24 Nov 2007
+ */
+
+
+//----------------------------------------------------------------------
+//include protection
+#ifndef HL_EXCEPTION_H
+#define HL_EXCEPTION_H
+
+//----------------------------------------------------------------------
+//STL
+#include <string>
+
+//----------------------------------------------------------------------
+
+/**
+ * definition of hashlib++ errornumbers
+ */
+typedef enum hlerrors
+{
+ HL_NO_ERROR = 0,
+ HL_FILE_READ_ERROR
+} hlerror;
+
+//----------------------------------------------------------------------
+
+/**
+ * @brief This class represents a exception within the hashlib++
+ * project
+ */
+class hlException
+{
+ private:
+
+ /**
+ * Error Number
+ */
+ hlerror iError;
+
+ /**
+ * Error message as string
+ */
+ std::string strMessge;
+
+
+ public:
+ /**
+ * @brief constructor
+ * @param er Error number
+ * @param m Error message
+ */
+ hlException(hlerror er, std::string m)
+ {
+ this->iError = er;
+ this->strMessge = m;
+ }
+
+ /**
+ * @brief returns the error message
+ * @return the error message
+ */
+ std::string erro_message(void)
+ {
+ return strMessge;
+ }
+
+ /**
+ * @brief returns the error number
+ * @return the error number
+ */
+ hlerror error_number(void)
+ {
+ return iError;
+ }
+};
+
+//----------------------------------------------------------------------
+//end of include protection
+#endif
+
+//----------------------------------------------------------------------
+//EOF
Oops, something went wrong.

0 comments on commit 83d8e82

Please sign in to comment.