# HG changeset patch # User Markus Bröker # Date 1239878953 -7200 # Node ID 76514757b0d692190f415397e4e2a1759368f91c # Parent 993b97c4ad2d5316603a89a916d3d617548ccbea GNU Indent cannot handle C++ Source Files... I like GNU indent. I like it so much that i use it for all my projects. But it doesn't work with C++ sources. To avoid further problems, all C++ Headers will be renamed from *.h to their *.hpp counterparts. mbroeker committer: Markus Bröker diff --git a/db_bridge/console.cpp b/db_bridge/console.cpp --- a/db_bridge/console.cpp +++ b/db_bridge/console.cpp @@ -3,7 +3,7 @@ * Copyright (C) Markus Broeker */ -#include +#include #include #ifdef WIN32 diff --git a/db_bridge/include/abstract_db.h b/db_bridge/include/abstract_db.h deleted file mode 100644 --- a/db_bridge/include/abstract_db.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * db_bridge/include/abstract_db.h - * Copyright 2008 (C) Markus Broeker - */ - -#ifndef ABSTRACT_DB_H -#define ABSTRACT_DB_H - -#include -#include - -class Abstract_DB { - protected: - std::string user; - std::string database; - std::string password; - std::string server; - - public: - typedef std::vector >DB_RESULT; - typedef std::vector DB_ROW; - - virtual bool connect () = 0; - virtual DB_RESULT query (std::string) = 0; -}; -#endif diff --git a/db_bridge/include/abstract_db.hpp b/db_bridge/include/abstract_db.hpp new file mode 100644 --- /dev/null +++ b/db_bridge/include/abstract_db.hpp @@ -0,0 +1,26 @@ +/** + * db_bridge/include/abstract_db.h + * Copyright 2008 (C) Markus Broeker + */ + +#ifndef ABSTRACT_DB_H +#define ABSTRACT_DB_H + +#include +#include + +class Abstract_DB { + protected: + std::string user; + std::string database; + std::string password; + std::string server; + + public: + typedef std::vector >DB_RESULT; + typedef std::vector DB_ROW; + + virtual bool connect () = 0; + virtual DB_RESULT query (std::string) = 0; +}; +#endif diff --git a/db_bridge/include/console.h b/db_bridge/include/console.h deleted file mode 100644 --- a/db_bridge/include/console.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CONSOLE_H -#define CONSOLE_H - -#ifdef WIN32 -#define BS 127 -#else -#define BS 127 -#endif - -#include - -namespace Console { - int getch (); - void getpass (std::string &); -}; -#endif diff --git a/db_bridge/include/console.hpp b/db_bridge/include/console.hpp new file mode 100644 --- /dev/null +++ b/db_bridge/include/console.hpp @@ -0,0 +1,16 @@ +#ifndef CONSOLE_H +#define CONSOLE_H + +#ifdef WIN32 +#define BS 127 +#else +#define BS 127 +#endif + +#include + +namespace Console { + int getch (); + void getpass (std::string &); +}; +#endif diff --git a/db_bridge/include/mysql_db.h b/db_bridge/include/mysql_db.h deleted file mode 100644 --- a/db_bridge/include/mysql_db.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * db_bridge/include/mysql_db.h - * Copyright 2008 (C) Markus Broeker - */ - -#ifndef MYSQL_DB_H -#define MYSQL_DB_H - -#include -#include - -#include - -class MySQL_DB:public Abstract_DB { - private: - MYSQL * conn; - MYSQL_RES *res; - - public: - MySQL_DB (std::string, std::string, std::string, std::string); - virtual ~ MySQL_DB (); - bool connect (); - Abstract_DB::DB_RESULT query (std::string); -}; -#endif diff --git a/db_bridge/include/mysql_db.hpp b/db_bridge/include/mysql_db.hpp new file mode 100644 --- /dev/null +++ b/db_bridge/include/mysql_db.hpp @@ -0,0 +1,25 @@ +/** + * db_bridge/include/mysql_db.h + * Copyright 2008 (C) Markus Broeker + */ + +#ifndef MYSQL_DB_H +#define MYSQL_DB_H + +#include +#include + +#include + +class MySQL_DB:public Abstract_DB { + private: + MYSQL * conn; + MYSQL_RES *res; + + public: + MySQL_DB (std::string, std::string, std::string, std::string); + virtual ~ MySQL_DB (); + bool connect (); + Abstract_DB::DB_RESULT query (std::string); +}; +#endif diff --git a/db_bridge/include/postgresql_db.h b/db_bridge/include/postgresql_db.h deleted file mode 100644 --- a/db_bridge/include/postgresql_db.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * db_bridge/include/postgresql_db.h - * Copyright 2008 (C) Markus Broeker - */ - -#ifndef POSTGRESQL_DB_H -#define POSTGRESQL_DB_H - -#include -#include - -#include - -class PostgreSQL_DB:public Abstract_DB { - private: - PGconn * conn; - PGresult *res; - std::string conninfo; - - public: - PostgreSQL_DB (std::string, std::string, std::string, std::string); - virtual ~ PostgreSQL_DB (); - bool connect (); - Abstract_DB::DB_RESULT query (std::string); -}; -#endif diff --git a/db_bridge/include/postgresql_db.hpp b/db_bridge/include/postgresql_db.hpp new file mode 100644 --- /dev/null +++ b/db_bridge/include/postgresql_db.hpp @@ -0,0 +1,26 @@ +/** + * db_bridge/include/postgresql_db.h + * Copyright 2008 (C) Markus Broeker + */ + +#ifndef POSTGRESQL_DB_H +#define POSTGRESQL_DB_H + +#include +#include + +#include + +class PostgreSQL_DB:public Abstract_DB { + private: + PGconn * conn; + PGresult *res; + std::string conninfo; + + public: + PostgreSQL_DB (std::string, std::string, std::string, std::string); + virtual ~ PostgreSQL_DB (); + bool connect (); + Abstract_DB::DB_RESULT query (std::string); +}; +#endif diff --git a/db_bridge/main.cpp b/db_bridge/main.cpp --- a/db_bridge/main.cpp +++ b/db_bridge/main.cpp @@ -4,9 +4,9 @@ */ #ifdef WITH_POSTGRESQL -#include +#include #else -#include +#include #endif #include diff --git a/db_bridge/mysql_db.cpp b/db_bridge/mysql_db.cpp --- a/db_bridge/mysql_db.cpp +++ b/db_bridge/mysql_db.cpp @@ -4,8 +4,8 @@ */ #include -#include -#include +#include +#include MySQL_DB::MySQL_DB (std::string srv, std::string usr, std::string pwd, std::string db) { diff --git a/db_bridge/postgresql_db.cpp b/db_bridge/postgresql_db.cpp --- a/db_bridge/postgresql_db.cpp +++ b/db_bridge/postgresql_db.cpp @@ -4,9 +4,9 @@ */ #include -#include +#include #include -#include +#include PostgreSQL_DB::PostgreSQL_DB (std::string srv, std::string usr, std::string pwd, std::string db) { diff --git a/pmc/cube.cc b/pmc/cube.cc --- a/pmc/cube.cc +++ b/pmc/cube.cc @@ -3,7 +3,7 @@ * Copyright (C) 2008 Markus Broeker */ -#include +#include #include using namespace algebra; diff --git a/pmc/include/cube.h b/pmc/include/cube.h deleted file mode 100644 --- a/pmc/include/cube.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * test/demos/pmc/include/cube.h - * Copyright (C) 2008 Markus Broeker - */ - -#ifndef _CUBE_H -#define _CUBE_H - -#include -#include -#include - -class Cube:public Drawable { - private: - algebra::Vector * P[8]; - int height; - - public: - Cube (Surface *, algebra::Vector &, algebra::Vector &, algebra::Vector &, algebra::Vector &, int); - Cube (Surface *, algebra::Vector[4], int); - Cube (Surface *); - Cube (const Cube &); - virtual ~ Cube (); - - void show (); - void move (algebra::Vector); -}; -#endif diff --git a/pmc/include/cube.hpp b/pmc/include/cube.hpp new file mode 100644 --- /dev/null +++ b/pmc/include/cube.hpp @@ -0,0 +1,28 @@ +/** + * test/demos/pmc/include/cube.h + * Copyright (C) 2008 Markus Broeker + */ + +#ifndef _CUBE_H +#define _CUBE_H + +#include +#include +#include + +class Cube:public Drawable { + private: + algebra::Vector * P[8]; + int height; + + public: + Cube (Surface *, algebra::Vector &, algebra::Vector &, algebra::Vector &, algebra::Vector &, int); + Cube (Surface *, algebra::Vector[4], int); + Cube (Surface *); + Cube (const Cube &); + virtual ~ Cube (); + + void show (); + void move (algebra::Vector); +}; +#endif diff --git a/pmc/include/drawable.h b/pmc/include/drawable.h deleted file mode 100644 --- a/pmc/include/drawable.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * test/demos/pmc/include/drawable.h - * Copyright (C) 2008 Markus Broeker - */ - -#ifndef DRAWABLE_H -#define DRAWABLE_H - -#include -#include - -class Drawable:public Object { - protected: - algebra::Vector anker; - Surface *surface; - - public: - virtual ~ Drawable () { }; - - virtual void move (algebra::Vector) = 0; - virtual void show () = 0; -}; -#endif diff --git a/pmc/include/drawable.hpp b/pmc/include/drawable.hpp new file mode 100644 --- /dev/null +++ b/pmc/include/drawable.hpp @@ -0,0 +1,23 @@ +/** + * test/demos/pmc/include/drawable.h + * Copyright (C) 2008 Markus Broeker + */ + +#ifndef DRAWABLE_H +#define DRAWABLE_H + +#include +#include + +class Drawable:public Object { + protected: + algebra::Vector anker; + Surface *surface; + + public: + virtual ~ Drawable () { }; + + virtual void move (algebra::Vector) = 0; + virtual void show () = 0; +}; +#endif diff --git a/pmc/include/object.h b/pmc/include/object.h deleted file mode 100644 --- a/pmc/include/object.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * test/demos/pmc/include/object.h - * Copyright (C) 2008 Markus Broeker - */ - -#ifndef OBJECT_H -#define OBJECT_H - -#include - -extern int refCounter; - -class Object { - protected: - std::string name; - - public: - virtual ~ Object (); - - virtual std::string getName (); - virtual Object getClass (); - int getInstances (); -}; -#endif diff --git a/pmc/include/object.hpp b/pmc/include/object.hpp new file mode 100644 --- /dev/null +++ b/pmc/include/object.hpp @@ -0,0 +1,24 @@ +/** + * test/demos/pmc/include/object.h + * Copyright (C) 2008 Markus Broeker + */ + +#ifndef OBJECT_H +#define OBJECT_H + +#include + +extern int refCounter; + +class Object { + protected: + std::string name; + + public: + virtual ~ Object (); + + virtual std::string getName (); + virtual Object getClass (); + int getInstances (); +}; +#endif diff --git a/pmc/include/rectangle.h b/pmc/include/rectangle.h deleted file mode 100644 --- a/pmc/include/rectangle.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * test/demos/pmc/include/rectangle.h - * Copyright (C) 2008 Markus Broeker - */ - -#ifndef RECTANGLE_H -#define RECTANGLE_H - -#include -#include -#include - -class Rectangle:public Drawable { - private: - algebra::Vector * P[4]; - - public: - Rectangle (Surface *, algebra::Vector & p1, algebra::Vector & p2, algebra::Vector & p3, algebra::Vector & p4); - Rectangle (Surface *, algebra::Vector[4]); - Rectangle (Surface *); - Rectangle (const Rectangle &); - virtual ~ Rectangle (); - - void move (algebra::Vector); - void show (); -}; -#endif diff --git a/pmc/include/rectangle.hpp b/pmc/include/rectangle.hpp new file mode 100644 --- /dev/null +++ b/pmc/include/rectangle.hpp @@ -0,0 +1,27 @@ +/** + * test/demos/pmc/include/rectangle.h + * Copyright (C) 2008 Markus Broeker + */ + +#ifndef RECTANGLE_H +#define RECTANGLE_H + +#include +#include +#include + +class Rectangle:public Drawable { + private: + algebra::Vector * P[4]; + + public: + Rectangle (Surface *, algebra::Vector & p1, algebra::Vector & p2, algebra::Vector & p3, algebra::Vector & p4); + Rectangle (Surface *, algebra::Vector[4]); + Rectangle (Surface *); + Rectangle (const Rectangle &); + virtual ~ Rectangle (); + + void move (algebra::Vector); + void show (); +}; +#endif diff --git a/pmc/include/surface.h b/pmc/include/surface.h deleted file mode 100644 --- a/pmc/include/surface.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * test/demos/pmc/include/surface.h - * Copyright (C) 2008 Markus Broeker - */ - -#ifndef SURFACE_H -#define SURFACE_H - -#include -#include - -class Surface:public Object { - private: - int width; - int height; - int depth; - int bpp; - - Uint32 color, red, green, blue, black; - SDL_Surface *screen; - - public: - enum foregroundColor { BLACK = 1, RED, GREEN, BLUE }; - - Surface (int w, int h, int d); - Surface (const Surface &) { /* Copy Constructor disabled */ }; - virtual ~Surface (); - - int getWidth () { return width; }; - int getHeight () { return height; }; - - void drawPixel (int x, int y); - void drawLine (int x1, int y1, int x2, int y2); - - void flip (); - void setColor (enum foregroundColor); -}; -#endif diff --git a/pmc/include/surface.hpp b/pmc/include/surface.hpp new file mode 100644 --- /dev/null +++ b/pmc/include/surface.hpp @@ -0,0 +1,38 @@ +/** + * test/demos/pmc/include/surface.h + * Copyright (C) 2008 Markus Broeker + */ + +#ifndef SURFACE_H +#define SURFACE_H + +#include +#include + +class Surface:public Object { + private: + int width; + int height; + int depth; + int bpp; + + Uint32 color, red, green, blue, black; + SDL_Surface *screen; + + public: + enum foregroundColor { BLACK = 1, RED, GREEN, BLUE }; + + Surface (int w, int h, int d); + Surface (const Surface &) { /* Copy Constructor disabled */ }; + virtual ~Surface (); + + int getWidth () { return width; }; + int getHeight () { return height; }; + + void drawPixel (int x, int y); + void drawLine (int x1, int y1, int x2, int y2); + + void flip (); + void setColor (enum foregroundColor); +}; +#endif diff --git a/pmc/include/vector.h b/pmc/include/vector.h deleted file mode 100644 --- a/pmc/include/vector.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * test/demos/pmc/include/vector.h - * Copyright (C) 2008 Markus Broeker - */ - -#ifndef VECTOR_H -#define VECTOR_H - -#include - -namespace algebra { - class Vector:public Object { - public: - enum Mode { DEG, RAD, GRAD }; - - Vector (int xx = 0, int yy = 0); - Vector (const Vector &); - virtual ~ Vector (); - - int X (); - int Y (); - - Vector operator+ (Vector &); - Vector operator- (Vector &); - double abs (); - - void vector (); - double angle (Vector &); - void setMode (Mode m = RAD); - - private: - Mode mode; - - int x; - int y; - }; -} -#endif diff --git a/pmc/include/vector.hpp b/pmc/include/vector.hpp new file mode 100644 --- /dev/null +++ b/pmc/include/vector.hpp @@ -0,0 +1,38 @@ +/** + * test/demos/pmc/include/vector.h + * Copyright (C) 2008 Markus Broeker + */ + +#ifndef VECTOR_H +#define VECTOR_H + +#include + +namespace algebra { + class Vector:public Object { + public: + enum Mode { DEG, RAD, GRAD }; + + Vector (int xx = 0, int yy = 0); + Vector (const Vector &); + virtual ~ Vector (); + + int X (); + int Y (); + + Vector operator+ (Vector &); + Vector operator- (Vector &); + double abs (); + + void vector (); + double angle (Vector &); + void setMode (Mode m = RAD); + + private: + Mode mode; + + int x; + int y; + }; +} +#endif diff --git a/pmc/main.cc b/pmc/main.cc --- a/pmc/main.cc +++ b/pmc/main.cc @@ -3,9 +3,9 @@ * Copyright (C) 2008 Markus Broeker */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/pmc/object.cc b/pmc/object.cc --- a/pmc/object.cc +++ b/pmc/object.cc @@ -3,7 +3,7 @@ * Copyright (C) 2008 Markus Broeker */ -#include +#include #include diff --git a/pmc/rectangle.cc b/pmc/rectangle.cc --- a/pmc/rectangle.cc +++ b/pmc/rectangle.cc @@ -3,7 +3,7 @@ * Copyright (C) 2008 Markus Broeker */ -#include +#include #include using namespace algebra; diff --git a/pmc/surface.cc b/pmc/surface.cc --- a/pmc/surface.cc +++ b/pmc/surface.cc @@ -3,7 +3,7 @@ * Copyright (C) 2008 Markus Broeker */ -#include +#include #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) diff --git a/pmc/vector.cc b/pmc/vector.cc --- a/pmc/vector.cc +++ b/pmc/vector.cc @@ -4,7 +4,7 @@ */ #include -#include +#include #include