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 <mbroeker@largo.homelinux.org>
--- a/db_bridge/console.cpp
+++ b/db_bridge/console.cpp
@@ -3,7 +3,7 @@
* Copyright (C) Markus Broeker
*/
-#include <console.h>
+#include <console.hpp>
#include <cstdio>
#ifdef WIN32
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 <vector>
-#include <string>
-
-class Abstract_DB {
- protected:
- std::string user;
- std::string database;
- std::string password;
- std::string server;
-
- public:
- typedef std::vector <std::vector <std::string> >DB_RESULT;
- typedef std::vector <std::string> DB_ROW;
-
- virtual bool connect () = 0;
- virtual DB_RESULT query (std::string) = 0;
-};
-#endif
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 <vector>
+#include <string>
+
+class Abstract_DB {
+ protected:
+ std::string user;
+ std::string database;
+ std::string password;
+ std::string server;
+
+ public:
+ typedef std::vector <std::vector <std::string> >DB_RESULT;
+ typedef std::vector <std::string> DB_ROW;
+
+ virtual bool connect () = 0;
+ virtual DB_RESULT query (std::string) = 0;
+};
+#endif
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 <iostream>
-
-namespace Console {
- int getch ();
- void getpass (std::string &);
-};
-#endif
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 <iostream>
+
+namespace Console {
+ int getch ();
+ void getpass (std::string &);
+};
+#endif
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 <iostream>
-#include <mysql/mysql.h>
-
-#include <abstract_db.h>
-
-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
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 <iostream>
+#include <mysql/mysql.h>
+
+#include <abstract_db.hpp>
+
+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
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 <iostream>
-#include <abstract_db.h>
-
-#include <postgresql/libpq-fe.h>
-
-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
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 <iostream>
+#include <abstract_db.hpp>
+
+#include <postgresql/libpq-fe.h>
+
+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
--- a/db_bridge/main.cpp
+++ b/db_bridge/main.cpp
@@ -4,9 +4,9 @@
*/
#ifdef WITH_POSTGRESQL
-#include <postgresql_db.h>
+#include <postgresql_db.hpp>
#else
-#include <mysql_db.h>
+#include <mysql_db.hpp>
#endif
#include <cstdlib>
--- a/db_bridge/mysql_db.cpp
+++ b/db_bridge/mysql_db.cpp
@@ -4,8 +4,8 @@
*/
#include <cstdlib>
-#include <mysql_db.h>
-#include <console.h>
+#include <mysql_db.hpp>
+#include <console.hpp>
MySQL_DB::MySQL_DB (std::string srv, std::string usr, std::string pwd, std::string db)
{
--- a/db_bridge/postgresql_db.cpp
+++ b/db_bridge/postgresql_db.cpp
@@ -4,9 +4,9 @@
*/
#include <cstdlib>
-#include <postgresql_db.h>
+#include <postgresql_db.hpp>
#include <exception>
-#include <console.h>
+#include <console.hpp>
PostgreSQL_DB::PostgreSQL_DB (std::string srv, std::string usr, std::string pwd, std::string db)
{
--- a/pmc/cube.cc
+++ b/pmc/cube.cc
@@ -3,7 +3,7 @@
* Copyright (C) 2008 Markus Broeker
*/
-#include <cube.h>
+#include <cube.hpp>
#include <cstdio>
using namespace algebra;
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 <surface.h>
-#include <vector.h>
-#include <rectangle.h>
-
-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
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 <surface.hpp>
+#include <vector.hpp>
+#include <rectangle.hpp>
+
+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
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 <surface.h>
-#include <vector.h>
-
-class Drawable:public Object {
- protected:
- algebra::Vector anker;
- Surface *surface;
-
- public:
- virtual ~ Drawable () { };
-
- virtual void move (algebra::Vector) = 0;
- virtual void show () = 0;
-};
-#endif
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 <surface.hpp>
+#include <vector.hpp>
+
+class Drawable:public Object {
+ protected:
+ algebra::Vector anker;
+ Surface *surface;
+
+ public:
+ virtual ~ Drawable () { };
+
+ virtual void move (algebra::Vector) = 0;
+ virtual void show () = 0;
+};
+#endif
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 <string>
-
-extern int refCounter;
-
-class Object {
- protected:
- std::string name;
-
- public:
- virtual ~ Object ();
-
- virtual std::string getName ();
- virtual Object getClass ();
- int getInstances ();
-};
-#endif
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 <string>
+
+extern int refCounter;
+
+class Object {
+ protected:
+ std::string name;
+
+ public:
+ virtual ~ Object ();
+
+ virtual std::string getName ();
+ virtual Object getClass ();
+ int getInstances ();
+};
+#endif
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 <surface.h>
-#include <vector.h>
-#include <drawable.h>
-
-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
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 <surface.hpp>
+#include <vector.hpp>
+#include <drawable.hpp>
+
+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
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 <object.h>
-#include <SDL/SDL.h>
-
-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
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 <object.hpp>
+#include <SDL/SDL.h>
+
+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
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 <object.h>
-
-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
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 <object.hpp>
+
+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
--- a/pmc/main.cc
+++ b/pmc/main.cc
@@ -3,9 +3,9 @@
* Copyright (C) 2008 Markus Broeker
*/
-#include <surface.h>
-#include <rectangle.h>
-#include <cube.h>
+#include <surface.hpp>
+#include <rectangle.hpp>
+#include <cube.hpp>
#include <cstdio>
#include <cstdlib>
--- a/pmc/object.cc
+++ b/pmc/object.cc
@@ -3,7 +3,7 @@
* Copyright (C) 2008 Markus Broeker
*/
-#include <object.h>
+#include <object.hpp>
#include <iostream>
--- a/pmc/rectangle.cc
+++ b/pmc/rectangle.cc
@@ -3,7 +3,7 @@
* Copyright (C) 2008 Markus Broeker
*/
-#include <rectangle.h>
+#include <rectangle.hpp>
#include <cstdio>
using namespace algebra;
--- a/pmc/surface.cc
+++ b/pmc/surface.cc
@@ -3,7 +3,7 @@
* Copyright (C) 2008 Markus Broeker
*/
-#include <surface.h>
+#include <surface.hpp>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
--- a/pmc/vector.cc
+++ b/pmc/vector.cc
@@ -4,7 +4,7 @@
*/
#include <cmath>
-#include <vector.h>
+#include <vector.hpp>
#include <cstdio>