[nemiver] Big style cleanup
- From: Dodji Seketeli <dodji src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nemiver] Big style cleanup
- Date: Sun, 20 Sep 2009 20:49:14 +0000 (UTC)
commit cbfe7b8b23351a8206fa082c5b3f24c6ffef3ea3
Author: Dodji Seketeli <dodji redhat com>
Date: Sun Sep 20 21:53:29 2009 +0200
Big style cleanup
* lots-of-files: Remove space before ";". There should always be
space around operator '='.
src/common/nmv-buffer.h | 18 +-
src/common/nmv-conf-manager.cc | 216 +++++-----
src/common/nmv-conf-manager.h | 48 +-
src/common/nmv-connection-manager.cc | 186 ++++----
src/common/nmv-connection-manager.h | 12 +-
src/common/nmv-connection.cc | 158 +++---
src/common/nmv-connection.h | 58 ++--
src/common/nmv-date-utils.cc | 24 +-
src/common/nmv-date-utils.h | 8 +-
src/common/nmv-delete-statement.cc | 34 +-
src/common/nmv-delete-statement.h | 18 +-
src/common/nmv-dynamic-module.cc | 308 ++++++------
src/common/nmv-dynamic-module.h | 218 +++++-----
src/common/nmv-env.cc | 134 +++---
src/common/nmv-env.h | 38 +-
src/common/nmv-exception.cc | 8 +-
src/common/nmv-exception.h | 52 +-
src/common/nmv-i-connection-driver.h | 14 +-
src/common/nmv-i-connection-manager-driver.h | 30 +-
src/common/nmv-i-input-stream.h | 4 +-
src/common/nmv-initializer.cc | 10 +-
src/common/nmv-initializer.h | 10 +-
src/common/nmv-insert-statement.cc | 60 ++--
src/common/nmv-insert-statement.h | 20 +-
src/common/nmv-libxml-utils.cc | 106 ++--
src/common/nmv-libxml-utils.h | 42 +-
src/common/nmv-log-stream-utils.h | 18 +-
src/common/nmv-log-stream.cc | 300 ++++++------
src/common/nmv-log-stream.h | 94 ++--
src/common/nmv-object.cc | 46 +-
src/common/nmv-object.h | 30 +-
src/common/nmv-option-utils.cc | 18 +-
src/common/nmv-option-utils.h | 16 +-
src/common/nmv-parsing-utils.cc | 136 +++---
src/common/nmv-parsing-utils.h | 24 +-
src/common/nmv-plugin.cc | 374 ++++++++--------
src/common/nmv-plugin.h | 144 +++---
src/common/nmv-proc-mgr.cc | 122 +++---
src/common/nmv-proc-mgr.h | 38 +-
src/common/nmv-proc-utils.cc | 96 ++--
src/common/nmv-proc-utils.h | 4 +-
src/common/nmv-safe-ptr-utils.h | 20 +-
src/common/nmv-safe-ptr.h | 80 ++--
src/common/nmv-scope-logger.cc | 44 +-
src/common/nmv-scope-logger.h | 16 +-
src/common/nmv-sequence.cc | 20 +-
src/common/nmv-sequence.h | 20 +-
src/common/nmv-sql-statement.cc | 44 +-
src/common/nmv-sql-statement.h | 48 +-
src/common/nmv-tools.cc | 112 +++---
src/common/nmv-tools.h | 6 +-
src/common/nmv-transaction.cc | 110 +++---
src/common/nmv-transaction.h | 56 ++--
src/common/nmv-ustring.cc | 228 +++++-----
src/common/nmv-ustring.h | 92 ++--
src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.cc | 254 +++++-----
src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.h | 46 +-
src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.cc | 62 ++--
src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.h | 18 +-
src/dbgengine/nmv-cpp-trait.cc | 64 ++--
src/dbgengine/nmv-dbg-common.cc | 14 +-
src/dbgengine/nmv-dbg-common.h | 294 ++++++------
src/dbgengine/nmv-gdb-engine.cc | 12 +-
src/dbgengine/nmv-gdb-engine.h | 212 ++++----
src/dbgengine/nmv-gdbmi-parser.cc | 8 +-
src/dbgengine/nmv-gdbmi-parser.h | 160 ++++----
src/dbgengine/nmv-i-lang-trait.h | 28 +-
src/dbgengine/nmv-i-var-list-walker.h | 18 +-
src/dbgengine/nmv-i-var-list.h | 36 +-
src/dbgengine/nmv-var-list.cc | 416 ++++++++--------
src/dbgengine/nmv-var-walker.cc | 2 +-
src/dbgengine/nmv-var.h | 46 +-
src/langs/nmv-cpp-ast.cc | 52 +-
src/langs/nmv-cpp-ast.h | 30 +-
src/langs/nmv-cpp-lexer-utils.cc | 14 +-
src/langs/nmv-cpp-lexer-utils.h | 6 +-
src/langs/nmv-cpp-lexer.cc | 380 ++++++++--------
src/langs/nmv-cpp-lexer.h | 62 ++--
src/langs/nmv-cpp-parser.cc | 8 +-
src/langs/nmv-cpp-parser.h | 2 +-
src/main.cc | 4 +-
src/persp/dbgperspective/nmv-dbg-perspective.cc | 8 +-
.../nmv-global-vars-inspector-dialog.cc | 2 +-
.../dbgperspective/nmv-local-vars-inspector.cc | 4 +-
src/persp/dbgperspective/nmv-vars-treeview.cc | 2 +-
src/persp/nmv-i-perspective.h | 24 +-
src/uicommon/nmv-hex-document.h | 2 +-
src/uicommon/nmv-popup-tip.h | 24 +-
src/uicommon/nmv-source-editor.cc | 388 ++++++++--------
src/uicommon/nmv-source-editor.h | 66 ++--
src/uicommon/nmv-spinner-tool-item.cc | 64 ++--
src/uicommon/nmv-spinner-tool-item.h | 34 +-
src/uicommon/nmv-spinner.cc | 64 ++--
src/uicommon/nmv-spinner.h | 36 +-
src/uicommon/nmv-terminal.cc | 92 ++--
src/uicommon/nmv-terminal.h | 32 +-
src/workbench/nmv-i-pref-mgr.h | 14 +-
src/workbench/nmv-i-workbench.h | 56 ++--
src/workbench/nmv-workbench.cc | 500 ++++++++++----------
tests/do-core.cc | 10 +-
tests/fooprog.cc | 54 +-
tests/inout.cc | 14 +-
tests/pointer-deref.cc | 70 ++--
tests/templated-var.cc | 24 +-
tests/test-breakpoint.cc | 122 +++---
tests/test-core.cc | 84 ++--
tests/test-cpp-lexer.cc | 40 +-
tests/test-cpp-parser.cc | 34 +-
tests/test-cpptrait.cc | 46 +-
tests/test-deref.cc | 102 ++--
tests/test-env.cc | 6 +-
tests/test-gdbmi.cc | 324 +++++++-------
tests/test-global-variables.cc | 82 ++--
tests/test-libtool-wrapper-detection.cc | 10 +-
tests/test-local-vars-list.cc | 124 +++---
tests/test-overloads.cc | 62 ++--
tests/test-stdout.cc | 6 +-
tests/test-types.cc | 32 +-
tests/test-unicode.cc | 58 ++--
tests/test-var-list.cc | 150 +++---
tests/test-var-path-expr.cc | 44 +-
tests/test-var-walker.cc | 184 ++++----
tests/test-vars.cc | 6 +-
tests/test-watchpoint.cc | 8 +-
124 files changed, 4773 insertions(+), 4773 deletions(-)
---
diff --git a/src/common/nmv-buffer.h b/src/common/nmv-buffer.h
index d0481c1..8115433 100644
--- a/src/common/nmv-buffer.h
+++ b/src/common/nmv-buffer.h
@@ -32,8 +32,8 @@ namespace nemiver {
namespace common {
class NEMIVER_API Buffer {
- char * m_data ;
- unsigned long m_len ;
+ char * m_data;
+ unsigned long m_len;
public:
@@ -42,8 +42,8 @@ public:
Buffer (const char *a_buf, unsigned long a_len)
{
- m_data = const_cast<char*>(a_buf) ;
- m_len = a_len ;
+ m_data = const_cast<char*>(a_buf);
+ m_len = a_len;
}
Buffer (const Buffer &a_buf) : m_data (a_buf.m_data), m_len (a_buf.m_len)
@@ -53,20 +53,20 @@ public:
(const char* a_buf, unsigned long a_len)
{
m_data = const_cast<char*> (a_buf);
- m_len = a_len ;
+ m_len = a_len;
}
Buffer& operator= (Buffer &a_buf)
{
if (this == &a_buf)
- return *this ;
- m_data = a_buf.m_data ;
- m_len = a_buf.m_len ;
+ return *this;
+ m_data = a_buf.m_data;
+ m_len = a_buf.m_len;
}
const char* get_data () const
{
- return m_data ;
+ return m_data;
}
unsigned long get_len () const
diff --git a/src/common/nmv-conf-manager.cc b/src/common/nmv-conf-manager.cc
index 84661bd..9406e4a 100644
--- a/src/common/nmv-conf-manager.cc
+++ b/src/common/nmv-conf-manager.cc
@@ -40,81 +40,81 @@ static const char *NEMIVER_CONFIG_TOP_DIR_NAME = ".nemiver";
static const char *NEMIVER_CONFIG_DIR_NAME = "config";
static const char *NEMIVER_CONFIG_FILE_NAME = "nemiver.conf";
-using namespace std ;
-using namespace Glib ;
+using namespace std;
+using namespace Glib;
namespace nemiver {
namespace common {
-typedef map<UString, UString> StringToStringMap ;
+typedef map<UString, UString> StringToStringMap;
struct ConfigPriv
{
- Glib::RecMutex mutex ;
- StringToStringMap props ;
+ Glib::RecMutex mutex;
+ StringToStringMap props;
}
;//end ConfigPriv
static Glib::RecMutex&
config_mutex ()
{
- static Glib::RecMutex s_config_mutex ;
- return s_config_mutex ;
+ static Glib::RecMutex s_config_mutex;
+ return s_config_mutex;
}
Config::Config ()
{
- m_priv = new ConfigPriv ;
+ m_priv = new ConfigPriv;
}
Config::Config (const Config &a_conf) :
Object (a_conf)
{
- m_priv = new ConfigPriv () ;
- m_priv->props = a_conf.m_priv->props ;
+ m_priv = new ConfigPriv ();
+ m_priv->props = a_conf.m_priv->props;
}
Config&
Config::operator= (const Config &a_conf)
{
if (this == &a_conf) {
- return *this ;
+ return *this;
}
- m_priv->props = a_conf.m_priv->props ;
- return *this ;
+ m_priv->props = a_conf.m_priv->props;
+ return *this;
}
Config::~Config ()
{
if (m_priv) {
- delete m_priv ;
- m_priv = NULL ;
+ delete m_priv;
+ m_priv = NULL;
}
}
bool
Config::get_property (const UString &a_name, UString &a_value)
{
- StringToStringMap::iterator it = m_priv->props.find (a_name) ;
+ StringToStringMap::iterator it = m_priv->props.find (a_name);
if (it == m_priv->props.end ()) {
- return false ;
+ return false;
}
- a_value = it->second ;
- return true ;
+ a_value = it->second;
+ return true;
}
void
Config::set_property (const UString a_name, const UString a_value)
{
if (a_name == "")
- return ;
+ return;
{
Glib::RecMutex::Lock lock (m_priv->mutex)
- ;
+ ;
m_priv->props.insert
- (StringToStringMap::value_type (a_name, a_value)) ;
+ (StringToStringMap::value_type (a_name, a_value));
}
}
@@ -122,55 +122,55 @@ Config&
ConfManager::get_config ()
{
- static Config s_config ;
- return s_config ;
+ static Config s_config;
+ return s_config;
}
void
ConfManager::set_config (const Config &a_conf)
{
- Glib::RecMutex::Lock lock (config_mutex ()) ;
- get_config () = a_conf ;
+ Glib::RecMutex::Lock lock (config_mutex ());
+ get_config () = a_conf;
}
Config&
ConfManager::parse_config_file (const UString &a_path)
{
- Config conf ;
+ Config conf;
if (a_path == "") {
- THROW ("Got path \"\" to config file") ;
+ THROW ("Got path \"\" to config file");
}
- using libxmlutils::XMLTextReaderSafePtr ;
- using libxmlutils::XMLCharSafePtr ;
- XMLTextReaderSafePtr reader ;
+ using libxmlutils::XMLTextReaderSafePtr;
+ using libxmlutils::XMLCharSafePtr ;
+ XMLTextReaderSafePtr reader;
- reader.reset (xmlNewTextReaderFilename (a_path.c_str ())) ;
+ reader.reset (xmlNewTextReaderFilename (a_path.c_str ()));
if (!reader) {
- THROW ("could not create xml reader") ;
+ THROW ("could not create xml reader");
}
- xmlReaderTypes type ;
- int type_tmp (0) ;
- int res (0) ;
- for (res = xmlTextReaderRead (reader.get ()) ;
+ xmlReaderTypes type;
+ int type_tmp (0);
+ int res (0);
+ for (res = xmlTextReaderRead (reader.get ());
res > 0;
res = xmlTextReaderRead (reader.get ())) {
- type_tmp = xmlTextReaderNodeType (reader.get ()) ;
- THROW_IF_FAIL2 (type_tmp >= 0, "got an error while parsing conf file") ;
- type = static_cast<xmlReaderTypes> (type_tmp) ;
+ type_tmp = xmlTextReaderNodeType (reader.get ());
+ THROW_IF_FAIL2 (type_tmp >= 0, "got an error while parsing conf file");
+ type = static_cast<xmlReaderTypes> (type_tmp);
switch (type) {
case XML_READER_TYPE_ELEMENT: {
- XMLCharSafePtr str (xmlTextReaderName (reader.get ())) ;
- UString name = reinterpret_cast<const char*> (str.get ()) ;
+ XMLCharSafePtr str (xmlTextReaderName (reader.get ()));
+ UString name = reinterpret_cast<const char*> (str.get ());
if (name == "database") {
- xmlNode* node = xmlTextReaderExpand (reader.get ()) ;
- THROW_IF_FAIL (node) ;
- for (xmlNode *cur_node=node->children ;
- cur_node ;
+ xmlNode* node = xmlTextReaderExpand (reader.get ());
+ THROW_IF_FAIL (node);
+ for (xmlNode *cur_node=node->children;
+ cur_node;
cur_node = cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE
&& cur_node->name) {
@@ -178,111 +178,111 @@ ConfManager::parse_config_file (const UString &a_path)
(const char*)cur_node->name, 10)) {
THROW_IF_FAIL (cur_node->children
&& xmlNodeIsText
- (cur_node->children)) ;
+ (cur_node->children));
XMLCharSafePtr con
- (xmlNodeGetContent (cur_node->children)) ;
+ (xmlNodeGetContent (cur_node->children));
conf.set_property ("database.connection",
- (char*)con.get ()) ;
+ (char*)con.get ());
} else if (!strncmp ("username",
(const char*)cur_node->name, 8)) {
THROW_IF_FAIL (cur_node->children
&& xmlNodeIsText
- (cur_node->children)) ;
+ (cur_node->children));
XMLCharSafePtr user
- (xmlNodeGetContent (cur_node->children)) ;
+ (xmlNodeGetContent (cur_node->children));
conf.set_property ("database.username",
- (const char*) user.get ()) ;
+ (const char*) user.get ());
} else if (!strncmp ("password",
(const char*)cur_node->name, 8)) {
THROW_IF_FAIL (cur_node->children
&& xmlNodeIsText
- (cur_node->children)) ;
+ (cur_node->children));
XMLCharSafePtr user
- (xmlNodeGetContent (cur_node->children)) ;
+ (xmlNodeGetContent (cur_node->children));
conf.set_property ("database.password",
- (const char*)user.get ()) ;
+ (const char*)user.get ());
}
}
}
} else if (name == "logging") {
- xmlNode* node = xmlTextReaderExpand (reader.get ()) ;
- THROW_IF_FAIL (node) ;
- for (xmlNode *cur_node=node->children ;
- cur_node ;
+ xmlNode* node = xmlTextReaderExpand (reader.get ());
+ THROW_IF_FAIL (node);
+ for (xmlNode *cur_node=node->children;
+ cur_node;
cur_node = cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE
&& cur_node->name ) {
if (!strncmp ("enabled",
(const char*)cur_node->name, 7)) {
XMLCharSafePtr value
- (xmlGetProp (cur_node, (xmlChar*) "value")) ;
+ (xmlGetProp (cur_node, (xmlChar*) "value"));
conf.set_property ("logging.enabled",
- (const char*)value.get ()) ;
+ (const char*)value.get ());
} else if (!strncmp ("level",
(const char*)cur_node->name, 5)){
XMLCharSafePtr value
((xmlChar*)xmlGetProp (cur_node,
- (const xmlChar*)"value")) ;
+ (const xmlChar*)"value"));
conf.set_property ("logging.level",
- (const char*)value.get ()) ;
+ (const char*)value.get ());
} else if (!strncmp ("logstreamtype",
(const char*)cur_node->name, 13)) {
libxmlutils::XMLCharSafePtr value
((xmlChar*) xmlGetProp (cur_node,
(const xmlChar*)"value"));
conf.set_property ("logging.logstreamtype",
- (const char*)value.get ()) ;
+ (const char*)value.get ());
} else if (!strncmp ("logfile",
(const char*)cur_node->name, 7)){
libxmlutils::XMLCharSafePtr content
((xmlChar*)xmlNodeGetContent(cur_node->children));
conf.set_property ("logging.logfile",
- (const char*)content.get ()) ;
+ (const char*)content.get ());
}
}
}
} else if (name == "config") {
XMLCharSafePtr value (xmlTextReaderGetAttribute
- (reader.get (), (const xmlChar*)"version")) ;
+ (reader.get (), (const xmlChar*)"version"));
conf.set_property ("config.version",
- (const char*)value.get ()) ;
+ (const char*)value.get ());
}
}
- break ;
+ break;
default:
- break ;
+ break;
}
}
- THROW_IF_FAIL2 (res == 0, "got an error while parsing config file") ;
- set_config (conf) ;
+ THROW_IF_FAIL2 (res == 0, "got an error while parsing config file");
+ set_config (conf);
- return get_config () ;
+ return get_config ();
}
Config&
ConfManager::parse_user_config_file (bool a_create_if_not_exists)
{
- string home_dir = get_home_dir () ;
- vector<string> path_elems ;
- path_elems.push_back (home_dir) ;
- path_elems.push_back (NEMIVER_CONFIG_TOP_DIR_NAME) ;
- path_elems.push_back (NEMIVER_CONFIG_DIR_NAME) ;
- string user_config_path = build_filename (path_elems) ;
+ string home_dir = get_home_dir ();
+ vector<string> path_elems;
+ path_elems.push_back (home_dir);
+ path_elems.push_back (NEMIVER_CONFIG_TOP_DIR_NAME);
+ path_elems.push_back (NEMIVER_CONFIG_DIR_NAME);
+ string user_config_path = build_filename (path_elems);
if (!file_test (user_config_path, FILE_TEST_IS_DIR))
THROW_IF_FAIL (g_mkdir_with_parents
- (user_config_path.c_str (), S_IRWXU) == 0) ;
+ (user_config_path.c_str (), S_IRWXU) == 0);
string user_config_file = build_filename
- (user_config_path, NEMIVER_CONFIG_FILE_NAME) ;
+ (user_config_path, NEMIVER_CONFIG_FILE_NAME);
if (!file_test (user_config_file, FILE_TEST_EXISTS)
&& a_create_if_not_exists) {
- create_default_config_file (user_config_file.c_str ()) ;
+ create_default_config_file (user_config_file.c_str ());
}
- parse_config_file (user_config_file.c_str ()) ;
- return get_config () ;
+ parse_config_file (user_config_file.c_str ());
+ return get_config ();
}
bool
@@ -299,10 +299,10 @@ ConfManager::get_user_config_dir_path ()
{
static string user_config_dir;
if (user_config_dir.empty ()) {
- vector<string> path_elems ;
- path_elems.push_back (get_home_dir ()) ;
- path_elems.push_back (NEMIVER_CONFIG_TOP_DIR_NAME) ;
- user_config_dir = build_filename (path_elems) ;
+ vector<string> path_elems;
+ path_elems.push_back (get_home_dir ());
+ path_elems.push_back (NEMIVER_CONFIG_TOP_DIR_NAME);
+ user_config_dir = build_filename (path_elems);
}
LOG_DD ("user_config_dir: " << user_config_dir);
return user_config_dir;
@@ -312,24 +312,24 @@ void
ConfManager::create_default_config_file (const UString a_path)
{
- ofstream of ;
+ ofstream of;
try {
- string filepath (Glib::filename_from_utf8 (a_path)) ;
+ string filepath (Glib::filename_from_utf8 (a_path));
of.open (filepath.c_str ());
- THROW_IF_FAIL (of.good ()) ;
- create_default_config_file (of) ;
- of.flush () ;
+ THROW_IF_FAIL (of.good ());
+ create_default_config_file (of);
+ of.flush ();
} catch (nemiver::common::Exception &e) {
- of.close () ;
- RETHROW_EXCEPTION (e) ;
+ of.close ();
+ RETHROW_EXCEPTION (e);
} catch (Glib::Exception &e) {
- of.close () ;
- RETHROW_EXCEPTION (e) ;
+ of.close ();
+ RETHROW_EXCEPTION (e);
} catch (std::exception &e) {
- of.close () ;
- RETHROW_EXCEPTION (e) ;
+ of.close ();
+ RETHROW_EXCEPTION (e);
}
- of.close () ;
+ of.close ();
}
void
@@ -354,30 +354,30 @@ ConfManager::create_default_config_file (std::ostream &a_ostream)
" <logstreamtype value=\"stdout\"/>\n"
" <logfile>/tmp/nemiver.log</logfile>\n"
" </logging>\n"
- "</config>\n" ;
- THROW_IF_FAIL (a_ostream.good ()) ;
+ "</config>\n";
+ THROW_IF_FAIL (a_ostream.good ());
}
void
ConfManager::init ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- static bool initialized=false ;
+ static bool initialized=false;
if (initialized)
- return ;
+ return;
const char* configfile (g_getenv ("nemiverconfigfile"));
if (configfile) {
- parse_config_file (configfile) ;
+ parse_config_file (configfile);
} else if (file_test ("nemiver.conf", FILE_TEST_IS_REGULAR)) {
- parse_config_file ("nemiver.conf") ;
+ parse_config_file ("nemiver.conf");
} else {
- parse_user_config_file () ;
+ parse_user_config_file ();
}
- initialized = true ;
+ initialized = true;
}
}//end namespace common
diff --git a/src/common/nmv-conf-manager.h b/src/common/nmv-conf-manager.h
index 922c466..be56262 100644
--- a/src/common/nmv-conf-manager.h
+++ b/src/common/nmv-conf-manager.h
@@ -33,30 +33,30 @@
namespace nemiver {
namespace common {
-class ConfManager ;
-class Config ;
-class UString ;
-struct ConfigPriv ;
+class ConfManager;
+class Config;
+class UString;
+struct ConfigPriv;
-typedef SafePtr<Config, ObjectRef, ObjectUnref> ConfigSafePtr ;
+typedef SafePtr<Config, ObjectRef, ObjectUnref> ConfigSafePtr;
class NEMIVER_API Config : public Object
{
- friend class ConfManager ;
- friend class ConfigPriv ;
+ friend class ConfManager;
+ friend class ConfigPriv;
- ConfigPriv *m_priv ;
+ ConfigPriv *m_priv;
- Config () ;
- Config (const Config &) ;
- Config& operator= (const Config &) ;
- virtual ~Config () ;
+ Config ();
+ Config (const Config &);
+ Config& operator= (const Config &);
+ virtual ~Config ();
public:
- bool get_property (const UString &a_name, UString &a_value) ;
- void set_property (const UString a_name, const UString a_value) ;
+ bool get_property (const UString &a_name, UString &a_value);
+ void set_property (const UString a_name, const UString a_value);
}
;//end class Config
@@ -64,29 +64,29 @@ public:
class NEMIVER_API ConfManager
{
//forbid instantiation/copy/assignation
- ConfManager () ;
- ConfManager (const ConfManager &) ;
- ConfManager& operator= (const ConfManager &) ;
+ ConfManager ();
+ ConfManager (const ConfManager &);
+ ConfManager& operator= (const ConfManager &);
- static void set_config (const Config &a_conf) ;
+ static void set_config (const Config &a_conf);
public:
- static Config& parse_config_file (const UString &a_path) ;
+ static Config& parse_config_file (const UString &a_path);
- static Config& parse_user_config_file (bool a_create_if_not_exist=true) ;
+ static Config& parse_user_config_file (bool a_create_if_not_exist=true);
static bool user_config_dir_exists ();
static const std::string& get_user_config_dir_path ();
- static void create_default_config_file (const UString a_path) ;
+ static void create_default_config_file (const UString a_path);
- static void create_default_config_file (std::ostream &a_ostream) ;
+ static void create_default_config_file (std::ostream &a_ostream);
- static void init () ;
+ static void init ();
- static Config& get_config () ;
+ static Config& get_config ();
};//end class ConfManager
}//end namespace common
diff --git a/src/common/nmv-connection-manager.cc b/src/common/nmv-connection-manager.cc
index 44186a5..360ccbd 100644
--- a/src/common/nmv-connection-manager.cc
+++ b/src/common/nmv-connection-manager.cc
@@ -37,7 +37,7 @@
#include "nmv-conf-manager.h"
#include "nmv-dynamic-module.h"
-using namespace nemiver::common ;
+using namespace nemiver::common;
namespace nemiver {
@@ -45,21 +45,21 @@ namespace common {
struct DBDriverDesc
{
- const common::UString driver_name ;
+ const common::UString driver_name;
const common::UString module_name;
};
static bool parse_connection_string (const common::UString &a_str,
- common::DBDesc &a_desc) ;
-static void load_db_driver_module (const common::DBDesc &a_desc) ;
+ common::DBDesc &a_desc);
+static void load_db_driver_module (const common::DBDesc &a_desc);
static common::IConnectionManagerDriverSafePtr get_connection_manager_driver
- (const common::DBDesc &) ;
+ (const common::DBDesc &);
static common::UString get_driver_module_name
- (const common::UString &a_driver_type) ;
+ (const common::UString &a_driver_type);
-static common::IConnectionManagerDriverSafePtr s_cnx_mgr_drv ;
+static common::IConnectionManagerDriverSafePtr s_cnx_mgr_drv;
-static common::UString s_db_type_loaded ;
+static common::UString s_db_type_loaded;
static DBDriverDesc s_supported_drivers [] = {
{"mysql", "org.nemiver.db.mysqldriver"},
@@ -70,12 +70,12 @@ static common::UString
get_driver_module_name (const common::UString &a_driver_name)
{
if (a_driver_name == "")
- return "" ;
- for (unsigned int i=0 ;
+ return "";
+ for (unsigned int i=0;
i < sizeof (s_supported_drivers)/sizeof (DBDriverDesc);
++i) {
if (a_driver_name == s_supported_drivers[i].driver_name) {
- return s_supported_drivers[i].module_name ;
+ return s_supported_drivers[i].module_name;
}
}
return "";
@@ -84,8 +84,8 @@ get_driver_module_name (const common::UString &a_driver_name)
static common::DynamicModuleManager&
get_module_manager ()
{
- static DynamicModuleManager s_manager ;
- return s_manager ;
+ static DynamicModuleManager s_manager;
+ return s_manager;
}
/// \brief parse a connection string.
@@ -108,9 +108,9 @@ parse_connection_string (const common::UString &a_str,
{
#define CHECK_INDEX(i) if ((i) >= a_str.size ()) {return false;}
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- common::UString::size_type i = 5 ;
- common::UString dbtypename, host, port, dbschemaname ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ common::UString::size_type i = 5;
+ common::UString dbtypename, host, port, dbschemaname;
//must start with 'vdbc:'
if (a_str.compare (0, 5, "vdbc:")) {
@@ -118,113 +118,113 @@ parse_connection_string (const common::UString &a_str,
}
//parse dbtypename
- bool parsed_dbtypename (false) ;
+ bool parsed_dbtypename (false);
if (!common::parsing_utils::is_alphabet_char (a_str[i])) {
return false;
}
- dbtypename += a_str[i++] ;
+ dbtypename += a_str[i++];
for (; i < a_str.size (); ++i) {
if (a_str[i] == ':') {
- parsed_dbtypename = true ;
- ++i ;
- CHECK_INDEX (i) ;
- break ;
+ parsed_dbtypename = true;
+ ++i;
+ CHECK_INDEX (i);
+ break;
}
if (common::parsing_utils::is_alnum (a_str[i]) || a_str[i] == '.') {
- dbtypename += a_str[i] ;
+ dbtypename += a_str[i];
}
}
if (!parsed_dbtypename) {
- return false ;
+ return false;
}
//now we must have "//"
- CHECK_INDEX (i) ;
- CHECK_INDEX (i + 1) ;
+ CHECK_INDEX (i);
+ CHECK_INDEX (i + 1);
if (!(a_str[i] == '/' && a_str[i + 1] == '/')) {
return false;
}
- i += 2 ;
+ i += 2;
- CHECK_INDEX (i) ;
+ CHECK_INDEX (i);
//now parse [HOST[:PORT]]
if (a_str[i] == '/') {
- goto parse_schemaname ;
+ goto parse_schemaname;
}
if (common::parsing_utils::is_host_name_char (a_str[i])) {
bool parsed_host (false);
- host += a_str[i] ;
- ++i ;
- CHECK_INDEX (i) ;
+ host += a_str[i];
+ ++i;
+ CHECK_INDEX (i);
//parse HOST
- for (; i < a_str.size () ; ++i) {
+ for (; i < a_str.size (); ++i) {
if (a_str[i] == ':') {
- ++i ;
- CHECK_INDEX (i) ;
- parsed_host = true ;
- goto parse_port ;
- } ;
+ ++i;
+ CHECK_INDEX (i);
+ parsed_host = true;
+ goto parse_port;
+ };
if (a_str[i] == '/') {
- ++i ;
- CHECK_INDEX (i) ;
- parsed_host= true ;
- goto parse_schemaname ;
+ ++i;
+ CHECK_INDEX (i);
+ parsed_host= true;
+ goto parse_schemaname;
}
if (common::parsing_utils::is_host_name_char (a_str[i])) {
- host += a_str[i] ;
+ host += a_str[i];
} else {
- return false ;
+ return false;
}
}
parse_port:
- bool parsed_port (false) ;
- for (; i < a_str.size () ; ++i) {
+ bool parsed_port (false);
+ for (; i < a_str.size (); ++i) {
if (a_str[i] == '/') {
parsed_port = true;
- ++i ;
- CHECK_INDEX (i) ;
- goto parse_schemaname ;
+ ++i;
+ CHECK_INDEX (i);
+ goto parse_schemaname;
}
if (common::parsing_utils::is_digit (a_str[i])) {
- port += a_str[i] ;
+ port += a_str[i];
} else {
- return false ;
+ return false;
}
}
if (!parsed_port) {
- return false ;
+ return false;
}
}
parse_schemaname:
- for (; i < a_str.size () ; ++i) {
+ for (; i < a_str.size (); ++i) {
if (common::parsing_utils::is_alnum (a_str[i])
|| a_str[i] == '_'
|| a_str[i] == '-'
|| a_str[i] == '.'
|| a_str[i] == '/') {
- dbschemaname += a_str[i] ;
+ dbschemaname += a_str[i];
} else {
- return false ;
+ return false;
}
}
- a_desc.set_type (dbtypename) ;
- a_desc.set_host (host) ;
- a_desc.set_port (atoi (port.c_str ())) ;
- a_desc.set_name (dbschemaname) ;
- return true ;
+ a_desc.set_type (dbtypename);
+ a_desc.set_host (host);
+ a_desc.set_port (atoi (port.c_str ()));
+ a_desc.set_name (dbschemaname);
+ return true;
}
static void
load_db_driver_module (const common::DBDesc &a_desc)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- common::UString driver_module_name = get_driver_module_name (a_desc.type ()) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ common::UString driver_module_name = get_driver_module_name (a_desc.type ());
if (driver_module_name == "") {
- THROW (UString ("database '") + a_desc.type () + "' is not supported") ;
+ THROW (UString ("database '") + a_desc.type () + "' is not supported");
}
s_cnx_mgr_drv =
@@ -232,33 +232,33 @@ load_db_driver_module (const common::DBDesc &a_desc)
(driver_module_name,
"IConnectionManagerDriver");
LOG_D ("cnx mgr refcount: " << (int) s_cnx_mgr_drv->get_refcount (),
- "refcount-domain") ;
+ "refcount-domain");
if (!s_cnx_mgr_drv) {
THROW (UString ("db driver module ")
+ driver_module_name
+ "does not implement the interface "
- "nemiver::common::IConnectinManagerDriver") ;
+ "nemiver::common::IConnectinManagerDriver");
}
- s_db_type_loaded = a_desc.type () ;
+ s_db_type_loaded = a_desc.type ();
}
static common::IConnectionManagerDriverSafePtr
get_connection_manager_driver (const common::DBDesc &a_db_desc)
{
if (!s_cnx_mgr_drv) {
- load_db_driver_module (a_db_desc) ;
+ load_db_driver_module (a_db_desc);
if (!s_cnx_mgr_drv) {
THROW ("could not load the driver for database: "
- + a_db_desc.type ()) ;
+ + a_db_desc.type ());
}
if (s_db_type_loaded != a_db_desc.type ()) {
THROW ("Loaded database driver mismatches with resqueted database. "
"Loaded: " + s_db_type_loaded +
- "; requested: " + a_db_desc.name ()) ;
+ "; requested: " + a_db_desc.name ());
}
}
- return s_cnx_mgr_drv ;
+ return s_cnx_mgr_drv;
}
void
@@ -267,24 +267,24 @@ ConnectionManager::create_db_connection (const common::UString &a_con_str,
const common::UString &a_pass,
Connection &a_connection)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
if (a_con_str == "") {
- THROW ("got connection string") ;
+ THROW ("got connection string");
}
- common::DBDesc db_desc ;
+ common::DBDesc db_desc;
if (!parse_connection_string (a_con_str, db_desc)) {
- THROW ("failed to parse connection string: " + a_con_str) ;
+ THROW ("failed to parse connection string: " + a_con_str);
}
common::IConnectionManagerDriverSafePtr driver =
- get_connection_manager_driver (db_desc) ;
- THROW_IF_FAIL (driver) ;
+ get_connection_manager_driver (db_desc);
+ THROW_IF_FAIL (driver);
common::IConnectionDriverSafePtr cnx_driver_iface =
- driver->connect_to_db (db_desc, a_user, a_pass) ;
- a_connection.set_connection_driver (cnx_driver_iface) ;
- a_connection.initialize () ;
+ driver->connect_to_db (db_desc, a_user, a_pass);
+ a_connection.set_connection_driver (cnx_driver_iface);
+ a_connection.initialize ();
}
ConnectionSafePtr
@@ -293,37 +293,37 @@ ConnectionManager::create_db_connection ()
common::UString connection_string, user, pass;
common::ConfManager::get_config ().get_property ("database.connection",
- connection_string) ;
- common::ConfManager::get_config ().get_property ("database.username", user) ;
- common::ConfManager::get_config ().get_property ("database.password", pass) ;
+ connection_string);
+ common::ConfManager::get_config ().get_property ("database.username", user);
+ common::ConfManager::get_config ().get_property ("database.password", pass);
if (connection_string == "") {
THROW ("Got connection string='';"
- " Conf manager is probably not initialized") ;
+ " Conf manager is probably not initialized");
}
- common::DBDesc db_desc ;
+ common::DBDesc db_desc;
if (!parse_connection_string (connection_string, db_desc)) {
- THROW ("failed to parse connection string: " + connection_string) ;
+ THROW ("failed to parse connection string: " + connection_string);
}
common::IConnectionManagerDriverSafePtr driver =
- get_connection_manager_driver (db_desc) ;
- THROW_IF_FAIL (driver) ;
+ get_connection_manager_driver (db_desc);
+ THROW_IF_FAIL (driver);
common::IConnectionDriverSafePtr cnx_driver_iface =
- driver->connect_to_db (db_desc, user, pass) ;
+ driver->connect_to_db (db_desc, user, pass);
- ConnectionSafePtr connection (new Connection ()) ;
- connection->set_connection_driver (cnx_driver_iface) ;
- connection->initialize () ;
+ ConnectionSafePtr connection (new Connection ());
+ connection->set_connection_driver (cnx_driver_iface);
+ connection->initialize ();
- return connection ;
+ return connection;
}
const char*
ConnectionManager::get_db_type ()
{
- return s_db_type_loaded.c_str () ;
+ return s_db_type_loaded.c_str ();
}
}//end namespace common nemiver
diff --git a/src/common/nmv-connection-manager.h b/src/common/nmv-connection-manager.h
index 483ce2a..de588da 100644
--- a/src/common/nmv-connection-manager.h
+++ b/src/common/nmv-connection-manager.h
@@ -33,7 +33,7 @@
namespace nemiver {
namespace common {
- class UString ;
+ class UString;
}
namespace common {
@@ -47,8 +47,8 @@ class NEMIVER_API ConnectionManager
{
//forbid instanciation
- ConnectionManager () ;
- ~ConnectionManager () ;
+ ConnectionManager ();
+ ~ConnectionManager ();
public:
@@ -64,18 +64,18 @@ public:
static void create_db_connection (const common::UString &a_connection_string,
const common::UString &a_user,
const common::UString &a_pass,
- Connection &a_connection) ;
+ Connection &a_connection);
/// \brief create a connection to the default database.
/// The default database is the one configured by the user
/// by filling the file nemiver.conf.
/// \return a smart pointer to a useable db connection. Throws
/// an Exception if it fails.
- static ConnectionSafePtr create_db_connection () ;
+ static ConnectionSafePtr create_db_connection ();
/// \brief get the type of database we are using.
/// \return a null terminated string that may be "mysql", "sqlite" etc ...
- static const char* get_db_type () ;
+ static const char* get_db_type ();
protected:
diff --git a/src/common/nmv-connection.cc b/src/common/nmv-connection.cc
index ebb2075..3a57155 100644
--- a/src/common/nmv-connection.cc
+++ b/src/common/nmv-connection.cc
@@ -28,15 +28,15 @@
#include "nmv-exception.h"
#include "nmv-buffer.h"
-using namespace nemiver::common ;
+using namespace nemiver::common;
namespace nemiver {
namespace common {
struct ConnectionPriv {
- SafePtr <common::IConnectionDriver, ObjectRef, ObjectUnref> driver_iface ;
- bool initialized ;
- Glib::Mutex mutex ;
+ SafePtr <common::IConnectionDriver, ObjectRef, ObjectUnref> driver_iface;
+ bool initialized;
+ Glib::Mutex mutex;
ConnectionPriv () :
driver_iface (NULL), initialized (false)
@@ -48,141 +48,141 @@ struct ConnectionPriv {
if (!initialized) {
THROW ("Connection Driver not initialized");
}
- return *driver_iface ;
+ return *driver_iface;
}
};
void
Connection::set_connection_driver (const common::IConnectionDriverSafePtr &a_driver)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->driver_iface = a_driver ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->driver_iface = a_driver;
}
void
Connection::initialize ()
{
- m_priv->initialized = true ;
+ m_priv->initialized = true;
}
void
Connection::deinitialize ()
{
- m_priv->initialized = false ;
+ m_priv->initialized = false;
}
Connection::Connection ()
{
- m_priv = new ConnectionPriv () ;
+ m_priv = new ConnectionPriv ();
}
Connection::Connection (const Connection &a_con) :
Object (a_con)
{
- m_priv = new ConnectionPriv () ;
- m_priv->driver_iface = a_con.m_priv->driver_iface ;
- m_priv->initialized = a_con.m_priv->initialized ;
+ m_priv = new ConnectionPriv ();
+ m_priv->driver_iface = a_con.m_priv->driver_iface;
+ m_priv->initialized = a_con.m_priv->initialized;
}
Connection&
Connection::operator= (const Connection &a_con)
{
if (this == &a_con) {
- return *this ;
+ return *this;
}
- m_priv->driver_iface = a_con.m_priv->driver_iface ;
- m_priv->initialized = a_con.m_priv->initialized ;
- return *this ;
+ m_priv->driver_iface = a_con.m_priv->driver_iface;
+ m_priv->initialized = a_con.m_priv->initialized;
+ return *this;
}
bool
Connection::is_initialized () const
{
- return m_priv->initialized ;
+ return m_priv->initialized;
}
Connection::~Connection ()
{
if (!m_priv) {
- return ;
+ return;
}
- close () ;
- delete m_priv ;
- m_priv = NULL ;
+ close ();
+ delete m_priv;
+ m_priv = NULL;
}
const char*
Connection::get_last_error () const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().get_last_error () ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().get_last_error ();
}
bool
Connection::start_transaction ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- return m_priv->get_driver ().start_transaction () ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->get_driver ().start_transaction ();
}
bool
Connection::commit_transaction ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().commit_transaction () ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().commit_transaction ();
}
bool
Connection::rollback_transaction ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().rollback_transaction () ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().rollback_transaction ();
}
bool
Connection::execute_statement (const common::SQLStatement &a_statement)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().execute_statement (a_statement) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().execute_statement (a_statement);
}
bool
Connection::should_have_data () const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().should_have_data () ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().should_have_data ();
}
bool
Connection::read_next_row ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
if (!should_have_data ()) {
- return false ;
+ return false;
}
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().read_next_row () ;
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().read_next_row ();
}
unsigned long
Connection::get_number_of_columns ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().get_number_of_columns () ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().get_number_of_columns ();
}
@@ -190,9 +190,9 @@ bool
Connection::get_column_type (unsigned long a_offset,
enum common::ColumnType &a_type)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
return m_priv->get_driver ().get_column_type (a_offset, a_type);
}
@@ -200,19 +200,19 @@ bool
Connection::get_column_name (unsigned long a_offset,
common::Buffer &a_name)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
- return m_priv->get_driver ().get_column_name (a_offset, a_name) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
+ return m_priv->get_driver ().get_column_name (a_offset, a_name);
}
bool
Connection::get_column_content (unsigned long a_offset,
common::Buffer &a_column_content)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
return m_priv->get_driver ().get_column_content
(a_offset, a_column_content);
}
@@ -221,9 +221,9 @@ bool
Connection::get_column_content (gulong a_offset,
gint64 &a_column_content)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
return m_priv->get_driver ().get_column_content
(a_offset, a_column_content);
}
@@ -232,9 +232,9 @@ bool
Connection::get_column_content (gulong a_offset,
double& a_column_content)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
return m_priv->get_driver ().get_column_content
(a_offset, a_column_content);
}
@@ -243,9 +243,9 @@ bool
Connection::get_column_content (gulong a_offset,
UString& a_column_content)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- Glib::Mutex::Lock lock (m_priv->mutex) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ Glib::Mutex::Lock lock (m_priv->mutex);
return m_priv->get_driver ().get_column_content
(a_offset, a_column_content);
}
@@ -253,17 +253,17 @@ Connection::get_column_content (gulong a_offset,
void
Connection::close ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
//successive calls to this method
//should never "fail".
- Glib::Mutex::Lock lock (m_priv->mutex) ;
+ Glib::Mutex::Lock lock (m_priv->mutex);
if (m_priv->driver_iface) {
- m_priv->driver_iface->close () ;
+ m_priv->driver_iface->close ();
}
- deinitialize () ;
- LOG_D ("delete", "destructor-domain") ;
+ deinitialize ();
+ LOG_D ("delete", "destructor-domain");
}
}//end namespace common
diff --git a/src/common/nmv-connection.h b/src/common/nmv-connection.h
index cdd1087..9fffbc6 100644
--- a/src/common/nmv-connection.h
+++ b/src/common/nmv-connection.h
@@ -33,8 +33,8 @@
namespace nemiver {
namespace common {
-class UString ;
-class Buffer ;
+class UString;
+class Buffer;
}
namespace common {
@@ -43,57 +43,57 @@ class SQLStatement;
namespace common {
-class ResultSetDataReader ;
-struct ConnectionPriv ;
+class ResultSetDataReader;
+struct ConnectionPriv;
class NEMIVER_API Connection : public common::Object
{
- friend struct ConnectionPriv ;
- friend class ConnectionManager ;
- ConnectionPriv *m_priv ;
+ friend struct ConnectionPriv;
+ friend class ConnectionManager;
+ ConnectionPriv *m_priv;
- void set_connection_driver (const common::IConnectionDriverSafePtr &a_driver) ;
- void initialize () ;
- void deinitialize () ;
+ void set_connection_driver (const common::IConnectionDriverSafePtr &a_driver);
+ void initialize ();
+ void deinitialize ();
public:
- Connection () ;
+ Connection ();
- Connection (const Connection &a_con) ;
+ Connection (const Connection &a_con);
- Connection& operator= (const Connection &a_con) ;
+ Connection& operator= (const Connection &a_con);
- bool is_initialized () const ;
+ bool is_initialized () const;
- virtual ~Connection () ;
+ virtual ~Connection ();
- const char* get_last_error () const ;
+ const char* get_last_error () const;
- bool start_transaction () ;
+ bool start_transaction ();
- bool commit_transaction () ;
+ bool commit_transaction ();
- bool rollback_transaction () ;
+ bool rollback_transaction ();
- bool execute_statement (const common::SQLStatement &a_statement) ;
+ bool execute_statement (const common::SQLStatement &a_statement);
- bool should_have_data () const ;
+ bool should_have_data () const;
- bool read_next_row () ;
+ bool read_next_row ();
- unsigned long get_number_of_columns () ;
+ unsigned long get_number_of_columns ();
bool get_column_type (unsigned long a_offset,
- enum common::ColumnType &) ;
+ enum common::ColumnType &);
- bool get_column_name (unsigned long a_offset, common::Buffer &a_name) ;
+ bool get_column_name (unsigned long a_offset, common::Buffer &a_name);
bool get_column_content (unsigned long a_offset,
- common::Buffer &a_field_content) ;
+ common::Buffer &a_field_content);
bool get_column_content (gulong a_offset,
- gint64 &a_column_content) ;
+ gint64 &a_column_content);
bool get_column_content (gulong a_offset,
double& a_column_content);
@@ -101,12 +101,12 @@ public:
bool get_column_content (gulong a_offset,
common::UString& a_column_content);
- void close () ;
+ void close ();
};//end Connection
typedef common::SafePtr<Connection,
common::ObjectRef,
- common::ObjectUnref> ConnectionSafePtr ;
+ common::ObjectUnref> ConnectionSafePtr;
}//end namespace common
}//end nemiver
diff --git a/src/common/nmv-date-utils.cc b/src/common/nmv-date-utils.cc
index bf26172..66013c4 100644
--- a/src/common/nmv-date-utils.cc
+++ b/src/common/nmv-date-utils.cc
@@ -38,29 +38,29 @@ namespace dateutils {
time_t
get_current_datetime ()
{
- struct timeval tv ;
- memset (&tv, 0, sizeof (tv)) ;
- gettimeofday (&tv, NULL) ;
- return tv.tv_sec ;
+ struct timeval tv;
+ memset (&tv, 0, sizeof (tv));
+ gettimeofday (&tv, NULL);
+ return tv.tv_sec;
}
void
get_current_datetime (struct tm &a_tm)
{
- time_t now = get_current_datetime () ;
- gmtime_r (&now, &a_tm) ;
+ time_t now = get_current_datetime ();
+ gmtime_r (&now, &a_tm);
}
void
get_current_datetime (UString &a_datetime)
{
- struct tm now ;
- memset (&now, 0, sizeof (now)) ;
+ struct tm now;
+ memset (&now, 0, sizeof (now));
- get_current_datetime (now) ;
- char now_str[21] = {0} ;
- strftime (now_str, 20, "%Y-%m-%d %H:%M:%S", &now) ;
- a_datetime = now_str ;
+ get_current_datetime (now);
+ char now_str[21] = {0};
+ strftime (now_str, 20, "%Y-%m-%d %H:%M:%S", &now);
+ a_datetime = now_str;
}
}//end namespace dateutils
diff --git a/src/common/nmv-date-utils.h b/src/common/nmv-date-utils.h
index d383fdd..de6c352 100644
--- a/src/common/nmv-date-utils.h
+++ b/src/common/nmv-date-utils.h
@@ -36,14 +36,14 @@
namespace nemiver {
namespace common {
-class UString ;
+class UString;
namespace dateutils
{
-time_t NEMIVER_API get_current_datetime () ;
-void NEMIVER_API get_current_datetime (struct tm &a_tm) ;
-void NEMIVER_API get_current_datetime (UString &a_datetime) ;
+time_t NEMIVER_API get_current_datetime ();
+void NEMIVER_API get_current_datetime (struct tm &a_tm);
+void NEMIVER_API get_current_datetime (UString &a_datetime);
}//end namespace dateutils
}//end namespace common
diff --git a/src/common/nmv-delete-statement.cc b/src/common/nmv-delete-statement.cc
index 35208e6..445d9c8 100644
--- a/src/common/nmv-delete-statement.cc
+++ b/src/common/nmv-delete-statement.cc
@@ -27,16 +27,16 @@
#include "nmv-exception.h"
#include "nmv-delete-statement.h"
-using namespace nemiver::common ;
+using namespace nemiver::common;
namespace nemiver {
namespace common {
struct DeleteStatementPriv
{
- UString table_name ;
- ColumnList where_cols ;
- UString string_repr ;
+ UString table_name;
+ ColumnList where_cols;
+ UString string_repr;
DeleteStatementPriv (const UString &a_table_name,
ColumnList &a_where_cols):
@@ -51,48 +51,48 @@ struct DeleteStatementPriv
DeleteStatement::DeleteStatement (const UString &a_table_name,
ColumnList &a_where_columns)
{
- m_priv = new DeleteStatementPriv (a_table_name, a_where_columns) ;
+ m_priv = new DeleteStatementPriv (a_table_name, a_where_columns);
}
DeleteStatement::~DeleteStatement ()
{
if (m_priv) {
- delete m_priv ;
- m_priv = NULL ;
+ delete m_priv;
+ m_priv = NULL;
}
}
const UString&
DeleteStatement::to_string () const
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
RETURN_VAL_IF_FAIL (m_priv->table_name != "",
- m_priv->string_repr) ;
+ m_priv->string_repr);
- UString str, where_list ;
+ UString str, where_list;
if (m_priv->string_repr == "") {
for (ColumnList::iterator it = m_priv->where_cols.begin ();
it != m_priv->where_cols.end ();
++it) {
if (where_list.size ()) {
- where_list += ", " ;
+ where_list += ", ";
}
- where_list += it->get_name () + "='" + it->get_value () + "'" ;
+ where_list += it->get_name () + "='" + it->get_value () + "'";
}
- str = "delete from " + m_priv->table_name ;
+ str = "delete from " + m_priv->table_name;
if (where_list != "") {
- str += " where " + where_list ;
+ str += " where " + where_list;
}
- m_priv->string_repr = str ;
+ m_priv->string_repr = str;
}
- return m_priv->string_repr ;
+ return m_priv->string_repr;
}
const ColumnList&
DeleteStatement::get_where_columns () const
{
- return m_priv->where_cols ;
+ return m_priv->where_cols;
}
}//end namespace common
diff --git a/src/common/nmv-delete-statement.h b/src/common/nmv-delete-statement.h
index 7044ed0..e1c6f1e 100644
--- a/src/common/nmv-delete-statement.h
+++ b/src/common/nmv-delete-statement.h
@@ -31,26 +31,26 @@
namespace nemiver {
namespace common {
-struct DeleteStatementPriv ;
+struct DeleteStatementPriv;
class NEMIVER_API DeleteStatement : public SQLStatement
{
- friend struct DeleteStatementPriv ;
+ friend struct DeleteStatementPriv;
- DeleteStatementPriv *m_priv ;
+ DeleteStatementPriv *m_priv;
//forbid copy/assignation
- DeleteStatement (const DeleteStatement &) ;
- DeleteStatement& operator= (const DeleteStatement &) ;
+ DeleteStatement (const DeleteStatement &);
+ DeleteStatement& operator= (const DeleteStatement &);
public:
DeleteStatement (const common::UString &a_table_name,
- ColumnList &a_where_columns) ;
+ ColumnList &a_where_columns);
- ~DeleteStatement () ;
+ ~DeleteStatement ();
- const common::UString& to_string () const ;
+ const common::UString& to_string () const;
- const ColumnList& get_where_columns () const ;
+ const ColumnList& get_where_columns () const;
};//end class DeleteStatement
}//end namespace common
diff --git a/src/common/nmv-dynamic-module.cc b/src/common/nmv-dynamic-module.cc
index 0a5caa6..3535d68 100644
--- a/src/common/nmv-dynamic-module.cc
+++ b/src/common/nmv-dynamic-module.cc
@@ -37,15 +37,15 @@
#include "nmv-libxml-utils.h"
#include "nmv-env.h"
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
struct ModuleRegistry::Priv {
- map<std::string, DynamicModule::ConfigSafePtr> config_map ;
- Glib::Mutex cache_mutex ;
- map<UString, GModule*> library_cache ;
+ map<std::string, DynamicModule::ConfigSafePtr> config_map ;
+ Glib::Mutex cache_mutex;
+ map<UString, GModule*> library_cache ;
};//end ModuleRegistry::Priv
ModuleRegistry::ModuleRegistry () :
@@ -62,27 +62,27 @@ ModuleRegistry::get_library_from_cache (const UString a_name)
{
GModule *module (0);
std::map<UString, GModule*>::iterator it =
- m_priv->library_cache.find (a_name) ;
+ m_priv->library_cache.find (a_name);
if (it != m_priv->library_cache.end ()) {
- module = it->second ;
+ module = it->second;
}
- return module ;
+ return module;
}
void
ModuleRegistry::put_library_into_cache (const UString a_name,
GModule *a_library)
{
- THROW_IF_FAIL (a_name != "") ;
- Glib::Mutex::Lock lock (m_priv->cache_mutex) ;
+ THROW_IF_FAIL (a_name != "");
+ Glib::Mutex::Lock lock (m_priv->cache_mutex);
m_priv->library_cache[a_name] = a_library;
}
struct DynamicModule::Loader::Priv {
- vector<UString> config_search_paths ;
- map<std::string, DynamicModule::ConfigSafePtr> config_map ;
- vector<UString> module_library_path ;
- DynamicModuleManager * module_manager ;
+ vector<UString> config_search_paths;
+ map<std::string, DynamicModule::ConfigSafePtr> config_map ;
+ vector<UString> module_library_path;
+ DynamicModuleManager * module_manager;
Priv () :
module_manager (0)
@@ -104,25 +104,25 @@ DynamicModule::Loader::~Loader ()
void
DynamicModule::Loader::set_dynamic_module_manager (DynamicModuleManager *a_mgr)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->module_manager = a_mgr ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->module_manager = a_mgr;
}
DynamicModuleManager*
DynamicModule::Loader::get_dynamic_module_manager ()
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->module_manager ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->module_manager;
}
DynamicModule::ConfigSafePtr
DynamicModule::Loader::module_config (const string &a_module_name)
{
- ConfigSafePtr result ;
+ ConfigSafePtr result;
if (a_module_name == "") {return result;}
map<string, ConfigSafePtr>::iterator iter =
- m_priv->config_map.find (a_module_name) ;
+ m_priv->config_map.find (a_module_name);
if (iter == m_priv->config_map.end ()) {
//we didn't find the module config in config cache.
//Let's walk the module conf paths
@@ -130,28 +130,28 @@ DynamicModule::Loader::module_config (const string &a_module_name)
for (vector<UString>::const_iterator it = config_search_paths ().begin ();
it != config_search_paths ().end ();
++it) {
- vector<string> path_elements ;
- path_elements.push_back (it->c_str ()) ;
- path_elements.push_back (a_module_name + ".conf") ;
- string path = Glib::build_filename (path_elements) ;
+ vector<string> path_elements;
+ path_elements.push_back (it->c_str ());
+ path_elements.push_back (a_module_name + ".conf");
+ string path = Glib::build_filename (path_elements);
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {continue;}
- result = parse_module_config_file (path.c_str ()) ;
+ result = parse_module_config_file (path.c_str ());
if (!result) {return result;}
- m_priv->config_map[a_module_name] = result ;
- break ;
+ m_priv->config_map[a_module_name] = result;
+ break;
}
} else {
- result = iter->second ;
+ result = iter->second;
}
- return result ;
+ return result;
}
vector<UString>&
DynamicModule::Loader::config_search_paths ()
{
- return m_priv->config_search_paths ;
+ return m_priv->config_search_paths;
}
UString
@@ -159,157 +159,157 @@ DynamicModule::Loader::build_library_path (const UString &a_module_name,
const UString &a_lib_name)
{
DynamicModule::ConfigSafePtr mod_conf = module_config (a_module_name);
- THROW_IF_FAIL (mod_conf) ;
+ THROW_IF_FAIL (mod_conf);
- UString path ;
- vector<UString>::iterator it, end ;
- vector<UString> search_path ;
+ UString path;
+ vector<UString>::iterator it, end;
+ vector<UString> search_path;
if (mod_conf->custom_library_search_paths.size ()) {
- it = mod_conf->custom_library_search_paths.begin () ;
- end = mod_conf->custom_library_search_paths.end () ;
+ it = mod_conf->custom_library_search_paths.begin ();
+ end = mod_conf->custom_library_search_paths.end ();
} else {
- it = config_search_paths ().begin () ;
- end = config_search_paths ().end () ;
+ it = config_search_paths ().begin ();
+ end = config_search_paths ().end ();
}
- for (; it != end ; ++it) {
+ for (; it != end; ++it) {
LOG_D ("in directory '" << Glib::locale_from_utf8 (*it) << "' ...",
- "module-loading-domain") ;
+ "module-loading-domain");
common::GCharSafePtr system_lib_path
- (g_module_build_path (it->c_str (), a_lib_name.c_str ())) ;
+ (g_module_build_path (it->c_str (), a_lib_name.c_str ()));
LOG_D ("looking for library '" << Glib::locale_from_utf8 (system_lib_path.get ()),
- "module-loading-domain") ;
+ "module-loading-domain");
if (Glib::file_test (Glib::filename_from_utf8 (system_lib_path.get ()),
Glib::FILE_TEST_EXISTS)) {
- return system_lib_path.get () ;
+ return system_lib_path.get ();
}
}
- LOG ("Could not find library " + a_lib_name) ;
- return "" ;
+ LOG ("Could not find library " + a_lib_name);
+ return "";
}
DynamicModule::ConfigSafePtr
DynamicModule::Loader::parse_module_config_file (const UString &a_path)
{
if (a_path == "") {
- THROW ("Got path \"\" to modules config file") ;
+ THROW ("Got path \"\" to modules config file");
}
- using libxmlutils::XMLTextReaderSafePtr ;
- using libxmlutils::XMLCharSafePtr ;
- XMLTextReaderSafePtr reader ;
- UString name ;
- libxmlutils::XMLCharSafePtr xml_str ;
+ using libxmlutils::XMLTextReaderSafePtr;
+ using libxmlutils::XMLCharSafePtr;
+ XMLTextReaderSafePtr reader;
+ UString name;
+ libxmlutils::XMLCharSafePtr xml_str;
- reader.reset (xmlNewTextReaderFilename (a_path.c_str ())) ;
+ reader.reset (xmlNewTextReaderFilename (a_path.c_str ()));
if (!reader) {
- THROW ("could not create xml reader") ;
+ THROW ("could not create xml reader");
}
if (!goto_next_element_node_and_check (reader, "moduleconfig")) {
THROW ("modules config file "
- + a_path + " root element must be 'moduleconfig'") ;
+ + a_path + " root element must be 'moduleconfig'");
}
- UString module_name, library_name ;
- DynamicModule::ConfigSafePtr config (new Config) ;
+ UString module_name, library_name;
+ DynamicModule::ConfigSafePtr config (new Config);
if (!goto_next_element_node_and_check (reader, "module")) {
- THROW ("expected 'module' node as child of 'moduleconfig' node") ;
+ THROW ("expected 'module' node as child of 'moduleconfig' node");
}
if (!goto_next_element_node_and_check (reader, "name")) {
- THROW ("expected 'name' node as child of 'module' node") ;
+ THROW ("expected 'name' node as child of 'module' node");
}
- xml_str.reset (xmlTextReaderReadString (reader.get ())) ;
- module_name = reinterpret_cast<const char*> (xml_str.get ()) ;
+ xml_str.reset (xmlTextReaderReadString (reader.get ()));
+ module_name = reinterpret_cast<const char*> (xml_str.get ());
if (!goto_next_element_node_and_check (reader, "libraryname")) {
THROW ("expected 'libraryname' node as second child "
- "of 'module' node") ;
+ "of 'module' node");
}
- xml_str.reset (xmlTextReaderReadString (reader.get ())) ;
- library_name = reinterpret_cast<const char*> (xml_str.get ()) ;
+ xml_str.reset (xmlTextReaderReadString (reader.get ()));
+ library_name = reinterpret_cast<const char*> (xml_str.get ());
if (module_name != "" && library_name != "") {
- config->library_name = library_name ;
+ config->library_name = library_name;
}
- module_name = library_name = "" ;
+ module_name = library_name = "";
if (!goto_next_element_node_and_check (reader, "customsearchpaths")) {
THROW ("expected 'customsearchpaths' after moduleconfig"
- "of 'module' node") ;
+ "of 'module' node");
}
UString path;
name = reinterpret_cast<const char*> (xmlTextReaderConstName (reader.get ()));
if (name == "customsearchpaths") {
for (;;) {
if (goto_next_element_node_and_check (reader, "path")) {
- xml_str.reset (xmlTextReaderReadString (reader.get ())) ;
- path = reinterpret_cast<const char*> (xml_str.get ()) ;
+ xml_str.reset (xmlTextReaderReadString (reader.get ()));
+ path = reinterpret_cast<const char*> (xml_str.get ());
if (path != "") {
- config->custom_library_search_paths.push_back (path) ;
+ config->custom_library_search_paths.push_back (path);
}
} else {
- break ;
+ break;
}
}
}
- return config ;
+ return config;
}
UString
DynamicModule::Loader::module_library_path (const UString &a_module_name)
{
- UString library_name, library_path ;
- DynamicModule::ConfigSafePtr mod_conf = module_config (a_module_name) ;
+ UString library_name, library_path;
+ DynamicModule::ConfigSafePtr mod_conf = module_config (a_module_name);
THROW_IF_FAIL2 (mod_conf,
UString ("couldn't get module config for module ")
- + a_module_name) ;
+ + a_module_name);
//***********************************************
//get the library name from the module names map
//***********************************************
- library_name = mod_conf->library_name ;
- library_path = build_library_path (a_module_name, library_name) ;
- return library_path ;
+ library_name = mod_conf->library_name;
+ library_path = build_library_path (a_module_name, library_name);
+ return library_path;
}
GModule*
DynamicModule::Loader::load_library_from_path (const UString &a_library_path)
{
if (!g_module_supported ()) {
- THROW ("We don't support dynamic modules on this platform") ;
+ THROW ("We don't support dynamic modules on this platform");
}
GModule *module = g_module_open (a_library_path.c_str (),
- static_cast<GModuleFlags> (G_MODULE_BIND_LAZY)) ;
+ static_cast<GModuleFlags> (G_MODULE_BIND_LAZY));
if (!module) {
THROW (UString ("failed to load shared library ") + a_library_path
- + ": " + Glib::locale_from_utf8 (g_module_error ())) ;
+ + ": " + Glib::locale_from_utf8 (g_module_error ()));
}
g_module_make_resident (module);//we don't want to unload a module for now
LOG_D ("loaded module at path: " << Glib::locale_from_utf8 (a_library_path),
- "module-loading-domain") ;
- return module ;
+ "module-loading-domain");
+ return module;
}
GModule*
DynamicModule::Loader::load_library_from_module_name (const UString &a_name)
{
- UString library_path = module_library_path (a_name) ;
+ UString library_path = module_library_path (a_name);
if (library_path == "") {
- THROW ("Couldn't find library for module " + a_name) ;
+ THROW ("Couldn't find library for module " + a_name);
}
- GModule *lib = load_library_from_path (library_path) ;
+ GModule *lib = load_library_from_path (library_path);
if (!lib) {
- THROW (UString ("failed to load shared library ") + library_path) ;
+ THROW (UString ("failed to load shared library ") + library_path);
}
- LOG_D ("loaded module " << Glib::locale_from_utf8 (a_name), "module-loading-domain") ;
+ LOG_D ("loaded module " << Glib::locale_from_utf8 (a_name), "module-loading-domain");
return lib;
}
DynamicModuleSafePtr
DynamicModule::Loader::create_dynamic_module_instance (GModule *a_module)
{
- THROW_IF_FAIL (a_module) ;
+ THROW_IF_FAIL (a_module);
//***********************************************
//get a pointer on the factory function exposes by
@@ -322,7 +322,7 @@ DynamicModule::Loader::create_dynamic_module_instance (GModule *a_module)
THROW (UString ("The library ")
+ g_module_name (a_module)
+ " doesn't export the symbol "
- "nemiver_common_create_dynamic_module_instance") ;
+ "nemiver_common_create_dynamic_module_instance");
}
//**************************************************
@@ -330,65 +330,65 @@ DynamicModule::Loader::create_dynamic_module_instance (GModule *a_module)
//nemiver::common::DynamicModule
//**************************************************
DynamicModule *loadable_module (NULL);
- ((bool (*) (void**)) factory_function) ((void**) &loadable_module) ;
+ ((bool (*) (void**)) factory_function) ((void**) &loadable_module);
if (!loadable_module) {
THROW (UString ("The instance factory of module ")
+ g_module_name (a_module)
- + " returned a NULL instance pointer of LoadableModle") ;
+ + " returned a NULL instance pointer of LoadableModle");
}
- DynamicModuleSafePtr safe_ptr (loadable_module) ;
+ DynamicModuleSafePtr safe_ptr (loadable_module);
if (!dynamic_cast<DynamicModule*> (loadable_module)) {
//this causes a memory leak because we can't destroy loadable module
//as we don't know its actual type.
THROW (UString ("The instance factory of module ")
+ g_module_name (a_module)
- + " didn't return an instance of DynamicModule") ;
+ + " didn't return an instance of DynamicModule");
}
//**********************************************
//return a safe pointer DynamicModuleSafePtr
//**********************************************
- LOG_REF_COUNT (safe_ptr, g_module_name (a_module)) ;
- return safe_ptr ;
+ LOG_REF_COUNT (safe_ptr, g_module_name (a_module));
+ return safe_ptr;
}
DynamicModuleSafePtr
DynamicModule::Loader::load (const UString &a_name)
{
- GModule *lib (0) ;
- lib = load_library_from_module_name (a_name) ;
+ GModule *lib (0);
+ lib = load_library_from_module_name (a_name);
if (!lib) {
LOG ("could not load the dynamic library of the dynmod '" +a_name+ "'");
return DynamicModuleSafePtr (0);
}
- DynamicModuleSafePtr result (create_dynamic_module_instance (lib)) ;
+ DynamicModuleSafePtr result (create_dynamic_module_instance (lib));
if (result) {
- result->set_module_loader (this) ;
+ result->set_module_loader (this);
}
- return result ;
+ return result;
}
DynamicModuleSafePtr
DynamicModule::Loader::load_from_path (const UString &a_lib_path)
{
- GModule *lib (0) ;
- lib = load_library_from_path (a_lib_path) ;
+ GModule *lib (0);
+ lib = load_library_from_path (a_lib_path);
if (!lib) {
LOG ("could not load the dynamic library of the dynmod '"
+a_lib_path+ "'");
return DynamicModuleSafePtr (0);
}
- LOG_D ("loaded module from path: "<< Glib::locale_from_utf8 (a_lib_path), "module-loading-domain") ;
- return create_dynamic_module_instance (lib) ;
+ LOG_D ("loaded module from path: "<< Glib::locale_from_utf8 (a_lib_path), "module-loading-domain");
+ return create_dynamic_module_instance (lib);
}
class DefaultModuleLoader : public DynamicModule::Loader {
- //non copyable ;
- DefaultModuleLoader (const DefaultModuleLoader &) ;
- DefaultModuleLoader& operator= (const DefaultModuleLoader &) ;
+ //non copyable;
+ DefaultModuleLoader (const DefaultModuleLoader &);
+ DefaultModuleLoader& operator= (const DefaultModuleLoader &);
public:
DefaultModuleLoader () {};
@@ -396,9 +396,9 @@ public:
};//end DefaultLoader
struct DynamicModule::Priv {
- UString real_library_path ;
+ UString real_library_path;
UString name;
- DynamicModule::Loader *loader ;
+ DynamicModule::Loader *loader;
Priv () :
loader (NULL)
@@ -412,62 +412,62 @@ DynamicModule::DynamicModule () :
DynamicModule::~DynamicModule ()
{
- LOG_D ("deleted", "destructor-domain") ;
+ LOG_D ("deleted", "destructor-domain");
}
const UString&
DynamicModule::get_real_library_path () const
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->real_library_path ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->real_library_path;
}
void
DynamicModule::set_real_library_path (const UString &a_path)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->real_library_path = a_path ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->real_library_path = a_path;
}
void
DynamicModule::set_name (const UString &a_name)
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
m_priv->name = a_name;
}
const UString&
DynamicModule::get_name () const
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
return m_priv->name;
}
void
DynamicModule::set_module_loader (DynamicModule::Loader *a_loader)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->loader = a_loader ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->loader = a_loader;
}
DynamicModule::Loader*
DynamicModule::get_module_loader ()
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->loader ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->loader;
}
struct DynamicModuleManager::Priv {
- ModuleRegistry registry ;
- DynamicModule::LoaderSafePtr loader ;
+ ModuleRegistry registry;
+ DynamicModule::LoaderSafePtr loader;
DynamicModule::LoaderSafePtr
get_module_loader ()
{
if (!loader) {
- loader.reset (new DefaultModuleLoader) ;
+ loader.reset (new DefaultModuleLoader);
}
- THROW_IF_FAIL (loader) ;
- return loader ;
+ THROW_IF_FAIL (loader);
+ return loader;
}
};//end struct DynamicModuleManager::Priv
@@ -484,13 +484,13 @@ DynamicModuleSafePtr
DynamicModuleManager::load_module (const UString &a_name,
DynamicModule::Loader &a_loader)
{
- GModule *lib = module_registry ().get_library_from_cache (a_name) ;
+ GModule *lib = module_registry ().get_library_from_cache (a_name);
if (!lib) {
//dll doesn't exist in library cache.
//try to load the dll from disk and put it in library cache.
- lib = a_loader.load_library_from_module_name (a_name) ;
+ lib = a_loader.load_library_from_module_name (a_name);
if (lib) {
- module_registry ().put_library_into_cache (a_name, lib) ;
+ module_registry ().put_library_into_cache (a_name, lib);
}
}
if (!lib) {
@@ -498,34 +498,34 @@ DynamicModuleManager::load_module (const UString &a_name,
("could not load the dynamic library of the dynmod '" +a_name+ "'");
return DynamicModuleSafePtr (0);
}
- DynamicModuleSafePtr module = a_loader.create_dynamic_module_instance (lib) ;
- THROW_IF_FAIL (module) ;
- LOG_REF_COUNT (module, a_name) ;
+ DynamicModuleSafePtr module = a_loader.create_dynamic_module_instance (lib);
+ THROW_IF_FAIL (module);
+ LOG_REF_COUNT (module, a_name);
- module->set_module_loader (&a_loader) ;
+ module->set_module_loader (&a_loader);
module->set_name (a_name);
module->set_real_library_path (a_loader.module_library_path (a_name));
- a_loader.set_dynamic_module_manager (this) ;
- LOG_REF_COUNT (module, a_name) ;
+ a_loader.set_dynamic_module_manager (this);
+ LOG_REF_COUNT (module, a_name);
LOG_D ("loaded module " << Glib::locale_from_utf8 (a_name),
- "module-loading-domain") ;
- return module ;
+ "module-loading-domain");
+ return module;
}
DynamicModuleSafePtr
DynamicModuleManager::load_module (const UString &a_name)
{
LOG_D ("loading module " << Glib::locale_from_utf8 (a_name),
- "module-loading-domain") ;
- return load_module (a_name, *module_loader ()) ;
+ "module-loading-domain");
+ return load_module (a_name, *module_loader ());
}
DynamicModuleManager&
DynamicModuleManager::get_default_manager ()
{
- static DynamicModuleManager s_default_dynmod_mgr ;
- return s_default_dynmod_mgr ;
+ static DynamicModuleManager s_default_dynmod_mgr;
+ return s_default_dynmod_mgr;
}
DynamicModuleSafePtr
@@ -533,29 +533,29 @@ DynamicModuleManager::load_module_with_default_manager
(const UString &a_mod_name,
DynamicModule::Loader &a_loader)
{
- return get_default_manager ().load_module (a_mod_name, a_loader) ;
+ return get_default_manager ().load_module (a_mod_name, a_loader);
}
DynamicModuleSafePtr
DynamicModuleManager::load_module_with_default_manager (const UString &a_mod_name)
{
- return get_default_manager ().load_module (a_mod_name) ;
+ return get_default_manager ().load_module (a_mod_name);
}
DynamicModuleSafePtr
DynamicModuleManager::load_module_from_path (const UString &a_library_path,
DynamicModule::Loader &a_loader)
{
- GModule *lib = a_loader.load_library_from_path (a_library_path) ;
+ GModule *lib = a_loader.load_library_from_path (a_library_path);
if (!lib) {
- LOG ("could not load dynamic library '" + a_library_path + "'") ;
+ LOG ("could not load dynamic library '" + a_library_path + "'");
return DynamicModuleSafePtr (0);
}
- a_loader.set_dynamic_module_manager (this) ;
- DynamicModuleSafePtr module = a_loader.create_dynamic_module_instance (lib) ;
- module->set_module_loader (&a_loader) ;
+ a_loader.set_dynamic_module_manager (this);
+ DynamicModuleSafePtr module = a_loader.create_dynamic_module_instance (lib);
+ module->set_module_loader (&a_loader);
LOG_D ("loaded module from path " << Glib::locale_from_utf8 (a_library_path),
- "module-loading-domain") ;
+ "module-loading-domain");
return module;
}
@@ -564,31 +564,31 @@ DynamicModuleSafePtr
DynamicModuleManager::load_module_from_path (const UString &a_library_path)
{
LOG_D ("loading module from path " << Glib::locale_from_utf8 (a_library_path),
- "module-loading-domain") ;
- return load_module_from_path (a_library_path, *module_loader ()) ;
+ "module-loading-domain");
+ return load_module_from_path (a_library_path, *module_loader ());
}
ModuleRegistry&
DynamicModuleManager::module_registry ()
{
- return m_priv->registry ;
+ return m_priv->registry;
}
DynamicModule::LoaderSafePtr&
DynamicModuleManager::module_loader ()
{
if (!m_priv->loader) {
- m_priv->loader.reset (new DefaultModuleLoader) ;
+ m_priv->loader.reset (new DefaultModuleLoader);
}
- THROW_IF_FAIL (m_priv->loader) ;
- return m_priv->loader ;
+ THROW_IF_FAIL (m_priv->loader);
+ return m_priv->loader;
}
void
DynamicModuleManager::module_loader (DynamicModule::LoaderSafePtr &a_loader)
{
- m_priv->loader = a_loader ;
+ m_priv->loader = a_loader;
}
}//end namespace common
diff --git a/src/common/nmv-dynamic-module.h b/src/common/nmv-dynamic-module.h
index 27c543c..c8765d1 100644
--- a/src/common/nmv-dynamic-module.h
+++ b/src/common/nmv-dynamic-module.h
@@ -51,23 +51,23 @@ extern "C" {
/// This function must then instanciate a DynamicModule,
/// set \em a_new_inst to that new DynamicModule, and return true in case
/// of success. Otherwise, it must return false.
-bool nemiver_common_create_dynamic_module_instance (void **a_new_instance) ;
+bool nemiver_common_create_dynamic_module_instance (void **a_new_instance);
}
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
-class DynamicModule ;
-typedef SafePtr<DynamicModule, ObjectRef, ObjectUnref> DynamicModuleSafePtr ;
+class DynamicModule;
+typedef SafePtr<DynamicModule, ObjectRef, ObjectUnref> DynamicModuleSafePtr;
-class DynModIface ;
-typedef SafePtr<DynModIface, ObjectRef, ObjectUnref> DynModIfaceSafePtr ;
+class DynModIface;
+typedef SafePtr<DynModIface, ObjectRef, ObjectUnref> DynModIfaceSafePtr;
-class DynamicModuleManager ;
+class DynamicModuleManager;
typedef SafePtr<DynamicModuleManager,
ObjectRef,
- ObjectUnref> DynamicModuleManagerSafePtr ;
+ ObjectUnref> DynamicModuleManagerSafePtr;
/// \brief The base class for loadable modules
///
@@ -78,9 +78,9 @@ class NEMIVER_API DynamicModule : public Object {
public:
struct Info {
- UString module_name ;
- UString module_description ;
- UString module_version ;
+ UString module_name;
+ UString module_description;
+ UString module_version;
Info (const UString &a_name,
const UString &a_desc,
@@ -93,86 +93,86 @@ public:
};//end struct info
struct Config : public Object {
- std::vector<UString> custom_library_search_paths ;
- UString library_name ;
+ std::vector<UString> custom_library_search_paths;
+ UString library_name;
virtual ~Config () {};
};//end stuct ModuleConfig
- typedef SafePtr<Config, ObjectRef, ObjectUnref> ConfigSafePtr ;
+ typedef SafePtr<Config, ObjectRef, ObjectUnref> ConfigSafePtr;
class NEMIVER_API Loader : public Object {
- struct Priv ;
- SafePtr<Priv> m_priv ;
- friend class DynamicModuleManager ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
+ friend class DynamicModuleManager;
//non copyable
- Loader (const Loader &) ;
- Loader& operator= (const Loader &) ;
+ Loader (const Loader &);
+ Loader& operator= (const Loader &);
- void set_dynamic_module_manager (DynamicModuleManager *a_mgr) ;
+ void set_dynamic_module_manager (DynamicModuleManager *a_mgr);
public:
- Loader () ;
- virtual ~Loader () ;
- std::vector<UString>& config_search_paths () ;
+ Loader ();
+ virtual ~Loader ();
+ std::vector<UString>& config_search_paths ();
virtual DynamicModule::ConfigSafePtr module_config
- (const std::string &a_name) ;
+ (const std::string &a_name);
virtual UString build_library_path (const UString &a_module_name,
- const UString &a_lib_name) ;
- virtual ConfigSafePtr parse_module_config_file (const UString &a_path) ;
- virtual UString module_library_path (const UString &a_name) ;
- virtual GModule* load_library_from_path (const UString &a_path) ;
- virtual GModule* load_library_from_module_name (const UString &a_name) ;
+ const UString &a_lib_name);
+ virtual ConfigSafePtr parse_module_config_file (const UString &a_path);
+ virtual UString module_library_path (const UString &a_name);
+ virtual GModule* load_library_from_path (const UString &a_path);
+ virtual GModule* load_library_from_module_name (const UString &a_name);
virtual DynamicModuleSafePtr create_dynamic_module_instance
- (GModule *a_module) ;
+ (GModule *a_module);
- virtual DynamicModuleSafePtr load (const UString &a_name) ;
+ virtual DynamicModuleSafePtr load (const UString &a_name);
virtual DynamicModuleSafePtr load_from_path
- (const UString &a_lib_path) ;
- DynamicModuleManager* get_dynamic_module_manager () ;
+ (const UString &a_lib_path);
+ DynamicModuleManager* get_dynamic_module_manager ();
};//end class Loader
- typedef SafePtr<Loader, ObjectRef, ObjectUnref> LoaderSafePtr ;
+ typedef SafePtr<Loader, ObjectRef, ObjectUnref> LoaderSafePtr;
protected:
//must be instanciated by a factory
- DynamicModule () ;
+ DynamicModule ();
private:
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
friend bool gpil_common_create_loadable_module_instance (void **a_new_inst);
- friend class Loader ;
- friend class DynamicModuleManager ;
+ friend class Loader;
+ friend class DynamicModuleManager;
//non copyable
- DynamicModule (const DynamicModule &) ;
- DynamicModule& operator= (const DynamicModule &) ;
+ DynamicModule (const DynamicModule &);
+ DynamicModule& operator= (const DynamicModule &);
- void set_real_library_path (const UString &a_path) ;
+ void set_real_library_path (const UString &a_path);
- void set_name (const UString &a_name) ;
+ void set_name (const UString &a_name);
- void set_module_loader (Loader *a_loader) ;
+ void set_module_loader (Loader *a_loader);
public:
/// \brief get the module loader class
/// \return the module loader
- Loader* get_module_loader () ;
+ Loader* get_module_loader ();
/// \brief gets the path of the library this module has been instanciated
/// from.
/// \return the path of the library the module has been instanciated from.
- const UString& get_real_library_path () const ;
+ const UString& get_real_library_path () const;
/// \brief gets the (short) name of this dynmod
const UString& get_name () const;
/// \brief destructor
- virtual ~DynamicModule () ;
+ virtual ~DynamicModule ();
/// \brief get module info
virtual void get_info (Info &a_info) const = 0;
@@ -195,129 +195,129 @@ public:
/// \return true if a service object interface with the name a_iface_name
/// has been found, false otherwise.
virtual bool lookup_interface (const std::string &a_iface_name,
- DynModIfaceSafePtr &a_iface) = 0 ;
+ DynModIfaceSafePtr &a_iface) = 0;
template <class T> bool lookup_interface
(const std::string &a_iface_name,
SafePtr<T, ObjectRef, ObjectUnref> &a_iface)
{
- DynModIfaceSafePtr iface ;
+ DynModIfaceSafePtr iface;
if (!lookup_interface (a_iface_name, iface)) {
- return false ;
+ return false;
}
- typedef SafePtr<T, ObjectRef, ObjectUnref> TSafePtr ;
+ typedef SafePtr<T, ObjectRef, ObjectUnref> TSafePtr;
// Here, the 'template' keyword is useless, stricto sensu.
// But we need it to keep gcc 3.3.5 happy.
- TSafePtr res = iface.template do_dynamic_cast<T> () ;
+ TSafePtr res = iface.template do_dynamic_cast<T> ();
if (!res) {
- return false ;
+ return false;
}
- a_iface = res ;
- return true ;
+ a_iface = res;
+ return true;
}
};//end class DynamicModule
class NEMIVER_API DynModIface : public Object {
- DynamicModuleSafePtr m_dynamic_module ;
+ DynamicModuleSafePtr m_dynamic_module;
//subclassers _MUST_ not use the default constructor,
//but rather use the DynModIface (DynamicModule &a_dynmod) one.
- DynModIface () ;
- DynModIface (const DynModIface &) ;
- DynModIface& operator= (const DynModIface &) ;
+ DynModIface ();
+ DynModIface (const DynModIface &);
+ DynModIface& operator= (const DynModIface &);
public:
DynModIface (DynamicModuleSafePtr &a_dynmod) :
m_dynamic_module (a_dynmod)
{
- THROW_IF_FAIL (m_dynamic_module) ;
+ THROW_IF_FAIL (m_dynamic_module);
}
DynModIface (DynamicModule *a_dynmod) :
m_dynamic_module (DynamicModuleSafePtr (a_dynmod, true))
{
- THROW_IF_FAIL (m_dynamic_module) ;
+ THROW_IF_FAIL (m_dynamic_module);
}
DynamicModule& get_dynamic_module () const
{
- THROW_IF_FAIL (m_dynamic_module) ;
- return *m_dynamic_module ;
+ THROW_IF_FAIL (m_dynamic_module);
+ return *m_dynamic_module;
}
};//end class DynModIface
class NEMIVER_API ModuleRegistry : public Object {
- struct Priv ;
- SafePtr<Priv> m_priv ;
- //non coyable ;
- ModuleRegistry (const ModuleRegistry &) ;
- ModuleRegistry& operator= (const ModuleRegistry &) ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
+ //non coyable;
+ ModuleRegistry (const ModuleRegistry &);
+ ModuleRegistry& operator= (const ModuleRegistry &);
public:
- ModuleRegistry () ;
- virtual ~ModuleRegistry () ;
- GModule* get_library_from_cache (const UString a_name) ;
+ ModuleRegistry ();
+ virtual ~ModuleRegistry ();
+ GModule* get_library_from_cache (const UString a_name);
void put_library_into_cache (const UString a_name,
- GModule *a_module) ;
+ GModule *a_module);
};//end class ModuleRegistry
class NEMIVER_API DynamicModuleManager : public Object {
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
public:
- DynamicModuleManager () ;
- virtual ~DynamicModuleManager () ;
+ DynamicModuleManager ();
+ virtual ~DynamicModuleManager ();
DynamicModuleSafePtr load_module_from_path (const UString &a_library_path,
- DynamicModule::Loader &) ;
+ DynamicModule::Loader &);
- DynamicModuleSafePtr load_module_from_path (const UString &a_library_path) ;
+ DynamicModuleSafePtr load_module_from_path (const UString &a_library_path);
DynamicModuleSafePtr load_module (const UString &a_name,
- DynamicModule::Loader &) ;
+ DynamicModule::Loader &);
- DynamicModuleSafePtr load_module (const UString &a_name) ;
+ DynamicModuleSafePtr load_module (const UString &a_name);
- static DynamicModuleManager& get_default_manager () ;
+ static DynamicModuleManager& get_default_manager ();
static DynamicModuleSafePtr load_module_with_default_manager
(const UString &a_mod_name,
- DynamicModule::Loader &) ;
+ DynamicModule::Loader &);
static DynamicModuleSafePtr load_module_with_default_manager
- (const UString &a_mod_name) ;
+ (const UString &a_mod_name);
template <class T> SafePtr<T, ObjectRef, ObjectUnref>
load_iface (const UString &a_module_name,
const UString &a_iface_name,
DynamicModule::Loader & a_loader,
- DynamicModuleSafePtr &a_dynmod) ;
+ DynamicModuleSafePtr &a_dynmod);
template <class T> SafePtr<T, ObjectRef, ObjectUnref>
load_iface (const UString &a_module_name,
const UString &a_iface_name,
- DynamicModule::Loader & a_loader) ;
+ DynamicModule::Loader & a_loader);
template <class T> SafePtr<T, ObjectRef, ObjectUnref>
load_iface (const UString &a_module_name,
const UString &a_iface_name,
- DynamicModuleSafePtr &a_dynmod) ;
+ DynamicModuleSafePtr &a_dynmod);
template <class T> SafePtr<T, ObjectRef, ObjectUnref>
load_iface (const UString &a_module_name,
- const UString &a_iface_name) ;
+ const UString &a_iface_name);
template <class T> static SafePtr<T, ObjectRef, ObjectUnref>
load_iface_with_default_manager (const UString &a_module_name,
- const UString &a_iface_name) ;
+ const UString &a_iface_name);
- ModuleRegistry& module_registry () ;
- DynamicModule::LoaderSafePtr& module_loader () ;
- void module_loader (DynamicModule::LoaderSafePtr &a_loader) ;
+ ModuleRegistry& module_registry ();
+ DynamicModule::LoaderSafePtr& module_loader ();
+ void module_loader (DynamicModule::LoaderSafePtr &a_loader);
};//end class DynamicModuleManager
template <class T>
@@ -327,31 +327,31 @@ DynamicModuleManager::load_iface (const UString &a_module_name,
DynamicModule::Loader &a_loader,
DynamicModuleSafePtr &a_dynmod)
{
- DynamicModuleSafePtr module (load_module (a_module_name, a_loader)) ;
- typedef SafePtr<T, ObjectRef, ObjectUnref> TSafePtr ;
+ DynamicModuleSafePtr module (load_module (a_module_name, a_loader));
+ typedef SafePtr<T, ObjectRef, ObjectUnref> TSafePtr;
if (!module) {
THROW (UString ("failed to load module '") + a_module_name);
}
- module->do_init () ;
- LOG_REF_COUNT (module, a_module_name) ;
- DynModIfaceSafePtr tmp_iface ;
+ module->do_init ();
+ LOG_REF_COUNT (module, a_module_name);
+ DynModIfaceSafePtr tmp_iface;
if (!module->lookup_interface (a_iface_name, tmp_iface)) {
- THROW (UString ("module does not have interface: ") + a_iface_name) ;
+ THROW (UString ("module does not have interface: ") + a_iface_name);
}
- THROW_IF_FAIL (tmp_iface) ;
- LOG_REF_COUNT (module, a_module_name) ;
- TSafePtr result ;
+ THROW_IF_FAIL (tmp_iface);
+ LOG_REF_COUNT (module, a_module_name);
+ TSafePtr result;
// Here, the 'template' keyword is useless, stricto sensu.
// But we need it to keep gcc 3.3.5 happy.
result = tmp_iface.template do_dynamic_cast<T> ();
- LOG_REF_COUNT (module, a_module_name) ;
+ LOG_REF_COUNT (module, a_module_name);
if (!result) {
THROW (UString ("interface named ")
+ a_iface_name
- + " is not of the expected type'") ;
+ + " is not of the expected type'");
}
- a_dynmod = module ;
- return result ;
+ a_dynmod = module;
+ return result;
}
template <class T>
@@ -360,10 +360,10 @@ DynamicModuleManager::load_iface (const UString &a_module_name,
const UString &a_iface_name,
DynamicModule::Loader &a_loader)
{
- DynamicModuleSafePtr dynmod ;
+ DynamicModuleSafePtr dynmod;
return load_iface<T> (a_module_name, a_iface_name,
- a_loader, dynmod) ;
+ a_loader, dynmod);
}
template <class T>
@@ -373,7 +373,7 @@ DynamicModuleManager::load_iface (const UString &a_module_name,
DynamicModuleSafePtr &a_dynmod)
{
return load_iface<T> (a_module_name, a_iface_name,
- *module_loader (), a_dynmod) ;
+ *module_loader (), a_dynmod);
}
template <class T>
@@ -381,9 +381,9 @@ SafePtr<T, ObjectRef, ObjectUnref>
DynamicModuleManager::load_iface (const UString &a_module_name,
const UString &a_iface_name)
{
- DynamicModuleSafePtr dynmod ;
+ DynamicModuleSafePtr dynmod;
return load_iface<T> (a_module_name, a_iface_name,
- *module_loader (), dynmod) ;
+ *module_loader (), dynmod);
}
template <class T>
@@ -392,7 +392,7 @@ DynamicModuleManager::load_iface_with_default_manager
(const UString &a_mod_name,
const UString &a_iface_name)
{
- return get_default_manager ().load_iface<T> (a_mod_name, a_iface_name) ;
+ return get_default_manager ().load_iface<T> (a_mod_name, a_iface_name);
}
/// This is a shortcut method to load an interface
diff --git a/src/common/nmv-env.cc b/src/common/nmv-env.cc
index 419cbd7..f39f900 100644
--- a/src/common/nmv-env.cc
+++ b/src/common/nmv-env.cc
@@ -37,7 +37,7 @@
#include "nmv-ustring.h"
#include "nmv-dynamic-module.h"
-using namespace std ;
+using namespace std;
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
@@ -49,7 +49,7 @@ class Initializer
public:
Initializer ()
{
- Glib::thread_init () ;
+ Glib::thread_init ();
}
~Initializer ()
@@ -60,20 +60,20 @@ public:
void
do_init ()
{
- static Initializer init ;
+ static Initializer init;
}
const UString&
get_system_config_file ()
{
- static UString path ;
+ static UString path;
if (path.size () == 0) {
- vector<string> path_elements ;
- path_elements.push_back (get_system_config_dir ()) ;
- path_elements.push_back ("nemiver.conf") ;
- path = Glib::build_filename (path_elements).c_str () ;
+ vector<string> path_elements;
+ path_elements.push_back (get_system_config_dir ());
+ path_elements.push_back ("nemiver.conf");
+ path = Glib::build_filename (path_elements).c_str ();
}
- return path ;
+ return path;
}
const UString&
@@ -91,19 +91,19 @@ get_system_lib_dir ()
#ifndef SYSTEM_LIBDIR
#error The macro SYSTEM_LIBDIR must be set at compile time !
#endif
- static UString s_system_lib_dir (SYSTEM_LIBDIR) ;
- return s_system_lib_dir ;
+ static UString s_system_lib_dir (SYSTEM_LIBDIR);
+ return s_system_lib_dir;
}
const UString&
get_glade_files_dir ()
{
- static UString s_glade_files_dir ;
+ static UString s_glade_files_dir;
if (s_glade_files_dir == "") {
- vector<string> path_elems ;
+ vector<string> path_elems;
path_elems.push_back (get_data_dir ());
- path_elems.push_back ("nemiver") ;
- path_elems.push_back ("glade") ;
+ path_elems.push_back ("nemiver");
+ path_elems.push_back ("glade");
s_glade_files_dir = Glib::build_filename (path_elems).c_str ();
}
return s_glade_files_dir;
@@ -112,12 +112,12 @@ get_glade_files_dir ()
const UString&
get_menu_files_dir ()
{
- static UString s_menu_files_dir ;
+ static UString s_menu_files_dir;
if (s_menu_files_dir == "") {
- vector<string> path_elems ;
+ vector<string> path_elems;
path_elems.push_back (get_data_dir ());
- path_elems.push_back ("nemiver") ;
- path_elems.push_back ("menus") ;
+ path_elems.push_back ("nemiver");
+ path_elems.push_back ("menus");
s_menu_files_dir = Glib::build_filename (path_elems).c_str ();
}
return s_menu_files_dir;
@@ -126,12 +126,12 @@ get_menu_files_dir ()
const UString&
get_image_files_dir ()
{
- static UString s_menu_files_dir ;
+ static UString s_menu_files_dir;
if (s_menu_files_dir == "") {
- vector<string> path_elems ;
+ vector<string> path_elems;
path_elems.push_back (get_data_dir ());
- path_elems.push_back ("nemiver") ;
- path_elems.push_back ("images") ;
+ path_elems.push_back ("nemiver");
+ path_elems.push_back ("images");
s_menu_files_dir = Glib::build_filename (path_elems).c_str ();
}
return s_menu_files_dir;
@@ -147,8 +147,8 @@ get_install_prefix ()
//maybe we'll need to change the way we compute
//this to allow the choice of install prefix
//at install time.
- static UString s_path (NEMIVER_INSTALL_PREFIX) ;
- return s_path ;
+ static UString s_path (NEMIVER_INSTALL_PREFIX);
+ return s_path;
}
const UString&
@@ -158,8 +158,8 @@ get_system_config_dir ()
#error The macro NEMIVER_SYSTEM_CONFIG_DIR must be set at compile time !
#endif
//this macro must be computed at compile time.
- static UString s_path (NEMIVER_SYSTEM_CONFIG_DIR) ;
- return s_path ;
+ static UString s_path (NEMIVER_SYSTEM_CONFIG_DIR);
+ return s_path;
}
const UString&
@@ -169,21 +169,21 @@ get_system_modules_dir ()
#error The macro NEMIVER_MODULES_DIR must be set at compile time !
#endif
//this macro must be set at compile time.
- static UString s_path (NEMIVER_MODULES_DIR) ;
- return s_path ;
+ static UString s_path (NEMIVER_MODULES_DIR);
+ return s_path;
}
const UString&
get_system_modules_config_file ()
{
- static UString path ;
+ static UString path;
if (path.size () == 0) {
- vector<string> path_elements ;
- path_elements.push_back (get_system_config_dir ()) ;
- path_elements.push_back ("nemivermodules.conf") ;
- path = Glib::build_filename (path_elements).c_str () ;
+ vector<string> path_elements;
+ path_elements.push_back (get_system_config_dir ());
+ path_elements.push_back ("nemivermodules.conf");
+ path = Glib::build_filename (path_elements).c_str ();
}
- return path ;
+ return path;
}
const UString&
@@ -195,21 +195,21 @@ get_system_plugins_dir ()
#endif
static UString s_path (NEMIVER_PLUGINS_DIR);
- return s_path ;
+ return s_path;
}
const UString&
get_user_db_dir ()
{
- static UString s_path ;
+ static UString s_path;
if (s_path.size () == 0) {
- vector<string> path_elements ;
- string home = Glib::get_home_dir () ;
- path_elements.push_back (home) ;
- path_elements.push_back (".nemiver") ;
+ vector<string> path_elements;
+ string home = Glib::get_home_dir ();
+ path_elements.push_back (home);
+ path_elements.push_back (".nemiver");
s_path = Glib::build_filename (path_elements).c_str ();
}
- return s_path ;
+ return s_path;
}
const UString&
@@ -221,62 +221,62 @@ get_gdb_program ()
#endif
static const UString s_gdb_prog (GDB_PROG);
- return s_gdb_prog ;
+ return s_gdb_prog;
}
bool
create_user_db_dir ()
{
gint error =
- g_mkdir_with_parents (get_user_db_dir ().c_str (), S_IRWXU) ;
+ g_mkdir_with_parents (get_user_db_dir ().c_str (), S_IRWXU);
if (!error)
- return true ;
- return false ;
+ return true;
+ return false;
}
UString
build_path_to_glade_file (const UString &a_glade_file_name)
{
- UString dir (get_glade_files_dir ()) ;
- vector<string> path_elems ;
- path_elems.push_back (dir.c_str ()) ;
- path_elems.push_back (a_glade_file_name) ;
- UString path_to_glade = Glib::build_filename (path_elems).c_str () ;
+ UString dir (get_glade_files_dir ());
+ vector<string> path_elems;
+ path_elems.push_back (dir.c_str ());
+ path_elems.push_back (a_glade_file_name);
+ UString path_to_glade = Glib::build_filename (path_elems).c_str ();
if (!Glib::file_test (path_to_glade.c_str (),
Glib::FILE_TEST_IS_REGULAR)) {
- THROW ("couldn't find file " + path_to_glade) ;
+ THROW ("couldn't find file " + path_to_glade);
}
- return path_to_glade ;
+ return path_to_glade;
}
UString
build_path_to_menu_file (const UString &a_menu_file_name)
{
- UString dir (get_menu_files_dir ()), path_to_menu_file ;
- vector<string> path_elems ;
- path_elems.push_back (dir.c_str ()) ;
- path_elems.push_back (a_menu_file_name) ;
- path_to_menu_file = Glib::build_filename (path_elems).c_str () ;
+ UString dir (get_menu_files_dir ()), path_to_menu_file;
+ vector<string> path_elems;
+ path_elems.push_back (dir.c_str ());
+ path_elems.push_back (a_menu_file_name);
+ path_to_menu_file = Glib::build_filename (path_elems).c_str ();
if (!Glib::file_test (path_to_menu_file.c_str (),
Glib::FILE_TEST_IS_REGULAR)) {
- THROW ("couldn't find file " + path_to_menu_file) ;
+ THROW ("couldn't find file " + path_to_menu_file);
}
- return path_to_menu_file ;
+ return path_to_menu_file;
}
UString
build_path_to_image_file (const UString &a_image_file_name)
{
- UString dir (get_image_files_dir ()) ;
- vector<string> path_elems ;
- path_elems.push_back (dir.c_str ()) ;
- path_elems.push_back (a_image_file_name) ;
- UString result = Glib::build_filename (path_elems).c_str () ;
+ UString dir (get_image_files_dir ());
+ vector<string> path_elems;
+ path_elems.push_back (dir.c_str ());
+ path_elems.push_back (a_image_file_name);
+ UString result = Glib::build_filename (path_elems).c_str ();
if (!Glib::file_test (result.c_str (),
Glib::FILE_TEST_IS_REGULAR)) {
- THROW ("couldn't find file " + result) ;
+ THROW ("couldn't find file " + result);
}
- return result ;
+ return result;
}
UString
diff --git a/src/common/nmv-env.h b/src/common/nmv-env.h
index 038bb31..32e79cd 100644
--- a/src/common/nmv-env.h
+++ b/src/common/nmv-env.h
@@ -38,43 +38,43 @@ NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
NEMIVER_BEGIN_NAMESPACE (env)
-void do_init () ;
+void do_init ();
-NEMIVER_API const UString& get_system_config_dir () ;
+NEMIVER_API const UString& get_system_config_dir ();
-NEMIVER_API const UString& get_system_config_file () ;
+NEMIVER_API const UString& get_system_config_file ();
-NEMIVER_API const UString& get_data_dir () ;
+NEMIVER_API const UString& get_data_dir ();
-NEMIVER_API const UString& get_system_lib_dir () ;
+NEMIVER_API const UString& get_system_lib_dir ();
-NEMIVER_API const UString& get_glade_files_dir () ;
+NEMIVER_API const UString& get_glade_files_dir ();
-NEMIVER_API const UString& get_menu_files_dir () ;
+NEMIVER_API const UString& get_menu_files_dir ();
-NEMIVER_API const UString& get_image_files_dir () ;
+NEMIVER_API const UString& get_image_files_dir ();
-NEMIVER_API const UString& get_install_prefix () ;
+NEMIVER_API const UString& get_install_prefix ();
-NEMIVER_API const UString& get_system_modules_config_file () ;
+NEMIVER_API const UString& get_system_modules_config_file ();
-NEMIVER_API const UString& get_system_modules_dir () ;
+NEMIVER_API const UString& get_system_modules_dir ();
-NEMIVER_API const UString& get_system_modules_config_file () ;
+NEMIVER_API const UString& get_system_modules_config_file ();
-NEMIVER_API const UString& get_system_plugins_dir () ;
+NEMIVER_API const UString& get_system_plugins_dir ();
-NEMIVER_API const UString& get_user_db_dir () ;
+NEMIVER_API const UString& get_user_db_dir ();
-NEMIVER_API const UString& get_gdb_program () ;
+NEMIVER_API const UString& get_gdb_program ();
-NEMIVER_API bool create_user_db_dir () ;
+NEMIVER_API bool create_user_db_dir ();
-NEMIVER_API UString build_path_to_glade_file (const UString &a_glade_file_name) ;
+NEMIVER_API UString build_path_to_glade_file (const UString &a_glade_file_name);
-NEMIVER_API UString build_path_to_menu_file (const UString &a_ui_file_name) ;
+NEMIVER_API UString build_path_to_menu_file (const UString &a_ui_file_name);
-NEMIVER_API UString build_path_to_image_file (const UString &a_image_file_name) ;
+NEMIVER_API UString build_path_to_image_file (const UString &a_image_file_name);
NEMIVER_API UString build_path_to_help_file (const UString &a_file_name);
diff --git a/src/common/nmv-exception.cc b/src/common/nmv-exception.cc
index c2f30f6..00e606f 100644
--- a/src/common/nmv-exception.cc
+++ b/src/common/nmv-exception.cc
@@ -29,7 +29,7 @@
*/
#include "nmv-exception.h"
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
@@ -53,8 +53,8 @@ Exception::operator= (const Exception &a_other)
if (this == &a_other) {
return *this;
}
- runtime_error::operator= (a_other) ;
- return *this ;
+ runtime_error::operator= (a_other);
+ return *this;
}
Exception::~Exception () throw ()
@@ -63,7 +63,7 @@ Exception::~Exception () throw ()
const char*
Exception::what () const throw ()
{
- return runtime_error::what () ;
+ return runtime_error::what ();
}
}//end namespace common
diff --git a/src/common/nmv-exception.h b/src/common/nmv-exception.h
index 7c8adfe..0248810 100644
--- a/src/common/nmv-exception.h
+++ b/src/common/nmv-exception.h
@@ -41,11 +41,11 @@ namespace common {
class NEMIVER_EXCEPTION_API Exception: public std::runtime_error
{
public:
- Exception (const char* a_reason) ;
- Exception (const UString &a_reason) ;
- Exception (const Exception &a_other) ;
- Exception (const std::exception &) ;
- Exception& operator= (const Exception &a_other) ;
+ Exception (const char* a_reason);
+ Exception (const UString &a_reason);
+ Exception (const Exception &a_other);
+ Exception (const std::exception &);
+ Exception& operator= (const Exception &a_other);
virtual ~Exception () throw ();
const char* what () const throw ();
};//class Exception
@@ -64,21 +64,21 @@ else \
#define THROW_IF_FAIL(a_cond) \
if (!(a_cond)) { \
-LOG_EXCEPTION ("condition (" << #a_cond << ") failed; raising exception\n" ) ;\
+LOG_EXCEPTION ("condition (" << #a_cond << ") failed; raising exception\n" );\
_THROW (nemiver::common::Exception \
- (nemiver::common::UString ("Assertion failed: ") + #a_cond)) ;\
+ (nemiver::common::UString ("Assertion failed: ") + #a_cond)) ;\
}
#define THROW_IF_FAIL2(a_cond, a_reason) \
if (!(a_cond)) { \
LOG_EXCEPTION ("condition (" << #a_cond << ") failed; raising exception " << a_reason <<"\n");\
-_THROW (nemiver::common::Exception (a_reason)) ;\
+_THROW (nemiver::common::Exception (a_reason)) ;\
}
#define THROW_IF_FAIL3(a_cond, type, a_reason) \
if (!(a_cond)) { \
LOG_EXCEPTION ("condition (" << #a_cond << ") failed; raising exception " << #type << \
-<< ": " << a_reason << "\n" ) ; _THROW (type (a_reason)) ;\
+<< ": " << a_reason << "\n" ); _THROW (type (a_reason)) ;\
}
#define ABORT_IF_FAIL(a_cond, a_reason) \
@@ -88,15 +88,15 @@ LOG_EXCEPTION ("condition (" << #a_cond << ") failed; raising exception " << a_r
#define THROW(a_reason) \
LOG_EXCEPTION ("raised exception: "<< (nemiver::common::UString (a_reason)) << "\n"); \
-_THROW (nemiver::common::Exception (nemiver::common::UString (a_reason))) ;
+_THROW (nemiver::common::Exception (nemiver::common::UString (a_reason))) ;
#define THROW_EMPTY \
-LOG_EXCEPTION ("raised empty exception " << endl) ; \
+LOG_EXCEPTION ("raised empty exception " << endl); \
_THROW_EMPTY
#define THROW_EXCEPTION(type, message) \
-LOG_EXCEPTION ("raised " << #type << ": "<< message<< "\n") ; \
-_THROW (type (message)) ;
+LOG_EXCEPTION ("raised " << #type << ": "<< message<< "\n"); \
+_THROW (type (message));
#define TRACE_EXCEPTION(exception) \
LOG_EXCEPTION ("catched exception: " << exception.what () << "\n")
@@ -106,14 +106,14 @@ LOG_EXCEPTION ("catched and rethrowing exception: " << exception.what() << "\n")
#define RETURN_VAL_IF_FAIL(expression, value) \
if (!(expression)) { \
-LOG_ERROR ("assertion " << #expression << " failed. Returning " << #value << "\n") ; \
-return value ; \
+LOG_ERROR ("assertion " << #expression << " failed. Returning " << #value << "\n"); \
+return value; \
}
#define RETURN_IF_FAIL(expression) \
if (!(expression)) { \
-LOG_ERROR ("assertion " << #expression << " failed. Returning.\n") ; \
-return ; \
+LOG_ERROR ("assertion " << #expression << " failed. Returning.\n"); \
+return; \
}
#ifndef NEMIVER_TRY
@@ -123,25 +123,25 @@ return ; \
#ifndef NEMIVER_CATCH_NOX
#define NEMIVER_CATCH_NOX \
} catch (Glib::Exception &e) { \
- LOG_ERROR (e.what ()) ; \
+ LOG_ERROR (e.what ()); \
} catch (std::exception &e) { \
- LOG_ERROR (e.what ()) ; \
+ LOG_ERROR (e.what ()); \
} catch (...) { \
- LOG_ERROR ("An unknown error occured") ; \
+ LOG_ERROR ("An unknown error occured"); \
}
#endif
#ifndef NEMIVER_CATCH_AND_RETURN_NOX
#define NEMIVER_CATCH_AND_RETURN_NOX(a_value) \
} catch (Glib::Exception &e) { \
- LOG_ERROR (e.what ()) ; \
- return a_value ; \
+ LOG_ERROR (e.what ()); \
+ return a_value; \
} catch (std::exception &e) { \
- LOG_ERROR (e.what ()) ; \
- return a_value ; \
+ LOG_ERROR (e.what ()); \
+ return a_value; \
} catch (...) { \
- LOG_ERROR ("An unknown error occured") ; \
- return a_value ; \
+ LOG_ERROR ("An unknown error occured"); \
+ return a_value; \
}
#endif
diff --git a/src/common/nmv-i-connection-driver.h b/src/common/nmv-i-connection-driver.h
index 09b613c..64693cf 100644
--- a/src/common/nmv-i-connection-driver.h
+++ b/src/common/nmv-i-connection-driver.h
@@ -33,8 +33,8 @@
namespace nemiver {
namespace common {
-class Buffer ;
-class UString ;
+class Buffer;
+class UString;
}
namespace common {
@@ -50,7 +50,7 @@ enum ColumnType {
COLUMN_TYPE_UNKNOWN=1<<30// should be last
};
-class SQLStatement ;
+class SQLStatement;
class NEMIVER_API IConnectionDriver : public common::Object {
public:
@@ -62,11 +62,11 @@ public:
virtual const char* get_last_error () const = 0;
- virtual bool start_transaction () = 0 ;
+ virtual bool start_transaction () = 0;
- virtual bool commit_transaction () = 0 ;
+ virtual bool commit_transaction () = 0;
- virtual bool rollback_transaction () = 0 ;
+ virtual bool rollback_transaction () = 0;
virtual bool execute_statement
(const SQLStatement &a_statement) = 0;
@@ -98,7 +98,7 @@ public:
typedef common::SafePtr<IConnectionDriver,
common::ObjectRef,
- common::ObjectUnref> IConnectionDriverSafePtr ;
+ common::ObjectUnref> IConnectionDriverSafePtr;
}//end common
}//end nemiver
diff --git a/src/common/nmv-i-connection-manager-driver.h b/src/common/nmv-i-connection-manager-driver.h
index 215b0fa..83b0392 100644
--- a/src/common/nmv-i-connection-manager-driver.h
+++ b/src/common/nmv-i-connection-manager-driver.h
@@ -34,54 +34,54 @@
namespace nemiver {
namespace common {
-class IConnectionManagerDriver ;
+class IConnectionManagerDriver;
class DBDesc {
- common::UString m_type ;
- common::UString m_host ;
- unsigned long m_port ;
- common::UString m_name ;
+ common::UString m_type;
+ common::UString m_host;
+ unsigned long m_port;
+ common::UString m_name;
public:
DBDesc ()
{}
DBDesc (const common::UString &a_host,
const unsigned long &a_port,
- const common::UString &a_db_name) ;
+ const common::UString &a_db_name);
const common::UString host () const
{
return m_host;
- } ;
+ };
unsigned long port () const
{
return m_port;
- } ;
+ };
const common::UString name () const
{
return m_name;
- } ;
+ };
const common::UString type () const
{
return m_type;
- } ;
+ };
void set_host (const common::UString &a_host)
{
m_host = a_host;
- } ;
+ };
void set_port (const unsigned long &a_port)
{
m_port = a_port;
- } ;
+ };
void set_name (const common::UString &a_name)
{
m_name = a_name;
- } ;
+ };
void set_type (const common::UString &a_type)
{
m_type = a_type;
- } ;
+ };
};//end class DBDesc
class NEMIVER_PURE_IFACE IConnectionManagerDriver :
@@ -101,7 +101,7 @@ public:
typedef common::SafePtr<IConnectionManagerDriver,
common::ObjectRef,
- common::ObjectUnref> IConnectionManagerDriverSafePtr ;
+ common::ObjectUnref> IConnectionManagerDriverSafePtr;
};//end namespace common
};//end namespace nemiver
#endif //__NEMIVER_I_CONNECTION_MANAGER_DRIVER_H__
diff --git a/src/common/nmv-i-input-stream.h b/src/common/nmv-i-input-stream.h
index 96dfa4d..f1dee9e 100644
--- a/src/common/nmv-i-input-stream.h
+++ b/src/common/nmv-i-input-stream.h
@@ -37,8 +37,8 @@ namespace common {
class IInputStream : public Object {
//forbid copy
- IInputStream (const IInputStream &) ;
- IInputStream& operator= (const IInputStream &) ;
+ IInputStream (const IInputStream &);
+ IInputStream& operator= (const IInputStream &);
public:
enum Status {
diff --git a/src/common/nmv-initializer.cc b/src/common/nmv-initializer.cc
index ec2d715..4029323 100644
--- a/src/common/nmv-initializer.cc
+++ b/src/common/nmv-initializer.cc
@@ -32,21 +32,21 @@ namespace common {
Initializer::Initializer ()
{
- setlocale (LC_ALL, "") ;
+ setlocale (LC_ALL, "");
Glib::init ();
- Glib::thread_init () ;
- ConfManager::init () ;
+ Glib::thread_init ();
+ ConfManager::init ();
}
Initializer::~Initializer ()
{
- xmlCleanupParser () ;
+ xmlCleanupParser ();
}
void
Initializer::do_init ()
{
- static Initializer s_init ;
+ static Initializer s_init;
}
}//end namespace common
diff --git a/src/common/nmv-initializer.h b/src/common/nmv-initializer.h
index 057cdaa..3500d13 100644
--- a/src/common/nmv-initializer.h
+++ b/src/common/nmv-initializer.h
@@ -29,15 +29,15 @@
namespace nemiver {
namespace common {
class NEMIVER_API Initializer {
- Initializer () ;
+ Initializer ();
//non copyable
- Initializer (const Initializer &) ;
- ~Initializer () ;
- Initializer& operator= (const Initializer &) ;
+ Initializer (const Initializer &);
+ ~Initializer ();
+ Initializer& operator= (const Initializer &);
public:
- static void do_init () ;
+ static void do_init ();
};//end class Initializer
}//end namespace common
diff --git a/src/common/nmv-insert-statement.cc b/src/common/nmv-insert-statement.cc
index 5c882ff..e61ac63 100644
--- a/src/common/nmv-insert-statement.cc
+++ b/src/common/nmv-insert-statement.cc
@@ -29,89 +29,89 @@
#include "nmv-exception.h"
#include "nmv-insert-statement.h"
-using namespace nemiver::common ;
+using namespace nemiver::common;
namespace nemiver {
namespace common {
struct InsertStatementPriv {
- UString table_name ;
- ColumnList columns ;
- UString string_repr ;
+ UString table_name;
+ ColumnList columns;
+ UString string_repr;
};//end InsertStatementPriv
InsertStatement::InsertStatement (const UString &a_table_name,
ColumnList &a_columns)
{
- m_priv = new InsertStatementPriv ;
- m_priv->table_name = a_table_name ;
- m_priv->columns = a_columns ;
+ m_priv = new InsertStatementPriv;
+ m_priv->table_name = a_table_name;
+ m_priv->columns = a_columns;
}
InsertStatement::~InsertStatement ()
{
if (m_priv) {
- delete m_priv ;
- m_priv = NULL ;
+ delete m_priv;
+ m_priv = NULL;
}
}
void
InsertStatement::set (const UString &a_table_name, ColumnList &a_columns)
{
- m_priv->table_name = a_table_name ;
- m_priv->columns = a_columns ;
- m_priv->string_repr = "" ;
+ m_priv->table_name = a_table_name;
+ m_priv->columns = a_columns;
+ m_priv->string_repr = "";
}
const UString&
InsertStatement::to_string () const
{
- UString str ;
+ UString str;
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
if (m_priv->string_repr == "") {
- RETURN_VAL_IF_FAIL (m_priv->table_name != "", m_priv->string_repr) ;
+ RETURN_VAL_IF_FAIL (m_priv->table_name != "", m_priv->string_repr);
RETURN_VAL_IF_FAIL (m_priv->columns.size () != 0,
- m_priv->string_repr) ;
+ m_priv->string_repr);
RETURN_VAL_IF_FAIL (m_priv->columns.size ()
== m_priv->columns.size (),
- m_priv->string_repr) ;
- str = "insert into " + m_priv->table_name + "( " ;
- UString col_names, col_values ;
- for (ColumnList::iterator it = m_priv->columns.begin () ;
- it != m_priv->columns.end () ;
+ m_priv->string_repr);
+ str = "insert into " + m_priv->table_name + "( ";
+ UString col_names, col_values;
+ for (ColumnList::iterator it = m_priv->columns.begin ();
+ it != m_priv->columns.end ();
++it) {
if (col_names.size ()) {
- col_names += ", " ;
- col_values += ", " ;
+ col_names += ", ";
+ col_values += ", ";
}
- col_names += it->get_name () ;
+ col_names += it->get_name ();
if (it->get_auto_increment ()) {
- col_values += "null" ;//for mysql and sqlite
+ col_values += "null";//for mysql and sqlite
//TODO: find an elegant way to consider
//the case of other databases.
} else {
- col_values += "\'" + it->get_value () + "\'" ;
+ col_values += "\'" + it->get_value () + "\'";
}
}
str += col_names + ") values (" + col_values + ")";
- m_priv->string_repr = str ;
+ m_priv->string_repr = str;
}
- return m_priv->string_repr ;
+ return m_priv->string_repr;
}
const ColumnList&
InsertStatement::get_columns () const
{
- return m_priv->columns ;
+ return m_priv->columns;
}
const UString&
InsertStatement::get_table_name () const
{
- return m_priv->table_name ;
+ return m_priv->table_name;
}
diff --git a/src/common/nmv-insert-statement.h b/src/common/nmv-insert-statement.h
index 29d73be..e876390 100644
--- a/src/common/nmv-insert-statement.h
+++ b/src/common/nmv-insert-statement.h
@@ -31,29 +31,29 @@
namespace nemiver {
namespace common {
-struct InsertStatementPriv ;
+struct InsertStatementPriv;
class NEMIVER_API InsertStatement : public SQLStatement
{
friend struct InsertStatementPriv;
- InsertStatementPriv *m_priv ;
+ InsertStatementPriv *m_priv;
//forbid copy
- InsertStatement (const InsertStatement &) ;
- InsertStatement& operator= (const InsertStatement &) ;
+ InsertStatement (const InsertStatement &);
+ InsertStatement& operator= (const InsertStatement &);
public:
InsertStatement (const common::UString &a_table_name,
- ColumnList &a_columns) ;
- ~InsertStatement () ;
+ ColumnList &a_columns);
+ ~InsertStatement ();
- const common::UString& to_string () const ;
+ const common::UString& to_string () const;
- const ColumnList& get_columns () const ;
+ const ColumnList& get_columns () const;
- const common::UString& get_table_name () const ;
+ const common::UString& get_table_name () const;
- void set (const common::UString &a_table_name, ColumnList &a_columns) ;
+ void set (const common::UString &a_table_name, ColumnList &a_columns);
};//end InsertStatement
}// end namespace common
diff --git a/src/common/nmv-libxml-utils.cc b/src/common/nmv-libxml-utils.cc
index b84d496..a9fda90 100644
--- a/src/common/nmv-libxml-utils.cc
+++ b/src/common/nmv-libxml-utils.cc
@@ -39,54 +39,54 @@ reader_io_read_callback (ReaderIOContext *a_read_context,
char * a_buf,
int a_len)
{
- THROW_IF_FAIL (a_read_context) ;
- int len = a_len ;
- int result (-1) ;
- IInputStream::Status status = a_read_context->m_istream.read (a_buf, len) ;
+ THROW_IF_FAIL (a_read_context);
+ int len = a_len;
+ int result (-1);
+ IInputStream::Status status = a_read_context->m_istream.read (a_buf, len);
switch (status) {
case IInputStream::OK:
- result = len ;
+ result = len;
break;
case IInputStream::EOF_ERROR:
- result = 0 ;
- break ;
+ result = 0;
+ break;
case IInputStream::NOT_OPEN_ERROR:
case IInputStream::ERROR:
default:
- result = -1 ;
+ result = -1;
}
- return result ;
+ return result;
}
int
reader_io_close_callback (ReaderIOContext *a_read_context)
{
if (a_read_context) {}
- return 0 ;
+ return 0;
}
bool
goto_next_element_node (XMLTextReaderSafePtr &a_reader)
{
- int result = xmlTextReaderRead (a_reader.get ()) ;
+ int result = xmlTextReaderRead (a_reader.get ());
if (result == 0) {
- return false ;
+ return false;
} else if (result < 0) {
- THROW ("parsing error") ;
+ THROW ("parsing error");
}
xmlReaderTypes node_type =
- static_cast<xmlReaderTypes> (xmlTextReaderNodeType (a_reader.get ())) ;
+ static_cast<xmlReaderTypes> (xmlTextReaderNodeType (a_reader.get ()));
while (node_type != XML_READER_TYPE_ELEMENT) {
- result = xmlTextReaderRead (a_reader.get ()) ;
+ result = xmlTextReaderRead (a_reader.get ());
if (result == 0) {
- return false ;
+ return false;
} else if (result < 0) {
- THROW ("parsing error") ;
+ THROW ("parsing error");
}
node_type = static_cast<xmlReaderTypes>
- (xmlTextReaderNodeType (a_reader.get ())) ;
+ (xmlTextReaderNodeType (a_reader.get ()));
}
- return true ;
+ return true;
}
bool
@@ -94,14 +94,14 @@ goto_next_element_node_and_check (XMLTextReaderSafePtr &a_reader,
const char* a_element_name)
{
if (!goto_next_element_node (a_reader)) {
- return false ;
+ return false;
}
UString name = reinterpret_cast<const char*>
- (xmlTextReaderConstName (a_reader.get ())) ;
+ (xmlTextReaderConstName (a_reader.get ()));
if (name != a_element_name) {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
@@ -109,90 +109,90 @@ bool
search_next_element_node (XMLTextReaderSafePtr &a_reader,
const char* a_element_name)
{
- THROW_IF_FAIL (a_element_name) ;
+ THROW_IF_FAIL (a_element_name);
bool result (false);
- int status (0) ;
- xmlReaderTypes node_type ;
+ int status (0);
+ xmlReaderTypes node_type;
for (;;) {
- status = xmlTextReaderRead (a_reader.get ()) ;
+ status = xmlTextReaderRead (a_reader.get ());
if (status == 0) {
- return false ;
+ return false;
} else if (result < 0) {
- THROW ("parsing error") ;
+ THROW ("parsing error");
}
node_type = static_cast<xmlReaderTypes>
- (xmlTextReaderNodeType (a_reader.get ())) ;
+ (xmlTextReaderNodeType (a_reader.get ()));
UString name =
reinterpret_cast<const char*>
(XMLCharSafePtr (xmlTextReaderLocalName (a_reader.get ())).get ());
if (node_type == XML_READER_TYPE_ELEMENT
&& name == a_element_name) {
- result=true ;
- break ;
+ result=true;
+ break;
}
}
- return result ;
+ return result;
}
bool
goto_next_text_node (XMLTextReaderSafePtr &a_reader)
{
- int result = xmlTextReaderRead (a_reader.get ()) ;
+ int result = xmlTextReaderRead (a_reader.get ());
if (result == 0) {
- return false ;
+ return false;
} else if (result < 0) {
- THROW ("parsing error") ;
+ THROW ("parsing error");
}
xmlReaderTypes node_type =
- static_cast<xmlReaderTypes> (xmlTextReaderNodeType (a_reader.get ())) ;
+ static_cast<xmlReaderTypes> (xmlTextReaderNodeType (a_reader.get ()));
while (node_type != XML_READER_TYPE_TEXT) {
- result = xmlTextReaderRead (a_reader.get ()) ;
+ result = xmlTextReaderRead (a_reader.get ());
if (result == 0) {
- return false ;
+ return false;
} else if (result < 0) {
- THROW ("parsing error") ;
+ THROW ("parsing error");
}
node_type = static_cast<xmlReaderTypes>
- (xmlTextReaderNodeType (a_reader.get ())) ;
+ (xmlTextReaderNodeType (a_reader.get ()));
}
- return true ;
+ return true;
}
bool
read_next_and_check_node (XMLTextReaderSafePtr &a_reader,
xmlReaderTypes a_node_type_to_be)
{
- int result = xmlTextReaderRead (a_reader.get ()) ;
+ int result = xmlTextReaderRead (a_reader.get ());
if (result == 0) {
- return false ;
+ return false;
} else if (result < 0) {
- THROW ("parsing error") ;
+ THROW ("parsing error");
}
xmlReaderTypes node_type =
static_cast<xmlReaderTypes>
(xmlTextReaderNodeType (a_reader.get ()));
if (node_type == a_node_type_to_be) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
bool
is_empty_element (XMLTextReaderSafePtr &a_reader)
{
- THROW_IF_FAIL (a_reader) ;
- int status = xmlTextReaderIsEmptyElement (a_reader.get ()) ;
+ THROW_IF_FAIL (a_reader);
+ int status = xmlTextReaderIsEmptyElement (a_reader.get ());
if (status == 1) {
- return true ;
+ return true;
} else if (status == 0) {
- return false ;
+ return false;
} else if (status < 0) {
THROW ("an error occured while calling "
- "xmlTextReaderIsEmptyElement()") ;
+ "xmlTextReaderIsEmptyElement()");
} else {
THROW ("unknown return value for "
- "xmlTextReaderIsEmptyElement()") ;
+ "xmlTextReaderIsEmptyElement()");
}
}
diff --git a/src/common/nmv-libxml-utils.h b/src/common/nmv-libxml-utils.h
index f2646a1..0eb6475 100644
--- a/src/common/nmv-libxml-utils.h
+++ b/src/common/nmv-libxml-utils.h
@@ -54,9 +54,9 @@ struct XMLTextReaderUnref {
operator () (xmlTextReader* a_ptr)
{
if (a_ptr) {
- xmlFreeTextReader (a_ptr) ;
+ xmlFreeTextReader (a_ptr);
}
- return true ;
+ return true;
}
};//end XMLReaderRef
@@ -71,9 +71,9 @@ struct XMLXPathContextUnref {
operator () (xmlXPathContext *a_ptr)
{
if (a_ptr) {
- xmlXPathFreeContext (a_ptr) ;
+ xmlXPathFreeContext (a_ptr);
}
- return true ;
+ return true;
}
};//end XPathContextRef
@@ -87,9 +87,9 @@ struct XMLXPathObjectUnref {
operator () (xmlXPathObject *a_ptr)
{
if (a_ptr) {
- xmlXPathFreeObject (a_ptr) ;
+ xmlXPathFreeObject (a_ptr);
}
- return true ;
+ return true;
}
};//end XMLXPathObjectRef
@@ -103,29 +103,29 @@ struct XMLCharUnref {
operator () (xmlChar *a_ptr)
{
if (a_ptr) {
- xmlFree (a_ptr) ;
+ xmlFree (a_ptr);
}
- return true ;
+ return true;
}
};//end XMLCharRef
typedef SafePtr <xmlTextReader, XMLTextReaderRef, XMLTextReaderUnref>
-XMLTextReaderSafePtr ;
+XMLTextReaderSafePtr;
typedef SafePtr<xmlXPathContext, XMLXPathContextRef,
-XMLXPathContextUnref> XMLXPathContextSafePtr ;
+XMLXPathContextUnref> XMLXPathContextSafePtr;
typedef SafePtr<xmlXPathObject, XMLXPathObjectRef, XMLXPathObjectUnref>
-XMLXPathObjectSafePtr ;
+XMLXPathObjectSafePtr;
-typedef SafePtr<xmlChar, XMLCharRef, XMLCharUnref> XMLCharSafePtr ;
+typedef SafePtr<xmlChar, XMLCharRef, XMLCharUnref> XMLCharSafePtr;
//****************************************************
//helpers to use xmlTextReader with our own IO system
//*****************************************************
struct ReaderIOContext {
- IInputStream &m_istream ;
+ IInputStream &m_istream;
ReaderIOContext (IInputStream &a_istream):
m_istream (a_istream)
@@ -134,24 +134,24 @@ struct ReaderIOContext {
int NEMIVER_API reader_io_read_callback (ReaderIOContext *a_read_context,
char * a_buf,
- int a_len) ;
+ int a_len);
-int NEMIVER_API reader_io_close_callback (ReaderIOContext *a_read_context) ;
+int NEMIVER_API reader_io_close_callback (ReaderIOContext *a_read_context);
-bool NEMIVER_API goto_next_element_node (XMLTextReaderSafePtr &a_reader) ;
+bool NEMIVER_API goto_next_element_node (XMLTextReaderSafePtr &a_reader);
bool NEMIVER_API goto_next_element_node_and_check (XMLTextReaderSafePtr &a_reader,
- const char* a_element_name) ;
+ const char* a_element_name);
bool NEMIVER_API search_next_element_node (XMLTextReaderSafePtr &a_reader,
- const char *a_element_name) ;
+ const char *a_element_name);
-bool NEMIVER_API goto_next_text_node (XMLTextReaderSafePtr &a_reader) ;
+bool NEMIVER_API goto_next_text_node (XMLTextReaderSafePtr &a_reader);
bool NEMIVER_API read_next_and_check_node (XMLTextReaderSafePtr &a_reader,
- xmlReaderTypes a_node_type_to_be) ;
+ xmlReaderTypes a_node_type_to_be);
-bool NEMIVER_API is_empty_element (XMLTextReaderSafePtr &a_reader) ;
+bool NEMIVER_API is_empty_element (XMLTextReaderSafePtr &a_reader);
}//end namespace libxmlutils
}//end namespace common
diff --git a/src/common/nmv-log-stream-utils.h b/src/common/nmv-log-stream-utils.h
index 29a40bc..8b0f2b4 100644
--- a/src/common/nmv-log-stream-utils.h
+++ b/src/common/nmv-log-stream-utils.h
@@ -83,7 +83,7 @@ LOG_STREAM << LOG_LEVEL_NORMAL___ << LOG_MARKER_INFO << message << nemiver::comm
#ifndef LOG_D
#define LOG_D(message, domain) \
-LOG_STREAM.push_domain (domain) ; LOG (message) ; LOG_STREAM.pop_domain ();
+LOG_STREAM.push_domain (domain); LOG (message) ; LOG_STREAM.pop_domain ();
#endif
#ifndef LOG_DD
@@ -102,7 +102,7 @@ LOG_STREAM << LOG_LEVEL_NORMAL___ << LOG_MARKER_EXCEPTION << HERE << message <<
#ifndef LOG_ERROR_D
#define LOG_ERROR_D(message, domain) \
-LOG_STREAM.push_domain (domain) ; LOG_ERROR (message) ; LOG_STREAM.pop_domain() ;
+LOG_STREAM.push_domain (domain); LOG_ERROR (message) ; LOG_STREAM.pop_domain() ;
#endif
#ifndef LOG_ERROR_DD
@@ -116,34 +116,34 @@ LOG_STREAM << LOG_LEVEL_VERBOSE___ << LOG_MARKER_INFO << HERE << message << nemi
#ifndef LOG_VERBOSE_D
#define LOG_VERBOSE_D(message) \
-LOG_STREAM.push_domain (domain) ; LOG_VERBOSE(message) ;LOG_STREAM.pop_domain();
+LOG_STREAM.push_domain (domain); LOG_VERBOSE(message) ;LOG_STREAM.pop_domain();
#endif
#ifndef LOG_SCOPE_VERBOSE
#define LOG_SCOPE_VERBOSE(scopename) \
-nemiver::common::ScopeLogger scope_logger (scopename, nemiver::common::LogStream::LOG_LEVEL_VERBOSE) ;
+nemiver::common::ScopeLogger scope_logger (scopename, nemiver::common::LogStream::LOG_LEVEL_VERBOSE);
#endif
#ifndef LOG_SCOPE
#define LOG_SCOPE(scopename) \
-nemiver::common::ScopeLogger scope_logger (scopename, nemiver::common::LogStream::LOG_LEVEL_NORMAL) ;
+nemiver::common::ScopeLogger scope_logger (scopename, nemiver::common::LogStream::LOG_LEVEL_NORMAL);
#endif
#ifndef LOG_SCOPE_D
#define LOG_SCOPE_D(scopename, domain) \
nemiver::common::ScopeLogger scope_logger \
- (scopename, nemiver::common::LogStream::LOG_LEVEL_VERBOSE, domain) ;
+ (scopename, nemiver::common::LogStream::LOG_LEVEL_VERBOSE, domain);
#endif
#ifndef LOG_SCOPE_NORMAL
#define LOG_SCOPE_NORMAL(scopename) \
-nemiver::common::ScopeLogger scope_logger (scopename, nemiver::common::LogStream::LOG_LEVEL_NORMAL) ;
+nemiver::common::ScopeLogger scope_logger (scopename, nemiver::common::LogStream::LOG_LEVEL_NORMAL);
#endif
#ifndef LOG_SCOPE_NORMAL_D
#define LOG_SCOPE_NORMAL_D(scopename, domain) \
nemiver::common::ScopeLogger scope_logger \
- (scopename, nemiver::common::LogStream::LOG_LEVEL_NORMAL, domain) ;
+ (scopename, nemiver::common::LogStream::LOG_LEVEL_NORMAL, domain);
#endif
#ifndef LOG_FUNCTION_SCOPE
@@ -177,7 +177,7 @@ LOG_D ("object '" \
<< a_name \
<< "' refcount: " \
<< (int) a_object_ptr->get_refcount (), \
- "refcount-domain") ;
+ "refcount-domain");
#endif //LOG_REF_COUNT
#endif // NMV_LOG_STREAM_UTILS_H__
diff --git a/src/common/nmv-log-stream.cc b/src/common/nmv-log-stream.cc
index f56c61b..91b3eae 100644
--- a/src/common/nmv-log-stream.cc
+++ b/src/common/nmv-log-stream.cc
@@ -61,7 +61,7 @@ namespace __gnu_cxx {
namespace nemiver {
namespace common {
-using namespace std ;
+using namespace std;
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 2
typedef std::tr1::unordered_map<std::string, bool> DomainMap;
@@ -69,9 +69,9 @@ typedef std::tr1::unordered_map<std::string, bool> DomainMap;
typedef __gnu_cxx::hash_map<std::string, bool> DomainMap;
#endif
-static enum LogStream::StreamType s_stream_type = LogStream::COUT_STREAM ;
-static enum LogStream::LogLevel s_level_filter = LogStream::LOG_LEVEL_NORMAL ;
-static bool s_is_active = true ;
+static enum LogStream::StreamType s_stream_type = LogStream::COUT_STREAM;
+static enum LogStream::LogLevel s_level_filter = LogStream::LOG_LEVEL_NORMAL;
+static bool s_is_active = true;
/// the base class of the destination
/// of the messages send to a stream.
@@ -82,14 +82,14 @@ static bool s_is_active = true ;
class LogSink : public Object {
protected:
- mutable Glib::Mutex m_ostream_mutex ;
- ostream *m_out ;
+ mutable Glib::Mutex m_ostream_mutex;
+ ostream *m_out;
//non copyable
- LogSink (const LogSink &) ;
- LogSink& operator= (const LogSink &) ;
+ LogSink (const LogSink &);
+ LogSink& operator= (const LogSink &);
- LogSink () ;
+ LogSink ();
public:
@@ -99,61 +99,61 @@ public:
bool bad () const
{
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- return m_out->bad () ;
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ return m_out->bad ();
}
bool good () const
{
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- return m_out->good () ;
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ return m_out->good ();
}
void flush ()
{
- if (!m_out) throw runtime_error ("underlying ostream not initialized") ;
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- m_out->flush () ;
+ if (!m_out) throw runtime_error ("underlying ostream not initialized");
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ m_out->flush ();
}
LogSink& write (const char *a_buf, long a_buflen)
{
- if (!m_out) throw runtime_error ("underlying ostream not initialized") ;
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- m_out->write (a_buf, a_buflen) ;
- return *this ;
+ if (!m_out) throw runtime_error ("underlying ostream not initialized");
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ m_out->write (a_buf, a_buflen);
+ return *this;
}
LogSink& operator<< (const Glib::ustring &a_string)
{
- if (!m_out) throw runtime_error ("underlying ostream not initialized") ;
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- *m_out << a_string ;
- return *this ;
+ if (!m_out) throw runtime_error ("underlying ostream not initialized");
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ *m_out << a_string;
+ return *this;
}
LogSink& operator<< (int an_int)
{
- if (!m_out) throw runtime_error ("underlying ostream not initialized") ;
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- *m_out << an_int ;
- return *this ;
+ if (!m_out) throw runtime_error ("underlying ostream not initialized");
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ *m_out << an_int;
+ return *this;
}
LogSink& operator<< (double a_double)
{
- if (!m_out) throw runtime_error ("underlying ostream not initialized") ;
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
- *m_out << a_double ;
- return *this ;
+ if (!m_out) throw runtime_error ("underlying ostream not initialized");
+ Glib::Mutex::Lock lock (m_ostream_mutex);
+ *m_out << a_double;
+ return *this;
}
LogSink& operator<< (char a_char)
{
- if (!m_out) throw runtime_error ("underlying ostream not initialized") ;
- Glib::Mutex::Lock lock (m_ostream_mutex) ;
+ if (!m_out) throw runtime_error ("underlying ostream not initialized");
+ Glib::Mutex::Lock lock (m_ostream_mutex);
*m_out << a_char;
- return *this ;
+ return *this;
}
};//end class LogSink
@@ -170,24 +170,24 @@ public:
};//end class OStreamSink
class OfstreamLogSink : public LogSink {
- SafePtr<ofstream> m_ofstream ;
+ SafePtr<ofstream> m_ofstream;
void init_from_path (const UString &a_file_path)
{
- GCharSafePtr dir (g_path_get_dirname (a_file_path.c_str ())) ;
+ GCharSafePtr dir (g_path_get_dirname (a_file_path.c_str ()));
if (!Glib::file_test (dir.get (), Glib::FILE_TEST_IS_DIR)) {
if (g_mkdir_with_parents (dir.get (), S_IRWXU)) {
throw Exception (UString ("failed to create '")
- + UString ((dir.get ())) + "'") ;
+ + UString ((dir.get ())) + "'");
}
}
- m_ofstream.reset (new ofstream (a_file_path.c_str ())) ;
- THROW_IF_FAIL (m_ofstream) ;
+ m_ofstream.reset (new ofstream (a_file_path.c_str ()));
+ THROW_IF_FAIL (m_ofstream);
if (!m_ofstream->good ()) {
- THROW ("Could not open file " + a_file_path) ;
+ THROW ("Could not open file " + a_file_path);
}
- m_out = m_ofstream.get () ;
+ m_out = m_ofstream.get ();
}
public:
@@ -198,10 +198,10 @@ public:
OfstreamLogSink () : LogSink (NULL)
{
- vector<string> path_elems ;
- path_elems.push_back (Glib::get_current_dir ()) ;
+ vector<string> path_elems;
+ path_elems.push_back (Glib::get_current_dir ());
path_elems.push_back (string ("log.txt"));
- init_from_path (Glib::build_filename (path_elems).c_str ()) ;
+ init_from_path (Glib::build_filename (path_elems).c_str ());
}
virtual ~OfstreamLogSink ()
@@ -209,21 +209,21 @@ public:
if (m_ofstream) {
m_ofstream->flush ();
m_ofstream->close ();
- m_ofstream.reset () ;
+ m_ofstream.reset ();
}
}
};//end class OfstreamLogSink
-typedef SafePtr<LogSink, ObjectRef, ObjectUnref> LogSinkSafePtr ;
+typedef SafePtr<LogSink, ObjectRef, ObjectUnref> LogSinkSafePtr;
struct LogStream::Priv
{
- enum LogStream::StreamType stream_type ;
- LogSinkSafePtr sink ;
+ enum LogStream::StreamType stream_type;
+ LogSinkSafePtr sink;
//the stack of default domains name
//to consider when logging functions don't
//specify the domain name in their parameters
- list<string> default_domains ;
+ list<string> default_domains;
//the list of domains (keywords) this stream
//is allowed to log against. (It is a map, just for speed purposes)
@@ -231,51 +231,51 @@ struct LogStream::Priv
//Logging domains are just keywords associated to the messages that are
//going to be logged. This helps in for filtering the messages that
//are to be logged or not.
- DomainMap allowed_domains ;
+ DomainMap allowed_domains;
//the log level of this log stream
- enum LogStream::LogLevel level ;
+ enum LogStream::LogLevel level;
- std::vector<UString> enabled_domains_from_env ;
+ std::vector<UString> enabled_domains_from_env;
Priv (const string &a_domain=NMV_GENERAL_DOMAIN) :
stream_type (LogStream::COUT_STREAM),
level (LogStream::LOG_LEVEL_NORMAL)
{
- default_domains.clear () ;
- default_domains.push_front (a_domain) ;
+ default_domains.clear ();
+ default_domains.push_front (a_domain);
//NMV_GENERAL_DOMAIN is always enabled by default.
- allowed_domains[NMV_GENERAL_DOMAIN] = true ;
+ allowed_domains[NMV_GENERAL_DOMAIN] = true;
}
static UString& get_stream_file_path_private ()
{
- static UString s_stream_file_path ;
+ static UString s_stream_file_path;
if (s_stream_file_path == "") {
- vector<string> path_elems ;
- path_elems.push_back (Glib::get_current_dir ()) ;
+ vector<string> path_elems;
+ path_elems.push_back (Glib::get_current_dir ());
path_elems.push_back (string ("log.txt"));
- s_stream_file_path = Glib::build_filename (path_elems).c_str () ;
+ s_stream_file_path = Glib::build_filename (path_elems).c_str ();
}
- return s_stream_file_path ;
+ return s_stream_file_path;
}
static UString& get_domain_filter_private ()
{
- static UString s_domain_filter ("all") ;
- return s_domain_filter ;
+ static UString s_domain_filter ("all");
+ return s_domain_filter;
}
bool is_logging_allowed (const std::string &a_domain)
{
if (!LogStream::is_active ())
- return false ;
+ return false;
//check domain
if (allowed_domains.find ("all") == allowed_domains.end ()) {
if (allowed_domains.find (a_domain.c_str ()) == allowed_domains.end ()) {
- return false ;
+ return false;
}
}
@@ -283,23 +283,23 @@ struct LogStream::Priv
if (level > s_level_filter) {
return false;
}
- return true ;
+ return true;
}
bool is_logging_allowed ()
{
- return is_logging_allowed (default_domains.front ()) ;
+ return is_logging_allowed (default_domains.front ());
}
void load_enabled_domains_from_env ()
{
- const char *str = g_getenv ("nmv_log_domains") ;
+ const char *str = g_getenv ("nmv_log_domains");
if (!str) {
- str = g_getenv ("NMV_LOG_DOMAINS") ;
+ str = g_getenv ("NMV_LOG_DOMAINS");
}
if (!str) {return;}
- UString domains_str = Glib::locale_to_utf8 (str) ;
- enabled_domains_from_env = domains_str.split_set (" ,") ;
+ UString domains_str = Glib::locale_to_utf8 (str);
+ enabled_domains_from_env = domains_str.split_set (" ,");
}
}
;//end LogStream::Priv
@@ -307,58 +307,58 @@ struct LogStream::Priv
void
LogStream::set_stream_type (enum StreamType a_type)
{
- s_stream_type = a_type ;
+ s_stream_type = a_type;
}
enum LogStream::StreamType
LogStream::get_stream_type ()
{
- return s_stream_type ;
+ return s_stream_type;
}
void
LogStream::set_stream_file_path (const char* a_file_path, long a_len)
{
- UString &file_path = LogStream::Priv::get_stream_file_path_private () ;
- file_path.assign (a_file_path, a_len) ;
+ UString &file_path = LogStream::Priv::get_stream_file_path_private ();
+ file_path.assign (a_file_path, a_len);
}
const char*
LogStream::get_stream_file_path ()
{
- return LogStream::Priv::get_stream_file_path_private ().c_str () ;
+ return LogStream::Priv::get_stream_file_path_private ().c_str ();
}
void
LogStream::set_log_level_filter (enum LogLevel a_level)
{
- s_level_filter = a_level ;
+ s_level_filter = a_level;
}
void
LogStream::set_log_domain_filter (const char* a_domain, long a_len)
{
UString &domain_filter = LogStream::Priv::get_domain_filter_private ();
- domain_filter.assign (a_domain, a_len) ;
+ domain_filter.assign (a_domain, a_len);
}
void
LogStream::activate (bool a_activate)
{
- s_is_active = a_activate ;
+ s_is_active = a_activate;
}
bool
LogStream::is_active ()
{
- return s_is_active ;
+ return s_is_active;
}
LogStream&
LogStream::default_log_stream ()
{
- static LogStream s_default_stream (LOG_LEVEL_NORMAL, NMV_GENERAL_DOMAIN) ;
- return s_default_stream ;
+ static LogStream s_default_stream (LOG_LEVEL_NORMAL, NMV_GENERAL_DOMAIN);
+ return s_default_stream;
}
LogStream::LogStream (enum LogLevel a_level,
@@ -366,35 +366,35 @@ LogStream::LogStream (enum LogLevel a_level,
m_priv (new LogStream::Priv (a_domain))
{
- std::string file_path ;
+ std::string file_path;
if (get_stream_type () == FILE_STREAM) {
m_priv->sink = LogSinkSafePtr
- (new OfstreamLogSink (get_stream_file_path ())) ;
+ (new OfstreamLogSink (get_stream_file_path ()));
} else if (get_stream_type () == COUT_STREAM) {
- m_priv->sink = LogSinkSafePtr (new CoutLogSink) ;
+ m_priv->sink = LogSinkSafePtr (new CoutLogSink);
} else if (get_stream_type () == CERR_STREAM) {
- m_priv->sink = LogSinkSafePtr (new CerrLogSink) ;
+ m_priv->sink = LogSinkSafePtr (new CerrLogSink);
} else {
- g_critical ("LogStream type not supported") ;
- throw Exception ("LogStream type not supported") ;
+ g_critical ("LogStream type not supported");
+ throw Exception ("LogStream type not supported");
}
m_priv->stream_type = get_stream_type ();
- m_priv->level = a_level ;
- m_priv->load_enabled_domains_from_env () ;
+ m_priv->level = a_level;
+ m_priv->load_enabled_domains_from_env ();
- std::vector<UString>::const_iterator d ;
+ std::vector<UString>::const_iterator d;
for (d = m_priv->enabled_domains_from_env.begin ();
d != m_priv->enabled_domains_from_env.end ();
++d) {
- enable_domain (*d) ;
+ enable_domain (*d);
}
}
LogStream::~LogStream ()
{
- LOG_D ("delete", "destructor-domain") ;
- if (!m_priv) throw runtime_error ("double free in LogStrea::~LogStream") ;
- m_priv.reset () ;
+ LOG_D ("delete", "destructor-domain");
+ if (!m_priv) throw runtime_error ("double free in LogStrea::~LogStream");
+ m_priv.reset ();
}
void
@@ -402,9 +402,9 @@ LogStream::enable_domain (const string &a_domain,
bool a_do_enable)
{
if (a_do_enable) {
- m_priv->allowed_domains[a_domain.c_str ()] = true ;
+ m_priv->allowed_domains[a_domain.c_str ()] = true;
} else {
- m_priv->allowed_domains.erase (a_domain.c_str ()) ;
+ m_priv->allowed_domains.erase (a_domain.c_str ());
}
}
@@ -413,49 +413,49 @@ LogStream::is_domain_enabled (const std::string &a_domain)
{
if (m_priv->allowed_domains.find (a_domain.c_str ())
!= m_priv->allowed_domains.end ()) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
LogStream&
LogStream::write (const char* a_buf, long a_buflen, const string &a_domain)
{
if (!m_priv->is_logging_allowed (a_domain))
- return *this ;
+ return *this;
- long len = 0 ;
+ long len = 0;
if (a_buflen > 0) {
- len = a_buflen ;
+ len = a_buflen;
} else {
if (!a_buf)
- len = 0 ;
+ len = 0;
else
- len = strlen (a_buf) ;
+ len = strlen (a_buf);
}
- m_priv->sink->write (a_buf, len) ;
+ m_priv->sink->write (a_buf, len);
if (m_priv->sink->bad ()) {
- cerr << "write failed\n" ;
- throw Exception ("write failed") ;
+ cerr << "write failed\n";
+ throw Exception ("write failed");
}
- return *this ;
+ return *this;
}
LogStream&
LogStream::write (int a_msg, const string &a_domain)
{
if (!m_priv || !m_priv->sink)
- return *this ;
+ return *this;
if (!m_priv->is_logging_allowed (a_domain))
- return *this ;
+ return *this;
*m_priv->sink << a_msg;
if (m_priv->sink->bad ()) {
- cout << "write failed" ;
- throw Exception ("write failed") ;
+ cout << "write failed";
+ throw Exception ("write failed");
}
- return *this ;
+ return *this;
}
LogStream&
@@ -463,17 +463,17 @@ LogStream::write (double a_msg,
const string &a_domain)
{
if (!m_priv || !m_priv->sink)
- return *this ;
+ return *this;
if (!m_priv->is_logging_allowed (a_domain))
- return *this ;
+ return *this;
*m_priv->sink << a_msg;
if (m_priv->sink->bad ()) {
- cout << "write failed" ;
- throw Exception ("write failed") ;
+ cout << "write failed";
+ throw Exception ("write failed");
}
- return *this ;
+ return *this;
}
LogStream&
@@ -481,129 +481,129 @@ LogStream::write (char a_msg,
const string &a_domain)
{
if (!m_priv || !m_priv->sink)
- return *this ;
+ return *this;
if (!m_priv->is_logging_allowed (a_domain))
- return *this ;
+ return *this;
*m_priv->sink << a_msg;
if (m_priv->sink->bad ()) {
- cout << "write failed" ;
- throw Exception ("write failed") ;
+ cout << "write failed";
+ throw Exception ("write failed");
}
- return *this ;
+ return *this;
}
void
LogStream::push_domain (const string &a_domain)
{
- m_priv->default_domains.push_front (a_domain) ;
+ m_priv->default_domains.push_front (a_domain);
}
void
LogStream::pop_domain ()
{
if (m_priv->default_domains.size () <= 1) {
- return ;
+ return;
}
- m_priv->default_domains.pop_front () ;
+ m_priv->default_domains.pop_front ();
}
LogStream&
LogStream::write (const Glib::ustring &a_msg, const string &a_domain)
{
- return write (a_msg.c_str (), a_msg.bytes (), a_domain) ;
+ return write (a_msg.c_str (), a_msg.bytes (), a_domain);
}
LogStream&
LogStream::operator<< (const char* a_c_string)
{
- return write (a_c_string, -1, m_priv->default_domains.front ()) ;
+ return write (a_c_string, -1, m_priv->default_domains.front ());
}
LogStream&
LogStream::operator<< (const std::string &a_string)
{
- return write (a_string.c_str (), -1, m_priv->default_domains.front ()) ;
+ return write (a_string.c_str (), -1, m_priv->default_domains.front ());
}
LogStream&
LogStream::operator<< (const Glib::ustring &a_string)
{
- return write (a_string, m_priv->default_domains.front ()) ;
+ return write (a_string, m_priv->default_domains.front ());
}
LogStream&
LogStream::operator<< (int a_msg)
{
- return write (a_msg, m_priv->default_domains.front ()) ;
+ return write (a_msg, m_priv->default_domains.front ());
}
LogStream&
LogStream::operator<< (double a_msg)
{
- return write (a_msg, m_priv->default_domains.front ()) ;
+ return write (a_msg, m_priv->default_domains.front ());
}
LogStream&
LogStream::operator<< (char a_msg)
{
- return write (a_msg, m_priv->default_domains.front ()) ;
+ return write (a_msg, m_priv->default_domains.front ());
}
LogStream&
LogStream::operator<< (LogStream& (*a_manipulator) (LogStream &))
{
- a_manipulator (*this) ;
- return *this ;
+ a_manipulator (*this);
+ return *this;
}
LogStream&
timestamp (LogStream &a_stream)
{
if (!a_stream.m_priv->is_logging_allowed ())
- return a_stream ;
- UString now_str ;
- dateutils::get_current_datetime (now_str) ;
- a_stream << now_str ;
- return a_stream ;
+ return a_stream;
+ UString now_str;
+ dateutils::get_current_datetime (now_str);
+ a_stream << now_str;
+ return a_stream;
}
LogStream&
flush (LogStream &a_stream)
{
if (!a_stream.m_priv->is_logging_allowed ())
- return a_stream ;
+ return a_stream;
- a_stream.m_priv->sink->flush () ;
- return a_stream ;
+ a_stream.m_priv->sink->flush ();
+ return a_stream;
}
LogStream&
endl (LogStream &a_stream)
{
if (!a_stream.m_priv->is_logging_allowed ())
- return a_stream ;
+ return a_stream;
- a_stream << '\n' ;
- a_stream << flush ;
- return a_stream ;
+ a_stream << '\n';
+ a_stream << flush ;
+ return a_stream;
}
LogStream&
level_normal (LogStream &a_stream)
{
- a_stream.m_priv->level = LogStream::LOG_LEVEL_NORMAL ;
- return a_stream ;
+ a_stream.m_priv->level = LogStream::LOG_LEVEL_NORMAL;
+ return a_stream;
}
LogStream&
level_verbose (LogStream &a_stream)
{
a_stream.m_priv->level = LogStream::LOG_LEVEL_VERBOSE;
- return a_stream ;
+ return a_stream;
}
}//end namespace common
diff --git a/src/common/nmv-log-stream.h b/src/common/nmv-log-stream.h
index abed1c0..5de3f34 100644
--- a/src/common/nmv-log-stream.h
+++ b/src/common/nmv-log-stream.h
@@ -43,7 +43,7 @@
#define NMV_GENERAL_DOMAIN "general-domain"
#endif
-using std::string ;
+using std::string;
namespace nemiver {
namespace common {
@@ -53,14 +53,14 @@ namespace common {
class NEMIVER_API LogStream
{
friend LogStream& timestamp (LogStream &);
- friend LogStream& flush (LogStream &) ;
- friend LogStream& endl (LogStream &) ;
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ friend LogStream& flush (LogStream &);
+ friend LogStream& endl (LogStream &);
+ struct Priv;
+ SafePtr<Priv> m_priv;
//forbid copy/assignation
- LogStream (LogStream const&) ;
- LogStream& operator= (LogStream const&) ;
+ LogStream (LogStream const&);
+ LogStream& operator= (LogStream const&);
protected:
@@ -84,11 +84,11 @@ public:
///(either cout, cerr, or log file). By default, the type of stream is
/// set to COUT_STREAM. All the logs are sent to stdout.
/// \param a_type the type of the log stream
- static void set_stream_type (enum StreamType a_type) ;
+ static void set_stream_type (enum StreamType a_type);
/// \brief gets the type of the instances of #LogStream
/// \return the stream type as set by LogStream::set_stream_type().
- static enum StreamType get_stream_type () ;
+ static enum StreamType get_stream_type ();
/// in the case where the stream type is set to FILE_STREAM,
/// this methods sets the path of the file to log into. By default,
@@ -96,12 +96,12 @@ public:
/// \param a_file_path the log file path.
/// \param a_len the length of the file_path. If <0, it means that a_file_path
/// is a zero terminated string.
- static void set_stream_file_path (const char* a_file_path, long a_len=-1) ;
+ static void set_stream_file_path (const char* a_file_path, long a_len=-1);
/// \brief gets the log file path, in case the stream type is set to
/// FILE_STREAM
/// \return the path to the log file.
- static const char* get_stream_file_path () ;
+ static const char* get_stream_file_path ();
/// \brief sets the log level filter.
/// if the filter is set to LOG_LEVEL_NORMAL, only the log streams that
@@ -111,7 +111,7 @@ public:
/// logging data.
///
/// \param a_level the level of verbosity you want your log streams to have.
- static void set_log_level_filter (enum LogLevel a_level) ;
+ static void set_log_level_filter (enum LogLevel a_level);
/// \brief sets a filter on the log domain
/// only streams that have the same domain as the one set here will
@@ -119,21 +119,21 @@ public:
/// \param a_domain the domain name.
/// \a_len the length of the domain name. If <0, it means that a_domain
/// is a zero terminated string.
- static void set_log_domain_filter (const char* a_domain, long a_len=-1) ;
+ static void set_log_domain_filter (const char* a_domain, long a_len=-1);
/// \brief activate/de-activate the logging.
/// \param a_activate true to activate the logging, false to deactivate.
- static void activate (bool a_activate) ;
+ static void activate (bool a_activate);
/// \brief tests wether the logging is activated or not.
/// \return true if the logging is activated, false otherwise.
- static bool is_active () ;
+ static bool is_active ();
/// \brief gets the log stream instanciated by the system by default.
/// the options of this log stream are the global options set before
/// the first call to this method.
/// \return the log stream instanciated by default.
- static LogStream& default_log_stream () ;
+ static LogStream& default_log_stream ();
/// \brief default constructor of a log stream
@@ -144,20 +144,20 @@ public:
/// its log level is <= to the log level filter, *and* if its domain equals
/// the domain filter.
LogStream (enum LogLevel a_level=LOG_LEVEL_NORMAL,
- const string &a_default_domain=NMV_GENERAL_DOMAIN) ;
+ const string &a_default_domain=NMV_GENERAL_DOMAIN);
/// \brief destructor of the log stream class
- virtual ~LogStream () ;
+ virtual ~LogStream ();
/// \brief enable or disable logging for a domain
/// \param a_domain the domain to enable logging for
/// \param a_do_enable when set to true, enables the logging for domain
/// @a_domain, disable it otherwise.
void enable_domain (const string &a_domain,
- bool a_do_enable=true) ;
+ bool a_do_enable=true);
/// \return true is logging is enabled for domain @a_domain
- bool is_domain_enabled (const string &a_domain) ;
+ bool is_domain_enabled (const string &a_domain);
/// \brief writes a text string to the stream
/// \param a_buf the buffer that contains the text string.
@@ -166,32 +166,32 @@ public:
/// \param a_domain the domain the string has to be logged against.
LogStream& write (const char *a_buf,
long a_buflen =-1,
- const string &a_domain=NMV_GENERAL_DOMAIN) ;
+ const string &a_domain=NMV_GENERAL_DOMAIN);
/// \brief log a message to the stream
/// \param a_msg the message to log
/// \param a_domain the domain to log against
LogStream& write (const Glib::ustring &a_msg,
- const string &a_domain=NMV_GENERAL_DOMAIN) ;
+ const string &a_domain=NMV_GENERAL_DOMAIN);
LogStream& write (int a_msg,
- const string &a_domain=NMV_GENERAL_DOMAIN) ;
+ const string &a_domain=NMV_GENERAL_DOMAIN);
LogStream& write (double a_msg,
- const string &a_domain=NMV_GENERAL_DOMAIN) ;
+ const string &a_domain=NMV_GENERAL_DOMAIN);
LogStream& write (char a_msg,
- const string &a_domain=NMV_GENERAL_DOMAIN) ;
+ const string &a_domain=NMV_GENERAL_DOMAIN);
/// set the domain in against which all the coming
/// messages will be logged.
/// This is to be used in association with the << operators where
/// we cannot specify the domain to log against, unlike LogStream::write() .
/// \param a_domain the domain to log against.
- void push_domain (const string &a_domain) ;
+ void push_domain (const string &a_domain);
/// pops the last domain that has been pushed using LogStream::push_domain.
- void pop_domain () ;
+ void pop_domain ();
/// \brief log zero teriminated strings
/// \param a_string the string to log
@@ -203,54 +203,54 @@ public:
/// \brief log a UTF-8 string
/// \param a_string the string to log
- LogStream& operator<< (const Glib::ustring &a_string) ;
+ LogStream& operator<< (const Glib::ustring &a_string);
/// \brief log an integer
/// \param an_int the integer to log
- LogStream& operator<< (int an_int) ;
+ LogStream& operator<< (int an_int);
/// \brief log a double
/// \param the double to log
- LogStream& operator<< (double a_double) ;
+ LogStream& operator<< (double a_double);
/// \brief log a character
/// \param a_char the char to log
- LogStream& operator<< (char a_char) ;
+ LogStream& operator<< (char a_char);
/// \brief log a stream manipulator
/// \param a_manipulator the LogStream manipulator to log
- LogStream& operator<< (LogStream& (*a_manipulator) (LogStream&)) ;
+ LogStream& operator<< (LogStream& (*a_manipulator) (LogStream&));
- friend LogStream& level_normal (LogStream &a_stream) ;
+ friend LogStream& level_normal (LogStream &a_stream);
- friend LogStream& level_verbose (LogStream &a_stream) ;
+ friend LogStream& level_verbose (LogStream &a_stream);
};//end class LogStream
/// \brief logs a timestamp. Basically the
/// the current date. You use it like:
-/// nemiver::LogStream out ; out << nemiver::timestamp ;
+/// nemiver::LogStream out; out << nemiver::timestamp ;
NEMIVER_API LogStream& timestamp (LogStream&);
/// \brief flushes the stream
-/// Use it like: nemiver::LogStream out ;
-/// out << "Hello" << nemiver::flush ;
-NEMIVER_API LogStream& flush (LogStream &) ;
+/// Use it like: nemiver::LogStream out;
+/// out << "Hello" << nemiver::flush;
+NEMIVER_API LogStream& flush (LogStream &);
/// \brief log a '\\n' and flushes the stream
-/// Use it like: nemiver::LogStream out ;
-/// out << "hello"<< nemiver::endl ;
-NEMIVER_API LogStream& endl (LogStream &) ;
+/// Use it like: nemiver::LogStream out;
+/// out << "hello"<< nemiver::endl;
+NEMIVER_API LogStream& endl (LogStream &);
/// \brief sets the log level to normal
-/// Use it like nemiver::LogStream out ;
-/// out << nemiver::level_normal << "blabla" ;
-NEMIVER_API LogStream& level_normal (LogStream &) ;
+/// Use it like nemiver::LogStream out;
+/// out << nemiver::level_normal << "blabla";
+NEMIVER_API LogStream& level_normal (LogStream &);
/// \brief sets the log level to verbose
-/// Use it lik: nemiver::LogStream out ;
-/// out << nemiver::level_verbose << "bla bla bla" ;
-NEMIVER_API LogStream& level_verbose (LogStream &) ;
+/// Use it lik: nemiver::LogStream out;
+/// out << nemiver::level_verbose << "bla bla bla";
+NEMIVER_API LogStream& level_verbose (LogStream &);
}//end namespace common
}//end namespace nemiver
diff --git a/src/common/nmv-object.cc b/src/common/nmv-object.cc
index d21c2ab..fc1f0d1 100644
--- a/src/common/nmv-object.cc
+++ b/src/common/nmv-object.cc
@@ -32,15 +32,15 @@
#include "nmv-object.h"
#include "nmv-ustring.h"
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
struct ObjectPriv {
- long refcount ;
- bool refcount_enabled ;
- map<UString, const Object*> objects_map ;
+ long refcount;
+ bool refcount_enabled;
+ map<UString, const Object*> objects_map;
ObjectPriv () :
refcount (1),
@@ -56,16 +56,16 @@ Object::Object ():
Object::Object (Object const &a_object):
m_priv (new ObjectPriv ())
{
- *m_priv = *a_object.m_priv ;
+ *m_priv = *a_object.m_priv;
}
Object::Object&
Object::operator= (Object const &a_object)
{
if (this == &a_object)
- return *this ;
- *m_priv = *a_object.m_priv ;
- return *this ;
+ return *this;
+ *m_priv = *a_object.m_priv;
+ return *this;
}
Object::~Object ()
@@ -75,21 +75,21 @@ Object::~Object ()
void
Object::ref ()
{
- if (!is_refcount_enabled ()) {return ;}
- m_priv->refcount ++ ;
+ if (!is_refcount_enabled ()) {return;}
+ m_priv->refcount ++;
}
void
Object::unref ()
{
- if (!is_refcount_enabled ()) {return ;}
+ if (!is_refcount_enabled ()) {return;}
if (m_priv && m_priv->refcount) {
- m_priv->refcount -- ;
+ m_priv->refcount --;
}
if (m_priv && m_priv->refcount <= 0) {
- m_priv.reset () ;
- delete this ;
+ m_priv.reset ();
+ delete this;
}
}
@@ -104,24 +104,24 @@ Object::enable_refcount (bool a_enabled)
bool
Object::is_refcount_enabled () const
{
- bool res (true) ;
+ bool res (true);
if (m_priv) {
- res = m_priv->refcount_enabled ;
+ res = m_priv->refcount_enabled;
}
- return res ;
+ return res;
}
long
Object::get_refcount () const
{
- return m_priv->refcount ;
+ return m_priv->refcount;
}
void
Object::attach_object (const UString &a_key,
const Object *a_object)
{
- m_priv->objects_map[a_key] = a_object ;
+ m_priv->objects_map[a_key] = a_object;
}
bool
@@ -129,12 +129,12 @@ Object::get_attached_object (const UString &a_key,
const Object *&a_object)
{
map<UString, const Object*>::const_iterator it =
- m_priv->objects_map.find (a_key) ;
+ m_priv->objects_map.find (a_key);
if (it == m_priv->objects_map.end ()) {
- return false ;
+ return false;
}
- a_object = it->second ;
- return true ;
+ a_object = it->second;
+ return true;
}
}//end namespace common
diff --git a/src/common/nmv-object.h b/src/common/nmv-object.h
index 657f13c..13e59da 100644
--- a/src/common/nmv-object.h
+++ b/src/common/nmv-object.h
@@ -37,40 +37,40 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
-struct ObjectPriv ;
-class UString ;
+struct ObjectPriv;
+class UString;
class NEMIVER_API Object {
- friend struct ObjectPriv ;
+ friend struct ObjectPriv;
protected:
- SafePtr<ObjectPriv> m_priv ;
+ SafePtr<ObjectPriv> m_priv;
public:
- Object () ;
+ Object ();
- Object (Object const &) ;
+ Object (Object const &);
- Object& operator= (Object const&) ;
+ Object& operator= (Object const&);
- virtual ~Object () ;
+ virtual ~Object ();
- void ref () ;
+ void ref ();
- void unref () ;
+ void unref ();
- void enable_refcount (bool a_enabled=true) ;
+ void enable_refcount (bool a_enabled=true);
- bool is_refcount_enabled () const ;
+ bool is_refcount_enabled () const;
- long get_refcount () const ;
+ long get_refcount () const;
void attach_object (const UString &a_key,
- const Object *a_object) ;
+ const Object *a_object);
bool get_attached_object (const UString &a_key,
- const Object *&a_object) ;
+ const Object *&a_object);
};//end class Object
diff --git a/src/common/nmv-option-utils.cc b/src/common/nmv-option-utils.cc
index c7e04bd..6646810 100644
--- a/src/common/nmv-option-utils.cc
+++ b/src/common/nmv-option-utils.cc
@@ -31,11 +31,11 @@ void
option_desc_to_option (OptionDesc &a_desc,
Glib::OptionEntry &a_entry)
{
- a_entry.set_long_name (a_desc.long_name ()) ;
- a_entry.set_short_name (a_desc.short_name ()) ;
- a_entry.set_description (a_desc.description ()) ;
- a_entry.set_arg_description (a_desc.arg_description ()) ;
- a_entry.set_flags (a_desc.flags ()) ;
+ a_entry.set_long_name (a_desc.long_name ());
+ a_entry.set_short_name (a_desc.short_name ());
+ a_entry.set_description (a_desc.description ());
+ a_entry.set_arg_description (a_desc.arg_description ());
+ a_entry.set_flags (a_desc.flags ());
}
void
@@ -43,11 +43,11 @@ append_options_to_group (OptionDesc *a_descs,
int a_number_of_options,
Glib::OptionGroup &a_group)
{
- Glib::OptionEntry entry ;
+ Glib::OptionEntry entry;
- for (int i = 0 ; i < a_number_of_options ; ++i) {
- option_desc_to_option (a_descs[i], entry) ;
- a_group.add_entry (entry) ;
+ for (int i = 0; i < a_number_of_options ; ++i) {
+ option_desc_to_option (a_descs[i], entry);
+ a_group.add_entry (entry);
}
}
diff --git a/src/common/nmv-option-utils.h b/src/common/nmv-option-utils.h
index 9f360e9..65ce785 100644
--- a/src/common/nmv-option-utils.h
+++ b/src/common/nmv-option-utils.h
@@ -27,17 +27,17 @@
#include <glibmm.h>
#include "nmv-ustring.h"
-using nemiver::common::UString ;
+using nemiver::common::UString;
namespace nemiver {
namespace options_utils {
class OptionDesc {
- UString m_long_name ;
- gchar m_short_name ;
- UString m_description ;
- UString m_arg_description ;
- enum Glib::OptionEntry::Flags m_flags ;
+ UString m_long_name;
+ gchar m_short_name;
+ UString m_description;
+ UString m_arg_description;
+ enum Glib::OptionEntry::Flags m_flags;
public:
OptionDesc () :
@@ -74,11 +74,11 @@ public:
}; //end class OptionDesc
void option_desc_to_option (OptionDesc &a_desc,
- Glib::OptionEntry &a_option) ;
+ Glib::OptionEntry &a_option);
void append_options_to_group (OptionDesc *a_descs,
int a_number_of_options,
- Glib::OptionGroup &a_group) ;
+ Glib::OptionGroup &a_group);
}//end namespace nemiver
}//end namespace options_utils
diff --git a/src/common/nmv-parsing-utils.cc b/src/common/nmv-parsing-utils.cc
index 05448fc..a5eff7d 100644
--- a/src/common/nmv-parsing-utils.cc
+++ b/src/common/nmv-parsing-utils.cc
@@ -30,7 +30,7 @@
#include "nmv-ustring.h"
#include "nmv-parsing-utils.h"
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
@@ -40,9 +40,9 @@ bool
is_digit (gunichar a_char)
{
if (a_char >= '0' && a_char <= '9') {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
bool
@@ -52,7 +52,7 @@ is_alphabet_char (gunichar a_char)
|| (a_char >= 'A' && a_char <= 'Z')) {
return true;
}
- return false ;
+ return false;
}
bool
@@ -64,7 +64,7 @@ is_alnum (gunichar a_char)
|| a_char == '-') {
return true;
}
- return false ;
+ return false;
}
bool
@@ -77,77 +77,77 @@ is_host_name_char (gunichar a_char)
|| a_char == '-') {
return true;
}
- return false ;
+ return false;
}
bool
remove_white_spaces_at_begining (const UString &a_str, UString &a_res)
{
if (a_str == "")
- return false ;
+ return false;
- a_res = "" ;
- UString::const_iterator it = a_str.begin () ;
+ a_res = "";
+ UString::const_iterator it = a_str.begin ();
for (;;) {
if (isspace (*it)) {
- ++it ;
+ ++it;
} else if (it == a_str.end ()) {
- return true ;
+ return true;
} else {
- break ;
+ break;
}
}
if (it == a_str.end ())
- return true ;
+ return true;
for (;;) {
- a_res += *it ;
- ++it ;
+ a_res += *it;
+ ++it;
if (it == a_str.end ())
- return true ;
+ return true;
}
- return true ;
+ return true;
}
bool
remove_white_spaces_at_end (const UString &a_str, UString &a_res)
{
if (a_str == "") {
- return false ;
+ return false;
}
- a_res = "" ;
+ a_res = "";
unsigned int i = a_str.size () - 1;
if (i==0)
- return false ;
+ return false;
while (isspace (a_str[i])) {
- --i ;
+ --i;
if (i==0)
- return true ;
+ return true;
}
if (i==0)
- return true ;
+ return true;
for (;;) {
- a_res.insert (a_res.begin(), a_str[i]) ;
- ;
+ a_res.insert (a_res.begin(), a_str[i]);
+ ;
if (i == 0)
- return true ;
- --i ;
+ return true;
+ --i;
}
- return true ;
+ return true;
}
bool
is_white_string (const UString &a_str)
{
- for (UString::const_iterator it=a_str.begin () ;
- it != a_str.end () ;
+ for (UString::const_iterator it=a_str.begin ();
+ it != a_str.end ();
++it) {
if (!isspace (*it))
- return false ;
+ return false;
}
- return true ;
+ return true;
}
Glib::Date::Month
@@ -188,77 +188,77 @@ month_to_int (Glib::Date::Month a_month)
{
switch (a_month) {
case Glib::Date::JANUARY:
- return 1 ;
+ return 1;
case Glib::Date::FEBRUARY:
- return 2 ;
+ return 2;
case Glib::Date::MARCH:
- return 3 ;
+ return 3;
case Glib::Date::APRIL:
- return 4 ;
+ return 4;
case Glib::Date::MAY:
- return 5 ;
+ return 5;
case Glib::Date::JUNE:
- return 6 ;
+ return 6;
case Glib::Date::JULY:
- return 7 ;
+ return 7;
case Glib::Date::AUGUST:
- return 8 ;
+ return 8;
case Glib::Date::SEPTEMBER:
- return 9 ;
+ return 9;
case Glib::Date::OCTOBER:
- return 10 ;
+ return 10;
case Glib::Date::NOVEMBER:
- return 11 ;
+ return 11;
case Glib::Date::DECEMBER:
- return 12 ;
+ return 12;
default:
THROW ("unawaited month value: "
- + UString::from_int (a_month)) ;
+ + UString::from_int (a_month));
}
- THROW ("we shouldn't reach this point.") ;
+ THROW ("we shouldn't reach this point.");
return -1;
}
UString
date_to_string (const Glib::Date &a_date)
{
- UString result (UString::from_int (a_date.get_year ())) ;
- result += '-' ;
- UString month (UString::from_int (month_to_int (a_date.get_month ()))) ;
+ UString result (UString::from_int (a_date.get_year ()));
+ result += '-';
+ UString month (UString::from_int (month_to_int (a_date.get_month ())));
if (month.size () == 1) {
- month.insert (month.begin (), '0') ;
+ month.insert (month.begin (), '0');
}
- result += month + '-' ;
- UString day (UString::from_int (a_date.get_day ())) ;
+ result += month + '-';
+ UString day (UString::from_int (a_date.get_day ()));
if (day.size () == 1) {
- day.insert (day.begin () , '0') ;
+ day.insert (day.begin () , '0');
}
- result += day ;
- return result ;
+ result += day;
+ return result;
}
bool
string_to_date (const UString &a_str, Glib::Date &a_date)
{
- UString::size_type cur (0), start (0), end (0) ;
- vector<int> date_parts ;
+ UString::size_type cur (0), start (0), end (0);
+ vector<int> date_parts;
- start = cur ;
+ start = cur;
for (;;) {
- if (date_parts.size () == 3) break ;
+ if (date_parts.size () == 3) break;
if (a_str[cur] == '-' || a_str[cur] == ' ' || cur >= a_str.size ()) {
- end = cur ;
+ end = cur;
date_parts.push_back
- (atoi (a_str.substr (start, end - start).c_str ())) ;
- start = cur + 1 ;
+ (atoi (a_str.substr (start, end - start).c_str ()));
+ start = cur + 1;
}
- cur++ ;
+ cur++;
}
- if (date_parts.size () != 3) return false ;
- a_date.set_year (date_parts[0]) ;
- a_date.set_month (month_from_int (date_parts[1])) ;
- a_date.set_day (date_parts[2]) ;
- return true ;
+ if (date_parts.size () != 3) return false;
+ a_date.set_year (date_parts[0]);
+ a_date.set_month (month_from_int (date_parts[1]));
+ a_date.set_day (date_parts[2]);
+ return true;
}
diff --git a/src/common/nmv-parsing-utils.h b/src/common/nmv-parsing-utils.h
index 3a209c2..c303448 100644
--- a/src/common/nmv-parsing-utils.h
+++ b/src/common/nmv-parsing-utils.h
@@ -32,30 +32,30 @@
namespace nemiver {
namespace common {
-class UString ;
+class UString;
namespace parsing_utils
{
-NEMIVER_API bool is_digit (gunichar a_char) ;
-NEMIVER_API bool is_alphabet_char (gunichar a_char) ;
-NEMIVER_API bool is_alnum (gunichar a_char) ;
-NEMIVER_API bool is_host_name_char (gunichar a_char) ;
+NEMIVER_API bool is_digit (gunichar a_char);
+NEMIVER_API bool is_alphabet_char (gunichar a_char);
+NEMIVER_API bool is_alnum (gunichar a_char);
+NEMIVER_API bool is_host_name_char (gunichar a_char);
NEMIVER_API bool remove_white_spaces_at_begining (const UString &a_str,
- UString &a_res) ;
+ UString &a_res);
NEMIVER_API bool remove_white_spaces_at_end (const UString &a_str,
- UString &a_res) ;
+ UString &a_res);
-NEMIVER_API bool is_white_string (const UString &a_str) ;
+NEMIVER_API bool is_white_string (const UString &a_str);
-NEMIVER_API UString date_to_string (const Glib::Date &a_date) ;
+NEMIVER_API UString date_to_string (const Glib::Date &a_date);
-NEMIVER_API int month_to_int (Glib::Date::Month a_month) ;
+NEMIVER_API int month_to_int (Glib::Date::Month a_month);
-NEMIVER_API Glib::Date::Month month_from_int (int a_in) ;
+NEMIVER_API Glib::Date::Month month_from_int (int a_in);
-NEMIVER_API bool string_to_date (const UString &a_str, Glib::Date &a_date) ;
+NEMIVER_API bool string_to_date (const UString &a_str, Glib::Date &a_date);
}//end namespace parsing_utils
}//end namespace common
diff --git a/src/common/nmv-plugin.cc b/src/common/nmv-plugin.cc
index 5f7a02e..d38b6c1 100644
--- a/src/common/nmv-plugin.cc
+++ b/src/common/nmv-plugin.cc
@@ -38,41 +38,41 @@ namespace nemiver {
namespace common {
struct Plugin::EntryPoint::Loader::Priv {
- UString plugin_path ;
+ UString plugin_path;
};//end struct Plugin::EntryPoint::Loader::Priv
Plugin::EntryPoint::Loader::Loader (const UString &a_plugin_path) :
m_priv (new Plugin::EntryPoint::Loader::Priv)
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
- config_search_paths ().clear () ;
+ config_search_paths ().clear ();
if (!Glib::file_test (a_plugin_path, Glib::FILE_TEST_IS_DIR)) {
- THROW ("Couldn't find directory '" + a_plugin_path + "'") ;
+ THROW ("Couldn't find directory '" + a_plugin_path + "'");
}
- config_search_paths ().push_back (a_plugin_path) ;
- m_priv->plugin_path = a_plugin_path ;
+ config_search_paths ().push_back (a_plugin_path);
+ m_priv->plugin_path = a_plugin_path;
}
Plugin::EntryPoint::Loader::~Loader ()
{
- LOG_D ("delete", "destructor-domain") ;
+ LOG_D ("delete", "destructor-domain");
}
const UString&
Plugin::EntryPoint::Loader::plugin_path ()
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->plugin_path ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->plugin_path;
}
//**********************
//<class Plugin::EntryPoint>
//**********************
struct Plugin::EntryPoint::Priv {
- bool is_activated ;
- Plugin::EntryPoint::LoaderSafePtr entry_point_loader ;
- DescriptorSafePtr descriptor ;
+ bool is_activated;
+ Plugin::EntryPoint::LoaderSafePtr entry_point_loader;
+ DescriptorSafePtr descriptor;
Priv () :
is_activated (false)
@@ -83,15 +83,15 @@ struct Plugin::EntryPoint::Priv {
Plugin::EntryPoint::LoaderSafePtr
Plugin::EntryPoint::plugin_entry_point_loader ()
{
- return m_priv->entry_point_loader ;
+ return m_priv->entry_point_loader;
}
void
Plugin::EntryPoint::plugin_entry_point_loader
(Plugin::EntryPoint::LoaderSafePtr &a_loader)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->entry_point_loader = a_loader ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->entry_point_loader = a_loader;
}
Plugin::EntryPoint::EntryPoint (DynamicModuleSafePtr &a_module) :
@@ -108,7 +108,7 @@ Plugin::EntryPoint::EntryPoint (DynamicModule *a_module) :
Plugin::EntryPoint::~EntryPoint ()
{
- LOG_D ("delete", "destructor-domain") ;
+ LOG_D ("delete", "destructor-domain");
}
void
@@ -116,21 +116,21 @@ Plugin::EntryPoint::activate (bool a_activate,
ObjectSafePtr &a_ctxt)
{
if (a_ctxt) {}
- THROW_IF_FAIL (m_priv) ;
- m_priv->is_activated = a_activate ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->is_activated = a_activate;
}
bool
Plugin::EntryPoint::is_activated ()
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->is_activated ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->is_activated;
}
const UString&
Plugin::EntryPoint::plugin_path ()
{
- THROW_IF_FAIL (plugin_entry_point_loader ()) ;
+ THROW_IF_FAIL (plugin_entry_point_loader ());
return plugin_entry_point_loader ()->plugin_path ();
}
@@ -140,31 +140,31 @@ Plugin::EntryPoint::build_absolute_resource_path
(const UString &a_relative_resource_path,
string &a_absolute_path)
{
- string relative_path = Glib::locale_from_utf8 (a_relative_resource_path) ;
- string plugin_dir_path = Glib::locale_from_utf8 (plugin_path ()) ;
- string absolute_path = Glib::build_filename (plugin_dir_path, relative_path) ;
- bool result (false) ;
+ string relative_path = Glib::locale_from_utf8 (a_relative_resource_path);
+ string plugin_dir_path = Glib::locale_from_utf8 (plugin_path ());
+ string absolute_path = Glib::build_filename (plugin_dir_path, relative_path);
+ bool result (false);
if (Glib::file_test (absolute_path,
Glib::FILE_TEST_IS_REGULAR
| Glib::FILE_TEST_EXISTS)) {
- result = true ;
- a_absolute_path = absolute_path ;
+ result = true;
+ a_absolute_path = absolute_path;
}
- return result ;
+ return result;
}
Plugin::DescriptorSafePtr
Plugin::EntryPoint::descriptor ()
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->descriptor ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->descriptor;
}
void
Plugin::EntryPoint::descriptor (Plugin::DescriptorSafePtr &a_desc)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->descriptor = a_desc ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->descriptor = a_desc;
}
@@ -177,9 +177,9 @@ Plugin::EntryPoint::descriptor (Plugin::DescriptorSafePtr &a_desc)
//**********************
struct Plugin::Priv {
- Plugin::EntryPointSafePtr entry_point ;
- Plugin::DescriptorSafePtr descriptor ;
- DynamicModuleManager &module_manager ;
+ Plugin::EntryPointSafePtr entry_point;
+ Plugin::DescriptorSafePtr descriptor;
+ DynamicModuleManager &module_manager;
Priv (Plugin::DescriptorSafePtr &a_desc,
DynamicModuleManager &a_manager) :
@@ -192,7 +192,7 @@ struct Plugin::Priv {
void
Plugin::load_entry_point ()
{
- THROW_IF_FAIL (m_priv && m_priv->descriptor) ;
+ THROW_IF_FAIL (m_priv && m_priv->descriptor);
try {
EntryPoint::LoaderSafePtr loader
@@ -201,20 +201,20 @@ Plugin::load_entry_point ()
m_priv->module_manager.load_iface<Plugin::EntryPoint>
(m_priv->descriptor->entry_point_module_name (),
m_priv->descriptor->entry_point_interface_name(),
- *loader) ;
- THROW_IF_FAIL (m_priv->entry_point) ;
+ *loader);
+ THROW_IF_FAIL (m_priv->entry_point);
LOG_REF_COUNT (m_priv->entry_point,
- m_priv->descriptor->entry_point_interface_name ()) ;
+ m_priv->descriptor->entry_point_interface_name ());
- LOG_REF_COUNT (loader, "plugin-entry-point-loader") ;
- m_priv->entry_point->plugin_entry_point_loader (loader) ;
- LOG_REF_COUNT (loader, "plugin-loader") ;
+ LOG_REF_COUNT (loader, "plugin-entry-point-loader");
+ m_priv->entry_point->plugin_entry_point_loader (loader);
+ LOG_REF_COUNT (loader, "plugin-loader");
- m_priv->entry_point->descriptor (m_priv->descriptor) ;
+ m_priv->entry_point->descriptor (m_priv->descriptor);
} catch (...) {
THROW ("failed to load plugin entry point '"
+ m_priv->descriptor->entry_point_module_name ()
- + " for plugin '" + m_priv->descriptor->name () + "'") ;
+ + " for plugin '" + m_priv->descriptor->name () + "'");
}
}
@@ -222,57 +222,57 @@ Plugin::Plugin (Plugin::DescriptorSafePtr &a_desc,
DynamicModuleManager &a_manager) :
m_priv (new Plugin::Priv (a_desc, a_manager))
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (a_desc) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (a_desc);
THROW_IF_FAIL (Glib::file_test (a_desc->plugin_path (),
- Glib::FILE_TEST_IS_DIR)) ;
- load_entry_point () ;
+ Glib::FILE_TEST_IS_DIR));
+ load_entry_point ();
}
Plugin::~Plugin ()
{
- LOG_D ("delete", "destructor-domain") ;
+ LOG_D ("delete", "destructor-domain");
}
Plugin::DescriptorSafePtr
Plugin::descriptor ()
{
- THROW_IF_FAIL (m_priv && m_priv->descriptor) ;
- return m_priv->descriptor ;
+ THROW_IF_FAIL (m_priv && m_priv->descriptor);
+ return m_priv->descriptor;
}
void
Plugin::descriptor (const Plugin::DescriptorSafePtr &a_desc)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->descriptor = a_desc ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->descriptor = a_desc;
}
Plugin::EntryPoint&
Plugin::entry_point ()
{
- THROW_IF_FAIL (m_priv && m_priv->entry_point) ;
- return *m_priv->entry_point ;
+ THROW_IF_FAIL (m_priv && m_priv->entry_point);
+ return *m_priv->entry_point;
}
Plugin::EntryPointSafePtr
Plugin::entry_point_ptr ()
{
- THROW_IF_FAIL (m_priv && m_priv->entry_point) ;
- return m_priv->entry_point ;
+ THROW_IF_FAIL (m_priv && m_priv->entry_point);
+ return m_priv->entry_point;
}
void
Plugin::activate (bool a_activate,
ObjectSafePtr &a_ctxt)
{
- entry_point ().activate (a_activate, a_ctxt) ;
+ entry_point ().activate (a_activate, a_ctxt);
}
bool
Plugin::is_activated ()
{
- return entry_point ().is_activated () ;
+ return entry_point ().is_activated ();
}
//**********************
@@ -284,10 +284,10 @@ Plugin::is_activated ()
//**********************
struct PluginManager::Priv {
- vector<UString> plugins_search_path ;
- map<UString, UString> deps_descs_loaded ;
- map<UString, PluginSafePtr> plugins_map ;
- DynamicModuleManager &module_manager ;
+ vector<UString> plugins_search_path;
+ map<UString, UString> deps_descs_loaded;
+ map<UString, PluginSafePtr> plugins_map;
+ DynamicModuleManager &module_manager;
Priv (DynamicModuleManager &a_in) :
module_manager (a_in)
@@ -297,32 +297,32 @@ struct PluginManager::Priv {
PluginManager::PluginManager (DynamicModuleManager &a_in) :
m_priv (new PluginManager::Priv (a_in))
{
- plugins_search_path ().push_back (env::get_system_plugins_dir ()) ;
+ plugins_search_path ().push_back (env::get_system_plugins_dir ());
}
PluginManager::~PluginManager ()
{
- LOG_D ("delete", "destructor-domain") ;
+ LOG_D ("delete", "destructor-domain");
}
UString
PluginManager::find_plugin_path_from_name (const UString &a_name)
{
- UString result ;
+ UString result;
- vector<UString>::const_iterator cur_path ;
- string path ;
+ vector<UString>::const_iterator cur_path;
+ string path;
for (cur_path = plugins_search_path ().begin ();
cur_path != plugins_search_path ().end ();
++cur_path) {
path = Glib::build_filename (Glib::locale_from_utf8 (*cur_path),
Glib::locale_from_utf8 (a_name));
if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
- result = Glib::locale_to_utf8 (path) ;
- break ;
+ result = Glib::locale_to_utf8 (path);
+ break;
}
}
- return result ;
+ return result;
}
bool
@@ -332,48 +332,48 @@ PluginManager::parse_descriptor (const UString &a_path,
Plugin::DescriptorSafePtr desc (new Plugin::Descriptor);
if (a_path == "") {
- THROW ("Got path \"\" to modules config file") ;
+ THROW ("Got path \"\" to modules config file");
}
- using libxmlutils::XMLTextReaderSafePtr ;
- using libxmlutils::XMLCharSafePtr ;
+ using libxmlutils::XMLTextReaderSafePtr;
+ using libxmlutils::XMLCharSafePtr;
- XMLTextReaderSafePtr reader ;
- XMLCharSafePtr xml_str ;
+ XMLTextReaderSafePtr reader;
+ XMLCharSafePtr xml_str;
- reader.reset (xmlNewTextReaderFilename (a_path.c_str ())) ;
+ reader.reset (xmlNewTextReaderFilename (a_path.c_str ()));
if (!reader) {
- LOG_ERROR ("could not create xml reader") ;
- return false ;
+ LOG_ERROR ("could not create xml reader");
+ return false;
}
UString dirname =
Glib::locale_to_utf8
- (Glib::path_get_dirname (Glib::locale_from_utf8 (a_path))) ;
+ (Glib::path_get_dirname (Glib::locale_from_utf8 (a_path)));
- desc->plugin_path (dirname) ;
+ desc->plugin_path (dirname);
if (!goto_next_element_node_and_check (reader, "plugindescriptor")) {
- THROW ("first element node should be 'plugindescriptor'") ;
+ THROW ("first element node should be 'plugindescriptor'");
}
xml_str.reset (xmlTextReaderGetAttribute (reader.get (),
- (const xmlChar*)"autoactivate")) ;
- UString autoactivate = xml_str.get () ;
+ (const xmlChar*)"autoactivate"));
+ UString autoactivate = xml_str.get ();
if (autoactivate == "yes") {
- desc->auto_activate (true) ;
+ desc->auto_activate (true);
} else {
- desc->auto_activate (false) ;
+ desc->auto_activate (false);
}
- desc->can_deactivate (true) ;
+ desc->can_deactivate (true);
if (desc->auto_activate ()) {
xml_str.reset (xmlTextReaderGetAttribute (reader.get (),
(const xmlChar*) "candeactivate"));
- UString candeactivate = xml_str.get () ;
+ UString candeactivate = xml_str.get ();
if (candeactivate == "no") {
- desc->can_deactivate (false) ;
+ desc->can_deactivate (false);
}
}
@@ -382,9 +382,9 @@ PluginManager::parse_descriptor (const UString &a_path,
+ UString (xmlTextReaderConstName (reader.get ())));
}
- xml_str.reset (xmlTextReaderReadString (reader.get ())) ;
+ xml_str.reset (xmlTextReaderReadString (reader.get ()));
- desc->name (xml_str.get ()) ;
+ desc->name (xml_str.get ());
if (!goto_next_element_node_and_check (reader, "version")) {
THROW ("expected element 'version', got: "
@@ -392,7 +392,7 @@ PluginManager::parse_descriptor (const UString &a_path,
}
xml_str.reset (xmlTextReaderReadString (reader.get ()));
- desc->version (xml_str.get ()) ;
+ desc->version (xml_str.get ());
if (!goto_next_element_node_and_check (reader, "entrypoint")) {
THROW ("expected element 'entrypoint', got: "
@@ -401,45 +401,45 @@ PluginManager::parse_descriptor (const UString &a_path,
if (!goto_next_element_node_and_check (reader, "modulename")) {
THROW ("expected element 'modulename', got: "
- + UString (xmlTextReaderConstName (reader.get ()))) ;
+ + UString (xmlTextReaderConstName (reader.get ())));
}
xml_str.reset (xmlTextReaderReadString (reader.get ()));
- desc->entry_point_module_name (xml_str.get ()) ;
+ desc->entry_point_module_name (xml_str.get ());
if (!goto_next_element_node_and_check (reader, "interfacename")) {
THROW ("expected element 'interfacename', got: "
- + UString (xmlTextReaderConstName (reader.get ()))) ;
+ + UString (xmlTextReaderConstName (reader.get ())));
}
xml_str.reset (xmlTextReaderReadString (reader.get ()));
- desc->entry_point_interface_name (xml_str.get ()) ;
+ desc->entry_point_interface_name (xml_str.get ());
if (!goto_next_element_node_and_check (reader, "dependencies")) {
THROW ("expected element 'dependencies', got: "
+ UString (xmlTextReaderConstName (reader.get ())));
}
- UString name ;
+ UString name;
for (;;) {
if (!goto_next_element_node_and_check (reader, "plugin")) {
- break ;
+ break;
}
if (!goto_next_element_node_and_check (reader, "name")) {
THROW ("expected element 'name', got: "
+ UString (xmlTextReaderConstName (reader.get ())));
}
- xml_str.reset (xmlTextReaderReadString (reader.get ())) ;
- name = xml_str.get () ;
+ xml_str.reset (xmlTextReaderReadString (reader.get ()));
+ name = xml_str.get ();
if (!goto_next_element_node_and_check (reader, "version")) {
THROW ("expected element 'version', got: "
+ UString (xmlTextReaderConstName (reader.get ())));
}
- xml_str.reset (xmlTextReaderReadString (reader.get ())) ;
- desc->dependencies ()[name] = xml_str.get () ;
+ xml_str.reset (xmlTextReaderReadString (reader.get ()));
+ desc->dependencies ()[name] = xml_str.get ();
}
- a_out = desc ;
+ a_out = desc;
return true;
}
@@ -447,19 +447,19 @@ const UString&
PluginManager::descriptor_name ()
{
static UString s_descriptor_name = "plugin-descriptor.xml";
- return s_descriptor_name ;
+ return s_descriptor_name;
}
bool
PluginManager::load_descriptor_from_plugin_path (const UString &a_plugin_path,
Plugin::DescriptorSafePtr &a_in)
{
- vector<string> path_elements ;
+ vector<string> path_elements;
path_elements.push_back (Glib::locale_from_utf8 (a_plugin_path));
- path_elements.push_back (descriptor_name ()) ;
- string path = Glib::build_filename (path_elements) ;
+ path_elements.push_back (descriptor_name ());
+ string path = Glib::build_filename (path_elements);
if (!Glib::file_test (path, Glib::FILE_TEST_IS_REGULAR)) {
- return false ;
+ return false;
}
return parse_descriptor (Glib::locale_to_utf8 (path), a_in);
}
@@ -468,12 +468,12 @@ bool
PluginManager::load_descriptor_from_plugin_name (const UString &a_name,
Plugin::DescriptorSafePtr &a_out)
{
- THROW_IF_FAIL (a_name != "") ;
+ THROW_IF_FAIL (a_name != "");
- UString path = find_plugin_path_from_name (a_name) ;
+ UString path = find_plugin_path_from_name (a_name);
if (path == "") {return false;}
- return load_descriptor_from_plugin_path (path, a_out) ;
+ return load_descriptor_from_plugin_path (path, a_out);
}
bool
@@ -481,23 +481,23 @@ PluginManager::load_dependant_descriptors
(const Plugin::Descriptor &a_desc,
vector<Plugin::DescriptorSafePtr> &a_descs)
{
- bool result (true) ;
- map<UString, UString>::const_iterator cur_dep ;
- Plugin::DescriptorSafePtr desc ;
- for (cur_dep = a_desc.dependencies ().begin () ;
+ bool result (true);
+ map<UString, UString>::const_iterator cur_dep;
+ Plugin::DescriptorSafePtr desc;
+ for (cur_dep = a_desc.dependencies ().begin ();
cur_dep != a_desc.dependencies ().end ();
++cur_dep) {
if (load_descriptor_from_plugin_name (cur_dep->first, desc)
&& desc) {
- a_descs.push_back (desc) ;
- result = true ;
+ a_descs.push_back (desc);
+ result = true;
} else {
- LOG_ERROR ("Could not load plugin dependency: " + cur_dep->first) ;
- result = false ;
- break ;
+ LOG_ERROR ("Could not load plugin dependency: " + cur_dep->first);
+ result = false;
+ break;
}
}
- return result ;
+ return result;
}
bool
@@ -509,13 +509,13 @@ PluginManager::load_dependant_descriptors_recursive
if (!load_dependant_descriptors (a_desc, deps)) {
LOG_ERROR ("failed to load direct dependent descriptors of module '"
- + a_desc.name () + "'") ;
- return false ;
+ + a_desc.name () + "'");
+ return false;
}
if (deps.empty ()) {return true;}
- vector<Plugin::DescriptorSafePtr>::iterator it ;
+ vector<Plugin::DescriptorSafePtr>::iterator it;
vector<Plugin::DescriptorSafePtr> sub_deps;
for (it = deps.begin ();
it != deps.end ();
@@ -523,21 +523,21 @@ PluginManager::load_dependant_descriptors_recursive
//if an asked dependency has been loaded already, don't load it
if (m_priv->deps_descs_loaded.find ((*it)->name ())
== m_priv->deps_descs_loaded.end ()) {
- m_priv->deps_descs_loaded[(*it)->name ()] = "" ;
+ m_priv->deps_descs_loaded[(*it)->name ()] = "";
} else {
- continue ;
+ continue;
}
if (!load_dependant_descriptors_recursive ((**it), sub_deps)) {
LOG_ERROR ("failed to load deep dependent descriptors of module '"
- + a_desc.name () + "'") ;
- return false ;
+ + a_desc.name () + "'");
+ return false;
}
- a_full_deps.push_back (*it) ;
+ a_full_deps.push_back (*it);
if (sub_deps.empty ()) {
a_full_deps.insert (a_full_deps.end (),
sub_deps.begin (),
- sub_deps.end ()) ;
- sub_deps.clear () ;
+ sub_deps.end ());
+ sub_deps.clear ();
}
}
return true;
@@ -547,80 +547,80 @@ PluginSafePtr
PluginManager::load_plugin_from_path (const UString &a_plugin_path,
vector<PluginSafePtr> &a_deps)
{
- PluginSafePtr result ;
- string path (Glib::locale_from_utf8 (a_plugin_path)) ; ;
+ PluginSafePtr result;
+ string path (Glib::locale_from_utf8 (a_plugin_path)); ;
if (!Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
- LOG_ERROR ("directory '" + a_plugin_path + "does not exist") ;
- return result ;
+ LOG_ERROR ("directory '" + a_plugin_path + "does not exist");
+ return result;
}
- Plugin::DescriptorSafePtr descriptor ;
+ Plugin::DescriptorSafePtr descriptor;
if (!load_descriptor_from_plugin_path (a_plugin_path,
descriptor)
|| !descriptor) {
LOG_ERROR ("couldn't load plugin descriptor for "
- "plugin at path '" + a_plugin_path + "'") ;
- return result ;
+ "plugin at path '" + a_plugin_path + "'");
+ return result;
}
- vector<Plugin::DescriptorSafePtr> dependant_descs ;
+ vector<Plugin::DescriptorSafePtr> dependant_descs;
if (!load_dependant_descriptors_recursive (*descriptor, dependant_descs)) {
LOG_ERROR ("couldn't load plugin descriptor dependances "
"for root descriptor '" + descriptor->name () + "' at '"
- + descriptor->plugin_path () + "'") ;
- return result ;
+ + descriptor->plugin_path () + "'");
+ return result;
}
- UString ppath ;
+ UString ppath;
vector<Plugin::DescriptorSafePtr>::iterator cur_desc;
- vector<PluginSafePtr> dependances ;
- PluginSafePtr plugin ;
+ vector<PluginSafePtr> dependances;
+ PluginSafePtr plugin;
for (cur_desc = dependant_descs.begin ();
cur_desc != dependant_descs.end ();
++cur_desc) {
try {
- THROW_IF_FAIL (*cur_desc) ;
- ppath = (*cur_desc)->plugin_path () ;
+ THROW_IF_FAIL (*cur_desc);
+ ppath = (*cur_desc)->plugin_path ();
if (plugins_map ().find (ppath) != plugins_map ().end ()) {
- plugin = plugins_map ()[ppath] ;
+ plugin = plugins_map ()[ppath];
} else {
- plugin.reset (new Plugin (*cur_desc, m_priv->module_manager)) ;
- plugins_map ()[ppath] = plugin ;
+ plugin.reset (new Plugin (*cur_desc, m_priv->module_manager));
+ plugins_map ()[ppath] = plugin;
}
} catch (...) {
LOG_ERROR ("Failed to load dependant plugin '"
- + (*cur_desc)->name () + "'") ;
- return result ;
+ + (*cur_desc)->name () + "'");
+ return result;
}
- dependances.push_back (plugin) ;
+ dependances.push_back (plugin);
}
try {
- ppath = descriptor->plugin_path () ;
+ ppath = descriptor->plugin_path ();
if (plugins_map ().find (ppath) != plugins_map ().end ()) {
- plugin = plugins_map ()[ppath] ;
+ plugin = plugins_map ()[ppath];
} else {
- plugin.reset (new Plugin (descriptor, m_priv->module_manager)) ;
- plugins_map ()[ppath] = plugin ;
+ plugin.reset (new Plugin (descriptor, m_priv->module_manager));
+ plugins_map ()[ppath] = plugin;
}
} catch (...) {
- LOG_ERROR ("failed to load plugin '" + descriptor->name () + "'") ;
- return result ;
+ LOG_ERROR ("failed to load plugin '" + descriptor->name () + "'");
+ return result;
}
- a_deps = dependances ;
- result = plugin ;
+ a_deps = dependances;
+ result = plugin;
if (result) {
LOG_D ("plugin '"
<< a_plugin_path
<< "' refcount: "
<< (int) result->get_refcount (),
- "refcount-domain") ;
+ "refcount-domain");
}
LOG_D ("loaded plugin from path " << Glib::locale_from_utf8 (a_plugin_path),
- "plugin-loading-domain") ;
- return result ;
+ "plugin-loading-domain");
+ return result;
}
PluginSafePtr
@@ -629,23 +629,23 @@ PluginManager::load_plugin_from_name (const UString &a_name,
{
PluginSafePtr result;
- vector<UString>::const_iterator cur_path ;
- vector<string> path_elements ;
- string plugin_path ;
+ vector<UString>::const_iterator cur_path;
+ vector<string> path_elements;
+ string plugin_path;
for (cur_path = plugins_search_path ().begin ();
cur_path != plugins_search_path ().end ();
++cur_path)
{
- path_elements.clear () ;
- path_elements.push_back (Glib::locale_from_utf8 (*cur_path)) ;
- path_elements.push_back (Glib::locale_from_utf8 (a_name)) ;
- plugin_path = Glib::build_filename (path_elements) ;
+ path_elements.clear ();
+ path_elements.push_back (Glib::locale_from_utf8 (*cur_path));
+ path_elements.push_back (Glib::locale_from_utf8 (a_name));
+ plugin_path = Glib::build_filename (path_elements);
if (!Glib::file_test (plugin_path, Glib::FILE_TEST_IS_DIR)) {
- continue ;
+ continue;
}
try {
result = load_plugin_from_path (Glib::locale_to_utf8 (plugin_path),
- a_deps) ;
+ a_deps);
} catch (...) {}
if (result) {
@@ -653,63 +653,63 @@ PluginManager::load_plugin_from_name (const UString &a_name,
<< a_name
<< "' refcount: "
<< (int) result->get_refcount (),
- "refcount-domain") ;
+ "refcount-domain");
break;
}
}
LOG_D ("loaded plugin " << Glib::locale_from_utf8 (a_name),
- "plugin-loading-domain") ;
- return result ;
+ "plugin-loading-domain");
+ return result;
}
vector<UString>&
PluginManager::plugins_search_path ()
{
- return m_priv->plugins_search_path ;
+ return m_priv->plugins_search_path;
}
bool
PluginManager::load_plugins ()
{
- PluginSafePtr plugin ;
- vector<PluginSafePtr> dependances ;
+ PluginSafePtr plugin;
+ vector<PluginSafePtr> dependances;
- vector<UString>::const_iterator cur_dir ;
- string path ;
+ vector<UString>::const_iterator cur_dir;
+ string path;
for (cur_dir = plugins_search_path ().begin ();
cur_dir != plugins_search_path ().end ();
++cur_dir) {
try {
- Glib::Dir opened_dir (*cur_dir) ;
+ Glib::Dir opened_dir (*cur_dir);
for (Glib::DirIterator it = opened_dir.begin ();
it != opened_dir.end ();
++it) {
- path = Glib::build_filename (*cur_dir, *it) ;
+ path = Glib::build_filename (*cur_dir, *it);
if (plugins_map ().find (Glib::locale_to_utf8 (path))
!= plugins_map ().end ()) {
continue;
}
plugin = load_plugin_from_path (Glib::locale_to_utf8 (path),
- dependances) ;
+ dependances);
if (plugin) {
LOG_D ("plugin '"
<< path
<< "' put in map. Refcount: "
<< (int) plugin->get_refcount (),
- "refcount-domain") ;
+ "refcount-domain");
}
}
} catch (...) {
- continue ;
+ continue;
}
}
- return true ;
+ return true;
}
map<UString, PluginSafePtr>&
PluginManager::plugins_map ()
{
- return m_priv->plugins_map ;
+ return m_priv->plugins_map;
}
//***********************
diff --git a/src/common/nmv-plugin.h b/src/common/nmv-plugin.h
index 92bd7e7..9e93858 100644
--- a/src/common/nmv-plugin.h
+++ b/src/common/nmv-plugin.h
@@ -38,58 +38,58 @@
#include "nmv-safe-ptr-utils.h"
#include "nmv-dynamic-module.h"
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
-class PluginManager ;
-typedef SafePtr<PluginManager, ObjectRef, ObjectUnref> PluginManagerSafePtr ;
+class PluginManager;
+typedef SafePtr<PluginManager, ObjectRef, ObjectUnref> PluginManagerSafePtr;
-class Plugin ;
-typedef SafePtr<Plugin, ObjectRef, ObjectUnref> PluginSafePtr ;
+class Plugin;
+typedef SafePtr<Plugin, ObjectRef, ObjectUnref> PluginSafePtr;
class NEMIVER_API Plugin : public Object {
public:
class Descriptor;
- typedef SafePtr<Descriptor, ObjectRef, ObjectUnref> DescriptorSafePtr ;
+ typedef SafePtr<Descriptor, ObjectRef, ObjectUnref> DescriptorSafePtr;
- class EntryPoint ;
+ class EntryPoint;
typedef SafePtr<EntryPoint, ObjectRef, ObjectUnref> EntryPointSafePtr;
private:
- friend class PluginManager ;
+ friend class PluginManager;
- struct Priv ;
+ struct Priv;
SafePtr<Priv> m_priv;
//non copyable
- Plugin (const Plugin &) ;
- Plugin& operator= (const Plugin &) ;
+ Plugin (const Plugin &);
+ Plugin& operator= (const Plugin &);
//forbid default constructor
- Plugin () ;
+ Plugin ();
private:
Plugin (DescriptorSafePtr &a_descriptor,
- DynamicModuleManager &a_bootstrap_module_manager) ;
+ DynamicModuleManager &a_bootstrap_module_manager);
- void load_entry_point () ;
+ void load_entry_point ();
public:
class Descriptor : public Object {
- bool m_auto_activate ;
- bool m_can_deactivate ;
- UString m_name ;
- UString m_version ;
- UString m_plugin_path ;
- UString m_entry_point_module_name ;
- UString m_entry_point_interface_name ;
+ bool m_auto_activate;
+ bool m_can_deactivate;
+ UString m_name;
+ UString m_version;
+ UString m_plugin_path;
+ UString m_entry_point_module_name;
+ UString m_entry_point_interface_name;
//map of deps, made of plugin/versions
- std::map<UString, UString> m_dependencies ;
+ std::map<UString, UString> m_dependencies;
public:
@@ -145,37 +145,37 @@ public:
public:
class NEMIVER_API EntryPoint : public DynModIface {
- friend class Plugin ;
+ friend class Plugin;
public:
- class Loader ;
- typedef SafePtr<Loader, ObjectRef, ObjectUnref> LoaderSafePtr ;
+ class Loader;
+ typedef SafePtr<Loader, ObjectRef, ObjectUnref> LoaderSafePtr;
private:
- friend class PluginManager ;
- class Priv ;
- SafePtr<Priv> m_priv ;
+ friend class PluginManager;
+ class Priv;
+ SafePtr<Priv> m_priv;
//non copyable
- EntryPoint (const EntryPoint &) ;
- EntryPoint& operator= (const EntryPoint &) ;
- EntryPoint () ;
+ EntryPoint (const EntryPoint &);
+ EntryPoint& operator= (const EntryPoint &);
+ EntryPoint ();
protected:
- Plugin::EntryPoint::LoaderSafePtr plugin_entry_point_loader () ;
- void plugin_entry_point_loader (Plugin::EntryPoint::LoaderSafePtr &) ;
+ Plugin::EntryPoint::LoaderSafePtr plugin_entry_point_loader ();
+ void plugin_entry_point_loader (Plugin::EntryPoint::LoaderSafePtr &);
//must be created by a factory
- EntryPoint (DynamicModuleSafePtr &a_module) ;
- EntryPoint (DynamicModule *a_module) ;
+ EntryPoint (DynamicModuleSafePtr &a_module);
+ EntryPoint (DynamicModule *a_module);
virtual void activate (bool a_activate,
- ObjectSafePtr &a_activation_context) ;
- virtual bool is_activated () ;
+ ObjectSafePtr &a_activation_context);
+ virtual bool is_activated ();
- const UString& plugin_path () ;
+ const UString& plugin_path ();
- void descriptor (DescriptorSafePtr &a_desc) ;
+ void descriptor (DescriptorSafePtr &a_desc);
public:
@@ -183,62 +183,62 @@ public:
std::string &a_absolute_path);
class NEMIVER_API Loader : public DynamicModule::Loader {
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
- Loader () ;
+ Loader ();
public:
- Loader (const UString &a_plugin_path) ;
- virtual ~Loader () ;
- const UString& plugin_path () ;
+ Loader (const UString &a_plugin_path);
+ virtual ~Loader ();
+ const UString& plugin_path ();
};//end Loader
- virtual ~EntryPoint () ;
- DescriptorSafePtr descriptor () ;
+ virtual ~EntryPoint ();
+ DescriptorSafePtr descriptor ();
};//end class EntryPoint
- virtual ~Plugin () ;
- DescriptorSafePtr descriptor () ;
- void descriptor (const DescriptorSafePtr &a_desc) ;
- EntryPoint& entry_point () ;
- EntryPointSafePtr entry_point_ptr () ;
- void activate (bool a_activate, ObjectSafePtr &a_activation_context) ;
- bool is_activated () ;
+ virtual ~Plugin ();
+ DescriptorSafePtr descriptor ();
+ void descriptor (const DescriptorSafePtr &a_desc);
+ EntryPoint& entry_point ();
+ EntryPointSafePtr entry_point_ptr ();
+ void activate (bool a_activate, ObjectSafePtr &a_activation_context);
+ bool is_activated ();
};//end class Plugin
class NEMIVER_API PluginManager : public Object {
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
- UString find_plugin_path_from_name (const UString &a_name) ;
+ UString find_plugin_path_from_name (const UString &a_name);
bool parse_descriptor (const UString &a_path,
- Plugin::DescriptorSafePtr &a_out) ;
- static const UString& descriptor_name () ;
+ Plugin::DescriptorSafePtr &a_out);
+ static const UString& descriptor_name ();
bool load_descriptor_from_plugin_path (const UString &a_plugin_path,
- Plugin::DescriptorSafePtr &a_out) ;
+ Plugin::DescriptorSafePtr &a_out);
bool load_descriptor_from_plugin_name (const UString &a_name,
- Plugin::DescriptorSafePtr &a_out) ;
+ Plugin::DescriptorSafePtr &a_out);
bool load_dependant_descriptors
(const Plugin::Descriptor &a_desc,
- std::vector<Plugin::DescriptorSafePtr> &a_descs) ;
+ std::vector<Plugin::DescriptorSafePtr> &a_descs);
bool load_dependant_descriptors_recursive
(const Plugin::Descriptor &a_desc,
- std::vector<Plugin::DescriptorSafePtr> &) ;
+ std::vector<Plugin::DescriptorSafePtr> &);
public:
- PluginManager (DynamicModuleManager &a_module_manager) ;
+ PluginManager (DynamicModuleManager &a_module_manager);
- virtual ~PluginManager () ;
+ virtual ~PluginManager ();
PluginSafePtr load_plugin_from_path
(const UString &a_plugin_path,
- std::vector<PluginSafePtr> &a_deps) ;
+ std::vector<PluginSafePtr> &a_deps);
PluginSafePtr load_plugin_from_name (const UString &a_name,
- std::vector<PluginSafePtr> &a_deps) ;
- bool load_plugins () ;
- std::vector<UString>& plugins_search_path () ;
- void entry_point_loader (Plugin::EntryPoint::LoaderSafePtr &a_loader) ;
- Plugin::EntryPoint::LoaderSafePtr entry_point_loader () ;
- std::map<UString, PluginSafePtr>& plugins_map () ;
+ std::vector<PluginSafePtr> &a_deps);
+ bool load_plugins ();
+ std::vector<UString>& plugins_search_path ();
+ void entry_point_loader (Plugin::EntryPoint::LoaderSafePtr &a_loader);
+ Plugin::EntryPoint::LoaderSafePtr entry_point_loader ();
+ std::map<UString, PluginSafePtr>& plugins_map ();
};//end class PluginManager
}//end namespace common
diff --git a/src/common/nmv-proc-mgr.cc b/src/common/nmv-proc-mgr.cc
index 5f5adeb..cb9292a 100644
--- a/src/common/nmv-proc-mgr.cc
+++ b/src/common/nmv-proc-mgr.cc
@@ -39,18 +39,18 @@ NEMIVER_BEGIN_NAMESPACE (common)
class ProcMgr : public IProcMgr {
//non copyable
- ProcMgr (const ProcMgr &) ;
- ProcMgr& operator= (const ProcMgr &) ;
+ ProcMgr (const ProcMgr &);
+ ProcMgr& operator= (const ProcMgr &);
- mutable list<Process> m_process_list ;
- friend class IProcMgr ;
+ mutable list<Process> m_process_list;
+ friend class IProcMgr;
protected:
- ProcMgr () ;
+ ProcMgr ();
public:
- virtual ~ProcMgr () ;
- const list<Process>& get_all_process_list () const ;
+ virtual ~ProcMgr ();
+ const list<Process>& get_all_process_list () const ;
bool get_process_from_pid (pid_t a_pid,
Process &a_process) const;
bool get_process_from_name (const UString &a_pname,
@@ -61,19 +61,19 @@ public:
struct LibgtopInit {
LibgtopInit ()
{
- glibtop_init () ;
+ glibtop_init ();
}
~LibgtopInit ()
{
- glibtop_close () ;
+ glibtop_close ();
}
};//end struct LibgtopInit
ProcMgr::ProcMgr ()
{
//init libgtop.
- static LibgtopInit s_init ;
+ static LibgtopInit s_init;
}
ProcMgr::~ProcMgr ()
@@ -83,11 +83,11 @@ ProcMgr::~ProcMgr ()
const list<ProcMgr::Process>&
ProcMgr::get_all_process_list () const
{
- glibtop_proclist buf_desc ;
- memset (&buf_desc, 0, sizeof (buf_desc)) ;
+ glibtop_proclist buf_desc;
+ memset (&buf_desc, 0, sizeof (buf_desc));
pid_t *pids=NULL;
- m_process_list.clear () ;
+ m_process_list.clear ();
try {
//get the list of pids
@@ -95,85 +95,85 @@ ProcMgr::get_all_process_list () const
//since I have to support one version of glibtop_get_proclist()
//that returns an int* and one that returns pid_t*
pids = (pid_t*) glibtop_get_proclist (&buf_desc,
- GLIBTOP_KERN_PROC_ALL, 0) ;
+ GLIBTOP_KERN_PROC_ALL, 0) ;
//get a couple of info about each pocess
- for (unsigned i=0 ; i < buf_desc.number ; ++i) {
- Process process ;
- bool got_process = get_process_from_pid (pids[i], process) ;
- THROW_IF_FAIL (got_process) ;
- m_process_list.push_back (process) ;
+ for (unsigned i=0; i < buf_desc.number ; ++i) {
+ Process process;
+ bool got_process = get_process_from_pid (pids[i], process);
+ THROW_IF_FAIL (got_process);
+ m_process_list.push_back (process);
}
} catch (...) {
}
if (pids) {
- g_free (pids) ;
- pids=NULL ;
+ g_free (pids);
+ pids=NULL;
}
- return m_process_list ;
+ return m_process_list;
}
IProcMgrSafePtr
IProcMgr::create ()
{
- IProcMgrSafePtr result (new ProcMgr) ;
- return result ;
+ IProcMgrSafePtr result (new ProcMgr);
+ return result;
}
bool
ProcMgr::get_process_from_pid (pid_t a_pid,
IProcMgr::Process &a_process) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- LOG_DD ("a_pid: " << (int) a_pid) ;
+ LOG_DD ("a_pid: " << (int) a_pid);
Process process (a_pid);
//get the process arguments
- glibtop_proc_args process_args_desc ;
- memset (&process_args_desc, 0, sizeof (process_args_desc)) ;
- char **argv = glibtop_get_proc_argv (&process_args_desc, a_pid, 1024) ;
- char **cur_arg = argv ;
+ glibtop_proc_args process_args_desc;
+ memset (&process_args_desc, 0, sizeof (process_args_desc));
+ char **argv = glibtop_get_proc_argv (&process_args_desc, a_pid, 1024);
+ char **cur_arg = argv;
while (cur_arg && *cur_arg) {
process.args ().push_back
- (UString (Glib::locale_to_utf8 (*cur_arg))) ;
- ++cur_arg ;
+ (UString (Glib::locale_to_utf8 (*cur_arg)));
+ ++cur_arg;
}
if (argv) {
- g_strfreev (argv) ;
- argv=NULL ;
+ g_strfreev (argv);
+ argv=NULL;
} else {
LOG_DD ("got null process args, "
"it means there is no process with pid: '"
- << (int) a_pid << "'. Bailing out.") ;
+ << (int) a_pid << "'. Bailing out.");
return false;
}
//the the process ppid and uid, euid and user_name.
- glibtop_proc_uid proc_info ;
- memset (&proc_info, 0, sizeof (proc_info)) ;
- glibtop_get_proc_uid (&proc_info, process.pid ()) ;
- process.ppid (proc_info.ppid) ;
- process.uid (proc_info.uid) ;
- process.euid (proc_info.uid) ;
- struct passwd *passwd_info=NULL ;
- passwd_info = getpwuid (process.uid ()) ;
+ glibtop_proc_uid proc_info;
+ memset (&proc_info, 0, sizeof (proc_info));
+ glibtop_get_proc_uid (&proc_info, process.pid ());
+ process.ppid (proc_info.ppid);
+ process.uid (proc_info.uid);
+ process.euid (proc_info.uid);
+ struct passwd *passwd_info=NULL;
+ passwd_info = getpwuid (process.uid ());
if (passwd_info) {
- process.user_name (passwd_info->pw_name) ;
+ process.user_name (passwd_info->pw_name);
}
//no need to free(passwd_info).
- a_process = process ;
- LOG_DD ("got process with pid '" << (int) a_pid << "' okay.") ;
+ a_process = process;
+ LOG_DD ("got process with pid '" << (int) a_pid << "' okay.");
return true;
}
class HasSameName {
- UString m_name ;
- bool m_fuzzy ;
+ UString m_name;
+ bool m_fuzzy;
- HasSameName () ;
+ HasSameName ();
public:
HasSameName (const UString &a_name,
@@ -186,7 +186,7 @@ public:
bool operator() (const IProcMgr::Process &a_process)
{
if (a_process.args ().empty ()) {return false;}
- UString pname = *(a_process.args ().begin ()) ;
+ UString pname = *(a_process.args ().begin ());
if (m_fuzzy) {
if (pname.lowercase ().find (m_name) != UString::npos) {return true;}
} else {
@@ -201,31 +201,31 @@ ProcMgr::get_process_from_name (const UString &a_pname,
IProcMgr::Process &a_process,
bool a_fuzzy_search) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- LOG_DD ("a_pname: '" << a_pname << "'") ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ LOG_DD ("a_pname: '" << a_pname << "'");
if (a_pname == "") {return false;}
- const list<Process>& processes = get_all_process_list () ;
+ const list<Process>& processes = get_all_process_list ();
- list<Process>::const_iterator it ;
+ list<Process>::const_iterator it;
if (a_fuzzy_search) {
it = std::find_if (processes.begin (),
processes.end (),
- HasSameName (a_pname, true)) ;
+ HasSameName (a_pname, true));
} else {
it = std::find_if (processes.begin (),
processes.end (),
- HasSameName (a_pname)) ;
+ HasSameName (a_pname));
}
if (it == processes.end ()) {
- LOG_DD ("didn't find any process with name: '" << a_pname << "'") ;
- return false ;
+ LOG_DD ("didn't find any process with name: '" << a_pname << "'");
+ return false;
}
- a_process = *it ;
+ a_process = *it;
LOG_DD ("found process with name: '"
<< a_pname
<< "', with pid: '"
- << (int) a_process.pid ()) ;
- return true ;
+ << (int) a_process.pid ());
+ return true;
}
NEMIVER_END_NAMESPACE (common)
diff --git a/src/common/nmv-proc-mgr.h b/src/common/nmv-proc-mgr.h
index 2a525d0..7353cb5 100644
--- a/src/common/nmv-proc-mgr.h
+++ b/src/common/nmv-proc-mgr.h
@@ -33,23 +33,23 @@
#include "nmv-ustring.h"
#include "nmv-safe-ptr-utils.h"
-using std::list ;
-using nemiver::common::UString ;
-using nemiver::common::Object ;
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::SafePtr ;
+using std::list;
+using nemiver::common::UString;
+using nemiver::common::Object;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::SafePtr;
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
-class IProcMgr ;
-typedef SafePtr<IProcMgr, ObjectRef, ObjectUnref> IProcMgrSafePtr ;
+class IProcMgr;
+typedef SafePtr<IProcMgr, ObjectRef, ObjectUnref> IProcMgrSafePtr;
class NEMIVER_API IProcMgr : public Object {
//non copyable
- IProcMgr (const IProcMgr &) ;
- IProcMgr& operator= (const IProcMgr &) ;
+ IProcMgr (const IProcMgr &);
+ IProcMgr& operator= (const IProcMgr &);
protected:
IProcMgr () {}
@@ -57,12 +57,12 @@ protected:
public:
class Process {
- unsigned int m_pid ;
- unsigned int m_ppid ;
- unsigned int m_uid ;
- unsigned int m_euid ;
- UString m_user_name ;
- list<UString> m_args ;
+ unsigned int m_pid;
+ unsigned int m_ppid;
+ unsigned int m_uid;
+ unsigned int m_euid;
+ UString m_user_name;
+ list<UString> m_args;
public:
@@ -113,14 +113,14 @@ public:
&& ppid () == an_other.ppid ()
&& uid () == an_other.uid ()
&& euid () == an_other.euid ()) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
};//end class Process
virtual ~IProcMgr () {}
- static IProcMgrSafePtr create () ;
+ static IProcMgrSafePtr create ();
virtual const list<Process>& get_all_process_list () const = 0;
virtual bool get_process_from_pid (pid_t a_pid,
Process &a_process) const = 0;
diff --git a/src/common/nmv-proc-utils.cc b/src/common/nmv-proc-utils.cc
index a6ef190..32e70b6 100644
--- a/src/common/nmv-proc-utils.cc
+++ b/src/common/nmv-proc-utils.cc
@@ -58,16 +58,16 @@ launch_program (const std::vector<UString> &a_args,
int &a_stdout_fd,
int &a_stderr_fd)
{
- RETURN_VAL_IF_FAIL (!a_args.empty (), false) ;
+ RETURN_VAL_IF_FAIL (!a_args.empty (), false);
//logging stuff
- UString str ;
+ UString str;
for (std::vector<UString>::const_iterator it=a_args.begin ();
it != a_args.end ();
++it) {
- str += *it + " " ;
+ str += *it + " ";
}
- LOG_D ("launching program with args: '" << str << "'", NMV_DEFAULT_DOMAIN) ;
+ LOG_D ("launching program with args: '" << str << "'", NMV_DEFAULT_DOMAIN);
enum ReadWritePipe {
READ_PIPE=0,
@@ -75,91 +75,91 @@ launch_program (const std::vector<UString> &a_args,
};
int stdout_pipes[2] = {0};
- int stderr_pipes[2]= {0} ;
- //int stdin_pipes[2]= {0} ;
- int master_pty_fd (0) ;
+ int stderr_pipes[2]= {0};
+ //int stdin_pipes[2]= {0};
+ int master_pty_fd (0);
- RETURN_VAL_IF_FAIL (pipe (stdout_pipes) == 0, false) ;
+ RETURN_VAL_IF_FAIL (pipe (stdout_pipes) == 0, false);
//argh, this line leaks the preceding pipes if it fails
- RETURN_VAL_IF_FAIL (pipe (stderr_pipes) == 0, false) ;
- //RETURN_VAL_IF_FAIL (pipe (stdin_pipes) == 0, false) ;
+ RETURN_VAL_IF_FAIL (pipe (stderr_pipes) == 0, false);
+ //RETURN_VAL_IF_FAIL (pipe (stdin_pipes) == 0, false);
- char pts_name[256]={0} ;
+ char pts_name[256]={0};
int pid = forkpty (&master_pty_fd, pts_name, NULL, NULL);
LOG_DD ("process forked. pts_name: '"
- << pts_name << "', pid: '" << pid << "'") ;
+ << pts_name << "', pid: '" << pid << "'");
- //int pid = fork () ;
+ //int pid = fork ();
if (pid == 0) {
//in the child process
//*******************************************
//wire stderr to stderr_pipes[WRITE_PIPE] pipe
//******************************************
- close (2) ;
+ close (2);
int res = dup (stderr_pipes[WRITE_PIPE]);
RETURN_VAL_IF_FAIL (res > 0, false);
//*******************************************
//wire stdout to stdout_pipes[WRITE_PIPE] pipe
//******************************************
- close (1) ;
- res = dup (stdout_pipes[WRITE_PIPE]) ;
+ close (1);
+ res = dup (stdout_pipes[WRITE_PIPE]);
RETURN_VAL_IF_FAIL (res > 0, false);
//*****************************
//close the unnecessary pipes
//****************************
- close (stderr_pipes[READ_PIPE]) ;
- close (stdout_pipes[READ_PIPE]) ;
- //close (stdin_pipes[WRITE_PIPE]) ;
+ close (stderr_pipes[READ_PIPE]);
+ close (stdout_pipes[READ_PIPE]);
+ //close (stdin_pipes[WRITE_PIPE]);
//**********************************************
//configure the pipes to be to have no buffering
//*********************************************
- int state_flag (0) ;
+ int state_flag (0);
if ((state_flag = fcntl (stdout_pipes[WRITE_PIPE],
F_GETFL)) != -1) {
fcntl (stdout_pipes[WRITE_PIPE],
F_SETFL,
- O_SYNC | state_flag) ;
+ O_SYNC | state_flag);
}
if ((state_flag = fcntl (stderr_pipes[WRITE_PIPE],
F_GETFL)) != -1) {
fcntl (stderr_pipes[WRITE_PIPE],
F_SETFL,
- O_SYNC | state_flag) ;
+ O_SYNC | state_flag);
}
std::auto_ptr<char *> args;
- args.reset (new char* [a_args.size () + 1]) ;
+ args.reset (new char* [a_args.size () + 1]);
memset (args.get (), 0,
- sizeof (char*) * (a_args.size () + 1)) ;
+ sizeof (char*) * (a_args.size () + 1));
if (!args.get ()) {
- exit (-1) ;
+ exit (-1);
}
- std::vector<UString>::const_iterator iter ;
- unsigned int i (0) ;
- for (i=0 ; i < a_args.size () ; ++i) {
+ std::vector<UString>::const_iterator iter;
+ unsigned int i (0);
+ for (i=0; i < a_args.size () ; ++i) {
args.get ()[i] =
const_cast<char*> (a_args[i].c_str ());
}
- execvp (args.get ()[0], args.get ()) ;
- exit (-1) ;
+ execvp (args.get ()[0], args.get ());
+ exit (-1);
} else if (pid > 0) {
//in the parent process
//**************************
//close the useless pipes
//*************************
- close (stderr_pipes[WRITE_PIPE]) ;
- close (stdout_pipes[WRITE_PIPE]) ;
- //close (stdin_pipes[READ_PIPE]) ;
+ close (stderr_pipes[WRITE_PIPE]);
+ close (stdout_pipes[WRITE_PIPE]);
+ //close (stdin_pipes[READ_PIPE]);
//****************************************
//configure the pipes to be non blocking
//****************************************
- int state_flag (0) ;
+ int state_flag (0);
if ((state_flag = fcntl (stdout_pipes[READ_PIPE], F_GETFL)) != -1) {
fcntl (stdout_pipes[READ_PIPE], F_SETFL, O_NONBLOCK|state_flag);
}
@@ -187,18 +187,18 @@ launch_program (const std::vector<UString> &a_args,
|IEXTEN | NOFLSH | TOSTOP);
cfsetospeed(&termios_flags, __MAX_BAUD);
tcsetattr(master_pty_fd, TCSANOW, &termios_flags);
- a_pid = pid ;
- a_master_pty_fd = master_pty_fd ;
- a_stdout_fd = stdout_pipes[READ_PIPE] ;
- a_stderr_fd = stderr_pipes[READ_PIPE] ;
+ a_pid = pid;
+ a_master_pty_fd = master_pty_fd;
+ a_stdout_fd = stdout_pipes[READ_PIPE];
+ a_stderr_fd = stderr_pipes[READ_PIPE];
} else {
//the fork failed.
- close (stderr_pipes[READ_PIPE]) ;
- close (stdout_pipes[READ_PIPE]) ;
- LOG_ERROR ("fork() failed\n") ;
- return false ;
+ close (stderr_pipes[READ_PIPE]);
+ close (stdout_pipes[READ_PIPE]);
+ LOG_ERROR ("fork() failed\n");
+ return false;
}
- return true ;
+ return true;
}
void
@@ -208,13 +208,13 @@ attach_channel_to_loop_context_as_source
const Glib::RefPtr<Glib::IOChannel> &a_chan,
const Glib::RefPtr<Glib::MainContext>&a_ctxt)
{
- THROW_IF_FAIL (a_chan) ;
- THROW_IF_FAIL (a_ctxt) ;
+ THROW_IF_FAIL (a_chan);
+ THROW_IF_FAIL (a_ctxt);
Glib::RefPtr<Glib::IOSource> io_source =
- Glib::IOSource::create (a_chan, a_cond) ;
- io_source->connect (a_slot) ;
- io_source->attach (a_ctxt) ;
+ Glib::IOSource::create (a_chan, a_cond);
+ io_source->connect (a_slot);
+ io_source->attach (a_ctxt);
}
/// open the file name a_path and test if it is a litbool
diff --git a/src/common/nmv-proc-utils.h b/src/common/nmv-proc-utils.h
index d65a7f6..6fd8497 100644
--- a/src/common/nmv-proc-utils.h
+++ b/src/common/nmv-proc-utils.h
@@ -36,13 +36,13 @@ bool NEMIVER_API launch_program (const std::vector<UString> &a_args,
int &a_pid,
int &a_master_pty_fd,
int &a_stdout_fd,
- int &a_stderr_fd) ;
+ int &a_stderr_fd);
void NEMIVER_API attach_channel_to_loop_context_as_source
(Glib::IOCondition a_cond,
const sigc::slot<bool, Glib::IOCondition> &a_slot,
const Glib::RefPtr<Glib::IOChannel> &a_chan,
- const Glib::RefPtr<Glib::MainContext>&a_ctxt) ;
+ const Glib::RefPtr<Glib::MainContext>&a_ctxt);
bool NEMIVER_API is_libtool_executable_wrapper (const UString &a_path);
}//end namspace common
diff --git a/src/common/nmv-safe-ptr-utils.h b/src/common/nmv-safe-ptr-utils.h
index 9b2522d..ab6b4bc 100644
--- a/src/common/nmv-safe-ptr-utils.h
+++ b/src/common/nmv-safe-ptr-utils.h
@@ -48,7 +48,7 @@ struct ObjectRef {
operator () (nemiver::common::Object* a_ptr)
{
if (a_ptr)
- a_ptr->ref () ;
+ a_ptr->ref ();
}
};//end ObjectRef
@@ -71,10 +71,10 @@ struct GCharUnref {
operator () (gchar* a_ptr)
{
if (a_ptr) {
- g_free (a_ptr) ;
- return true ;
+ g_free (a_ptr);
+ return true;
}
- return true ;
+ return true;
}
};
@@ -85,7 +85,7 @@ struct CharsRef {
struct DelCharsUnref {
void operator () (gchar *a_tab)
{
- delete [] a_tab ;
+ delete [] a_tab;
}
};//end struct CharTabUnref
@@ -95,14 +95,14 @@ struct UnicharsRef {
struct DelUnicharsUnref {
void operator () (gunichar *a_tab)
{
- delete [] a_tab ;
+ delete [] a_tab;
}
};
-typedef SafePtr <gchar, CharsRef, GCharUnref> GCharSafePtr ;
-typedef SafePtr <Object, ObjectRef, ObjectUnref> ObjectSafePtr ;
-typedef SafePtr <gchar, CharsRef, DelCharsUnref> CharSafePtr ;
-typedef SafePtr <gunichar, UnicharsRef, DelUnicharsUnref> UnicharSafePtr ;
+typedef SafePtr <gchar, CharsRef, GCharUnref> GCharSafePtr;
+typedef SafePtr <Object, ObjectRef, ObjectUnref> ObjectSafePtr;
+typedef SafePtr <gchar, CharsRef, DelCharsUnref> CharSafePtr;
+typedef SafePtr <gunichar, UnicharsRef, DelUnicharsUnref> UnicharSafePtr;
NEMIVER_END_NAMESPACE(common)
NEMIVER_END_NAMESPACE(nemiver)
diff --git a/src/common/nmv-safe-ptr.h b/src/common/nmv-safe-ptr.h
index f2591a3..0564812 100644
--- a/src/common/nmv-safe-ptr.h
+++ b/src/common/nmv-safe-ptr.h
@@ -48,7 +48,7 @@ struct FreeUnref
operator () (const void* a_ptr)
{
if (a_ptr)
- free (const_cast<void *> (a_ptr)) ;
+ free (const_cast<void *> (a_ptr));
}
}
;//end struct DefaultUnreference
@@ -60,7 +60,7 @@ struct DeleteFunctor
operator () (const PointerType* a_ptr)
{
if (a_ptr)
- delete (a_ptr) ;
+ delete (a_ptr);
}
};
@@ -71,7 +71,7 @@ template<class PointerType,
class SafePtr
{
protected:
- mutable PointerType *m_pointer ;
+ mutable PointerType *m_pointer;
public:
@@ -79,7 +79,7 @@ public:
m_pointer (const_cast<PointerType*> (a_pointer))
{
if (a_do_ref) {
- reference () ;
+ reference ();
}
}
@@ -92,13 +92,13 @@ public:
UnreferenceFunctor> &a_safe_ptr) :
m_pointer (a_safe_ptr.m_pointer)
{
- reference () ;
+ reference ();
}
~SafePtr ()
{
- unreference () ;
- m_pointer = NULL ;
+ unreference ();
+ m_pointer = NULL;
}
SafePtr<PointerType, ReferenceFunctor, UnreferenceFunctor>&
@@ -108,30 +108,30 @@ public:
{
SafePtr<PointerType,
ReferenceFunctor,
- UnreferenceFunctor> temp (a_safe_ptr) ;
- swap (temp) ;
- return *this ;
+ UnreferenceFunctor> temp (a_safe_ptr);
+ swap (temp);
+ return *this;
}
/*
SafePtr<PointerType, ReferenceFunctor, UnreferenceFunctor>&
operator= (const PointerType *a_pointer)
{
- reset (a_pointer) ;
- return *this ;
+ reset (a_pointer);
+ return *this;
}
*/
PointerType&
operator* () const
{
- return *(m_pointer) ;
+ return *(m_pointer);
}
PointerType*
operator-> () const
{
- return m_pointer ;
+ return m_pointer;
}
@@ -139,32 +139,32 @@ public:
ReferenceFunctor,
UnreferenceFunctor> &a_safe_ptr) const
{
- return m_pointer == a_safe_ptr.m_pointer ;
+ return m_pointer == a_safe_ptr.m_pointer;
}
bool operator== (const PointerType *a_ptr) const
{
- return m_pointer == a_ptr ;
+ return m_pointer == a_ptr;
}
bool operator! () const
{
if (m_pointer)
- return false ;
- return true ;
+ return false;
+ return true;
}
operator bool () const
{
if (!m_pointer)
- return false ;
- return true ;
+ return false;
+ return true;
}
bool operator!= (const PointerType *a_pointer)
{
- return !this->operator== (a_pointer) ;
+ return !this->operator== (a_pointer);
}
bool operator!= (const SafePtr<PointerType,
@@ -177,17 +177,17 @@ public:
void
reset ()
{
- reset (0) ;
+ reset (0);
}
void
reset (const PointerType *a_pointer, bool a_do_ref=false)
{
if (a_pointer != m_pointer) {
- unreference () ;
- m_pointer = const_cast<PointerType*> (a_pointer) ;
+ unreference ();
+ m_pointer = const_cast<PointerType*> (a_pointer);
if (a_do_ref) {
- reference () ;
+ reference ();
}
}
}
@@ -195,7 +195,7 @@ public:
PointerType*
get () const
{
- return m_pointer ;
+ return m_pointer;
}
PointerType*
@@ -203,28 +203,28 @@ public:
{
const_cast<SafePtr<PointerType,
ReferenceFunctor,
- UnreferenceFunctor>* > (this)->reference () ;
- return m_pointer ;
+ UnreferenceFunctor>* > (this)->reference ();
+ return m_pointer;
}
template <class T>
SafePtr<T, ReferenceFunctor, UnreferenceFunctor>
do_dynamic_cast ()
{
- T *pointer = dynamic_cast<T*> (m_pointer) ;
- SafePtr<T, ReferenceFunctor, UnreferenceFunctor> result (pointer) ;
+ T *pointer = dynamic_cast<T*> (m_pointer);
+ SafePtr<T, ReferenceFunctor, UnreferenceFunctor> result (pointer);
if (result) {
- result.reference () ;
+ result.reference ();
}
- return result ;
+ return result;
}
PointerType*
release ()
{
PointerType* pointer = m_pointer;
- m_pointer = NULL ;
- return pointer ;
+ m_pointer = NULL;
+ return pointer;
}
@@ -233,16 +233,16 @@ public:
ReferenceFunctor,
UnreferenceFunctor> &a_safe_ptr)
{
- PointerType *const tmp(m_pointer) ;
- m_pointer = a_safe_ptr.m_pointer ;
- a_safe_ptr.m_pointer = tmp ;
+ PointerType *const tmp(m_pointer);
+ m_pointer = a_safe_ptr.m_pointer;
+ a_safe_ptr.m_pointer = tmp;
}
void
reference ()
{
if (m_pointer) {
- ReferenceFunctor do_ref ;
+ ReferenceFunctor do_ref;
do_ref (m_pointer);
}
}
@@ -251,8 +251,8 @@ public:
unreference ()
{
if (m_pointer) {
- UnreferenceFunctor do_unref ;
- do_unref (m_pointer) ;
+ UnreferenceFunctor do_unref;
+ do_unref (m_pointer);
}
}
};//end class SafePtr
diff --git a/src/common/nmv-scope-logger.cc b/src/common/nmv-scope-logger.cc
index 501ef71..c6a5e01 100644
--- a/src/common/nmv-scope-logger.cc
+++ b/src/common/nmv-scope-logger.cc
@@ -40,11 +40,11 @@ static const UString DELETE ("delete");
struct ScopeLoggerPriv
{
- Glib::Timer timer ;
- LogStream *out ;
- bool can_free ;
- UString name ;
- UString domain ;
+ Glib::Timer timer;
+ LogStream *out;
+ bool can_free;
+ UString name;
+ UString domain;
ScopeLoggerPriv (const char*a_scope_name,
enum LogStream::LogLevel a_level,
@@ -54,38 +54,38 @@ struct ScopeLoggerPriv
{
if (!a_use_default_log_stream) {
out = new LogStream (a_level);
- can_free = true ;
+ can_free = true;
} else {
- out = &(LogStream::default_log_stream ()) ;
- can_free = false ;
+ out = &(LogStream::default_log_stream ());
+ can_free = false;
}
- name = a_scope_name ;
- domain = a_log_domain ;
+ name = a_scope_name;
+ domain = a_log_domain;
- out->push_domain (a_log_domain) ;
- *out << "|{|" << name << ":{" << common::endl ;
- out->pop_domain () ;
+ out->push_domain (a_log_domain);
+ *out << "|{|" << name << ":{" << common::endl;
+ out->pop_domain ();
- timer.start () ;
- out = out ;
+ timer.start ();
+ out = out;
}
~ScopeLoggerPriv ()
{
- timer.stop () ;
+ timer.stop ();
if (!out) {return;}
- out->push_domain (domain) ;
+ out->push_domain (domain);
*out << "|}|" << name <<":}elapsed: "
- << timer.elapsed () << "secs" << common::endl ;
- out->pop_domain () ;
+ << timer.elapsed () << "secs" << common::endl;
+ out->pop_domain ();
if (can_free) {
if (out) {
- delete out ;
+ delete out;
}
}
- out = NULL ;
+ out = NULL;
}
};
@@ -103,7 +103,7 @@ ScopeLogger::~ScopeLogger ()
{
//commented this out for performance reasons.
//yeah, real reasons that got highlighted by profiling!
- //LOG_DD (DELETE) ;
+ //LOG_DD (DELETE);
}
}//end namespace common
diff --git a/src/common/nmv-scope-logger.h b/src/common/nmv-scope-logger.h
index a2f866f..7092cbc 100644
--- a/src/common/nmv-scope-logger.h
+++ b/src/common/nmv-scope-logger.h
@@ -37,25 +37,25 @@
namespace nemiver {
namespace common {
-struct ScopeLoggerPriv ;
+struct ScopeLoggerPriv;
class NEMIVER_API ScopeLogger
{
- friend struct ScopeLoggerPriv ;
+ friend struct ScopeLoggerPriv;
- SafePtr<ScopeLoggerPriv> m_priv ;
+ SafePtr<ScopeLoggerPriv> m_priv;
//forbid copy/assignation
- ScopeLogger (ScopeLogger const &) ;
- ScopeLogger& operator= (ScopeLogger const &) ;
- ScopeLogger () ;
+ ScopeLogger (ScopeLogger const &);
+ ScopeLogger& operator= (ScopeLogger const &);
+ ScopeLogger ();
public:
ScopeLogger (const char*a_scope_name,
enum LogStream::LogLevel a_level=LogStream::LOG_LEVEL_NORMAL,
const UString &a_log_domain=NMV_GENERAL_DOMAIN,
- bool a_use_default_log_stream=true) ;
+ bool a_use_default_log_stream=true);
- virtual ~ScopeLogger () ;
+ virtual ~ScopeLogger ();
};//class ScopeLogger
diff --git a/src/common/nmv-sequence.cc b/src/common/nmv-sequence.cc
index 1b5d24a..47b2c95 100644
--- a/src/common/nmv-sequence.cc
+++ b/src/common/nmv-sequence.cc
@@ -31,8 +31,8 @@ namespace nemiver {
namespace common {
struct Sequence::Priv {
- Glib::Mutex integer_seq_mutex ;
- long long integer_seq ;
+ Glib::Mutex integer_seq_mutex;
+ long long integer_seq;
Priv () :
integer_seq (0)
@@ -46,27 +46,27 @@ Sequence::Sequence () :
Sequence::~Sequence ()
{
- LOG_D ("delete", "destructor-domain") ;
+ LOG_D ("delete", "destructor-domain");
}
long long
Sequence::create_next_integer ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- Glib::Mutex::Lock (m_priv->integer_seq_mutex) ;
- long long new_val = ++m_priv->integer_seq ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ Glib::Mutex::Lock (m_priv->integer_seq_mutex);
+ long long new_val = ++m_priv->integer_seq;
if (new_val < m_priv->integer_seq) {
THROW_EXCEPTION (Sequence::OverflowException,
- "Integer sequence overflow") ;
+ "Integer sequence overflow");
}
- m_priv->integer_seq = new_val ;
- return m_priv->integer_seq ;
+ m_priv->integer_seq = new_val;
+ return m_priv->integer_seq;
}
long long
Sequence::get_current_integer () const
{
- return m_priv->integer_seq ;
+ return m_priv->integer_seq;
}
}//end namespace common
diff --git a/src/common/nmv-sequence.h b/src/common/nmv-sequence.h
index 5720b2c..a1c64d9 100644
--- a/src/common/nmv-sequence.h
+++ b/src/common/nmv-sequence.h
@@ -36,19 +36,19 @@ namespace nemiver {
namespace common {
class NEMIVER_API Sequence : public Object {
- struct Priv ;
- friend struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ friend struct Priv;
+ SafePtr<Priv> m_priv;
//non copyable
- Sequence (const Sequence &) ;
- Sequence& operator= (const Sequence &) ;
+ Sequence (const Sequence &);
+ Sequence& operator= (const Sequence &);
public:
class NEMIVER_EXCEPTION_API OverflowException :
public nemiver::common::Exception {
- OverflowException () ;
+ OverflowException ();
public:
OverflowException (const UString &a_message) :
@@ -57,10 +57,10 @@ public:
virtual ~OverflowException () throw () {};
};//end class OverflowException
- Sequence () ;
- virtual ~Sequence () ;
- long long create_next_integer () ;//throws OverflowException
- long long get_current_integer () const ;
+ Sequence ();
+ virtual ~Sequence ();
+ long long create_next_integer ();//throws OverflowException
+ long long get_current_integer () const;
};//end class Sequence
}//end namespace common
diff --git a/src/common/nmv-sql-statement.cc b/src/common/nmv-sql-statement.cc
index 5d56356..9412ba1 100644
--- a/src/common/nmv-sql-statement.cc
+++ b/src/common/nmv-sql-statement.cc
@@ -27,77 +27,77 @@
#include "nmv-log-stream-utils.h"
#include "nmv-sql-statement.h"
-using namespace std ;
-using namespace nemiver::common ;
+using namespace std;
+using namespace nemiver::common;
namespace nemiver {
namespace common {
struct SQLStatementPriv
{
- UString sql_string ;
+ UString sql_string;
};
const UString&
SQLStatement::to_string () const
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->sql_string ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->sql_string;
}
common::UString
SQLStatement::escape_string (const common::UString &a_sql_string)
{
- UString out_string ;
+ UString out_string;
unsigned int i (0);
- for (i = 0 ; i != a_sql_string.length () ; ++i ) {
- out_string.append (1,a_sql_string[i]) ;
+ for (i = 0; i != a_sql_string.length () ; ++i ) {
+ out_string.append (1,a_sql_string[i]);
if (a_sql_string[i] == '\'') {
- out_string.append (1,a_sql_string[i]) ;
+ out_string.append (1,a_sql_string[i]);
}
}
- return out_string ;
+ return out_string;
}
SQLStatement::SQLStatement (const UString &a_sql_string)
{
- m_priv = new SQLStatementPriv ;
- m_priv->sql_string = a_sql_string ;
+ m_priv = new SQLStatementPriv;
+ m_priv->sql_string = a_sql_string;
}
SQLStatement::SQLStatement (const SQLStatement &a_statement)
{
- m_priv = new SQLStatementPriv ;
- m_priv->sql_string = a_statement.m_priv->sql_string ;
+ m_priv = new SQLStatementPriv;
+ m_priv->sql_string = a_statement.m_priv->sql_string;
}
SQLStatement&
SQLStatement::operator= (const SQLStatement &a_statement)
{
if (this == &a_statement) {
- return *this ;
+ return *this;
}
- m_priv->sql_string = a_statement.m_priv->sql_string ;
- return *this ;
+ m_priv->sql_string = a_statement.m_priv->sql_string;
+ return *this;
}
SQLStatement::~SQLStatement ()
{
if (!m_priv)
- return ;
- delete m_priv ;
- m_priv = NULL ;
+ return;
+ delete m_priv;
+ m_priv = NULL;
}
SQLStatement::operator const char* () const
{
- return to_string ().c_str () ;
+ return to_string ().c_str ();
}
LogStream&
operator<< (LogStream &a_os, const SQLStatement &a_s)
{
- a_os << a_s.to_string () ;
+ a_os << a_s.to_string ();
return a_os;
}
diff --git a/src/common/nmv-sql-statement.h b/src/common/nmv-sql-statement.h
index 95c63b6..1dbc3b6 100644
--- a/src/common/nmv-sql-statement.h
+++ b/src/common/nmv-sql-statement.h
@@ -31,12 +31,12 @@
#include "nmv-ustring.h"
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
-class UString ;
-class LogStream ;
+class UString;
+class LogStream;
}
namespace common
@@ -44,9 +44,9 @@ namespace common
class Column
{
- common::UString m_name ;
- common::UString m_value ;
- bool m_auto_increment ;
+ common::UString m_name;
+ common::UString m_value;
+ bool m_auto_increment;
public:
@@ -68,7 +68,7 @@ public:
const common::UString& get_name ()
{
- return m_name ;
+ return m_name;
}
void set_name (const common::UString &a_name)
{
@@ -76,11 +76,11 @@ public:
}
const common::UString& get_value ()
{
- return m_value ;
+ return m_value;
}
void set_value (const common::UString &a_value)
{
- m_value = a_value ;
+ m_value = a_value;
}
void set_auto_increment (bool a_auto)
{
@@ -89,38 +89,38 @@ public:
bool get_auto_increment ()
{
return m_auto_increment;
- } ;
+ };
};
-typedef vector<Column> ColumnList ;
-struct SQLStatementPriv ;
+typedef vector<Column> ColumnList;
+struct SQLStatementPriv;
class NEMIVER_API SQLStatement
{
- friend class Connection ;
- friend struct SQLStatementPriv ;
+ friend class Connection;
+ friend struct SQLStatementPriv;
- SQLStatementPriv *m_priv ;
+ SQLStatementPriv *m_priv;
public:
- SQLStatement (const common::UString &a_sql_string="") ;
+ SQLStatement (const common::UString &a_sql_string="");
- SQLStatement (const SQLStatement &) ;
+ SQLStatement (const SQLStatement &);
- SQLStatement& operator= (const SQLStatement &) ;
+ SQLStatement& operator= (const SQLStatement &);
- virtual ~SQLStatement () ;
- virtual const common::UString& to_string () const ;
+ virtual ~SQLStatement ();
+ virtual const common::UString& to_string () const;
- static common::UString escape_string (const common::UString &a_sql_string) ;
+ static common::UString escape_string (const common::UString &a_sql_string);
- operator const char* () const ;
- friend common::LogStream& operator<< (common::LogStream&, const SQLStatement&) ;
+ operator const char* () const;
+ friend common::LogStream& operator<< (common::LogStream&, const SQLStatement&);
};//end LogStream
NEMIVER_API common::LogStream & operator<< (common::LogStream &,
- const SQLStatement &) ;
+ const SQLStatement &);
}//end namespace common
}//end namespace nemiver
diff --git a/src/common/nmv-tools.cc b/src/common/nmv-tools.cc
index d9fd98a..098520f 100644
--- a/src/common/nmv-tools.cc
+++ b/src/common/nmv-tools.cc
@@ -43,33 +43,33 @@ execute_sql_command_file (const UString &a_sql_command_file,
{
if (!Glib::file_test (Glib::locale_from_utf8 (a_sql_command_file),
Glib::FILE_TEST_IS_REGULAR)) {
- LOG_ERROR ("could not find file " + a_sql_command_file) ;
- return false ;
+ LOG_ERROR ("could not find file " + a_sql_command_file);
+ return false;
}
- ifstream inputfile ;
+ ifstream inputfile;
try {
- inputfile.open (a_sql_command_file.c_str ()) ;
+ inputfile.open (a_sql_command_file.c_str ());
} catch (exception &e) {
a_ostream << "could not open file: '"
<< a_sql_command_file
- << a_sql_command_file ;
- return false ;
+ << a_sql_command_file;
+ return false;
}
if (inputfile.bad ()) {
a_ostream << "could not open file: '"
<< a_sql_command_file
- << a_sql_command_file ;
- return false ;
+ << a_sql_command_file;
+ return false;
}
bool is_ok = execute_sql_commands_from_istream (inputfile,
a_trans,
a_ostream,
a_stop_at_first_error);
- inputfile.close () ;
- return is_ok ;
+ inputfile.close ();
+ return is_ok;
}
bool
@@ -79,65 +79,65 @@ execute_sql_commands_from_istream (istream &a_istream,
bool a_stop_at_first_error)
{
//loop parsing everything untill ';' or eof and execute it.
- bool is_ok (false) ;
- UString cmd_line, tmp_str ;
+ bool is_ok (false);
+ UString cmd_line, tmp_str;
char c=0;
- bool ignore_trans = !a_stop_at_first_error ;
+ bool ignore_trans = !a_stop_at_first_error;
TransactionAutoHelper safe_trans (a_trans,
"generic-transation",
- ignore_trans) ;
+ ignore_trans);
NEMIVER_TRY
while (true) {
- a_istream.get (c) ;
+ a_istream.get (c);
if (a_istream.bad ()) {
- return false ;
+ return false;
}
if (a_istream.eof ()) {
- tmp_str="" ;
+ tmp_str="";
if (cmd_line != ""
&& !parsing_utils::is_white_string (cmd_line)) {
- LOG_DD ("executing: " << cmd_line << "...") ;
+ LOG_DD ("executing: " << cmd_line << "...");
is_ok = execute_one_statement (cmd_line,
a_trans,
- a_ostream) ;
- LOG_DD ("done.") ;
- break ;
+ a_ostream);
+ LOG_DD ("done.");
+ break;
} else {
- break ;
+ break;
}
}
- cmd_line += c ;
+ cmd_line += c;
if (c == ';') {
- tmp_str="" ;
+ tmp_str="";
if (cmd_line != ""
&& !parsing_utils::is_white_string (cmd_line)) {
- LOG_DD ("executing: " << cmd_line << "...") ;
+ LOG_DD ("executing: " << cmd_line << "...");
is_ok = execute_one_statement (cmd_line,
a_trans,
- a_ostream) ;
+ a_ostream);
if (!is_ok && a_stop_at_first_error) {
- LOG_DD ("execution failed") ;
- return false ;
+ LOG_DD ("execution failed");
+ return false;
}
- LOG_DD ("done.") ;
+ LOG_DD ("done.");
}
if (!is_ok && a_stop_at_first_error) {
- return false ;
+ return false;
}
- cmd_line = "" ;
+ cmd_line = "";
}//end (c == ';')
}
NEMIVER_CATCH_NOX
if (!is_ok && a_stop_at_first_error) {
- return false ;
+ return false;
}
- safe_trans.end () ;
- return true ;
+ safe_trans.end ();
+ return true;
}
bool
@@ -145,58 +145,58 @@ execute_one_statement (const UString &a_sql_string,
Transaction &a_trans,
ostream &a_ostream)
{
- bool is_ok = false ;
+ bool is_ok = false;
- TransactionAutoHelper safe_trans (a_trans) ;
+ TransactionAutoHelper safe_trans (a_trans);
try {
is_ok = a_trans.get_connection ().execute_statement
- (SQLStatement (a_sql_string)) ;
+ (SQLStatement (a_sql_string));
} catch (Exception &e) {
- a_ostream << "statement execution error: " << e.what () ;
- LOG_DD ("error occured when executing statetement: " << a_sql_string) ;
- return false ;
+ a_ostream << "statement execution error: " << e.what ();
+ LOG_DD ("error occured when executing statetement: " << a_sql_string);
+ return false;
}
if (!is_ok) {
a_ostream << "statement execution failed: "
<< a_trans.get_connection ().get_last_error ()
- << "\n" ;
+ << "\n";
LOG_ERROR ("error occured when executing statetement: " <<a_sql_string);
return false;
}
Buffer buffer1, buffer2;
- long number_of_columns = 0 ;
+ long number_of_columns = 0;
while (a_trans.get_connection ().read_next_row ()) {
- number_of_columns = a_trans.get_connection ().get_number_of_columns () ;
- a_ostream << "--------------------------------------\n" ;
- for (long i=0 ; i < number_of_columns; ++i) {
+ number_of_columns = a_trans.get_connection ().get_number_of_columns ();
+ a_ostream << "--------------------------------------\n";
+ for (long i=0; i < number_of_columns; ++i) {
if (!a_trans.get_connection ().get_column_name (i, buffer1)) {
a_ostream << "error while getting name of column "
<< i
<< " : "
<< a_trans.get_connection ().get_last_error ()
- << "\n" ;
- continue ;
+ << "\n";
+ continue;
}
if (!a_trans.get_connection ().get_column_content (i, buffer2)) {
a_ostream << "error while getting content of column "
<< i
<< " : "
<< a_trans.get_connection ().get_last_error ()
- << "\n" ;
- continue ;
+ << "\n";
+ continue;
}
a_ostream.write (buffer1.get_data (),
- buffer1.get_len ()) ;
- a_ostream << " : " ;
+ buffer1.get_len ());
+ a_ostream << " : ";
a_ostream.write (buffer2.get_data (),
- buffer2.get_len ()) ;
- a_ostream << '\n' ;
+ buffer2.get_len ());
+ a_ostream << '\n';
}
- a_ostream << "--------------------------------------\n" ;
+ a_ostream << "--------------------------------------\n";
}
- safe_trans.end () ;
- return is_ok ;
+ safe_trans.end ();
+ return is_ok;
}
}//end namespace tools
diff --git a/src/common/nmv-tools.h b/src/common/nmv-tools.h
index 9250e52..c219d37 100644
--- a/src/common/nmv-tools.h
+++ b/src/common/nmv-tools.h
@@ -31,7 +31,7 @@
#ifndef __NEMIVER_TOOLS_H__
#define __NEMIVER_TOOLS_H__
-using namespace std ;
+using namespace std;
namespace nemiver {
namespace common {
@@ -40,7 +40,7 @@ namespace tools {
bool NEMIVER_API execute_sql_command_file (const common::UString &a_sql_cmd_file,
Transaction &a_trans,
ostream &a_ostream,
- bool stop_at_first_error=false) ;
+ bool stop_at_first_error=false);
bool NEMIVER_API execute_sql_commands_from_istream (istream &a_istream,
Transaction &a_trans,
@@ -49,7 +49,7 @@ bool NEMIVER_API execute_sql_commands_from_istream (istream &a_istream,
bool NEMIVER_API execute_one_statement (const common::UString &a_sql_string,
Transaction &a_trans,
- ostream &a_ostream) ;
+ ostream &a_ostream);
}//end namespace tools
}//end namespace common
}//end namespace verissimus
diff --git a/src/common/nmv-transaction.cc b/src/common/nmv-transaction.cc
index b6210c9..2820379 100644
--- a/src/common/nmv-transaction.cc
+++ b/src/common/nmv-transaction.cc
@@ -27,20 +27,20 @@
#include "nmv-exception.h"
#include "nmv-transaction.h"
-using namespace std ;
-using namespace nemiver::common ;
+using namespace std;
+using namespace nemiver::common;
namespace nemiver {
namespace common {
struct TransactionPriv
{
- bool is_started ;
- bool is_commited ;
- stack<UString> transaction_stack ;
- Connection *connection ;
- long long id ;
- mutable Glib::Mutex mutex ;
+ bool is_started;
+ bool is_commited;
+ stack<UString> transaction_stack;
+ Connection *connection;
+ long long id;
+ mutable Glib::Mutex mutex;
TransactionPriv (Connection &a_con):
is_started (false),
@@ -48,67 +48,67 @@ struct TransactionPriv
connection (&a_con),
id (0)
{
- id = generate_id () ;
+ id = generate_id ();
}
long long generate_id ()
{
- static long long s_id_sequence (0) ;
- static Glib::RecMutex s_mutex ;
- Glib::RecMutex::Lock lock (s_mutex) ;
+ static long long s_id_sequence (0);
+ static Glib::RecMutex s_mutex;
+ Glib::RecMutex::Lock lock (s_mutex);
return ++s_id_sequence;
}
};//end TransactionPriv
Transaction::Transaction (Connection &a_con)
{
- m_priv = new TransactionPriv (a_con) ;
+ m_priv = new TransactionPriv (a_con);
}
Transaction::Transaction (const Transaction &a_trans) :
Object (a_trans)
{
- m_priv = new TransactionPriv (*a_trans.m_priv->connection) ;
- m_priv->is_started = a_trans.m_priv->is_started ;
- m_priv->is_commited = a_trans.m_priv->is_commited ;
- m_priv->transaction_stack = a_trans.m_priv->transaction_stack ;
+ m_priv = new TransactionPriv (*a_trans.m_priv->connection);
+ m_priv->is_started = a_trans.m_priv->is_started;
+ m_priv->is_commited = a_trans.m_priv->is_commited;
+ m_priv->transaction_stack = a_trans.m_priv->transaction_stack;
}
Glib::Mutex&
Transaction::get_mutex () const
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->mutex ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->mutex;
}
Transaction&
Transaction::operator= (const Transaction &a_trans)
{
if (this == &a_trans)
- return *this ;
+ return *this;
- m_priv->is_started = a_trans.m_priv->is_started ;
- m_priv->is_commited = a_trans.m_priv->is_commited ;
- m_priv->transaction_stack = a_trans.m_priv->transaction_stack ;
- m_priv->connection = a_trans.m_priv->connection ;
- return *this ;
+ m_priv->is_started = a_trans.m_priv->is_started;
+ m_priv->is_commited = a_trans.m_priv->is_commited;
+ m_priv->transaction_stack = a_trans.m_priv->transaction_stack;
+ m_priv->connection = a_trans.m_priv->connection;
+ return *this;
}
Transaction::~Transaction ()
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
- rollback () ;
+ rollback ();
if (m_priv) {
- delete m_priv ;
- m_priv = NULL ;
+ delete m_priv;
+ m_priv = NULL;
}
}
Connection&
Transaction::get_connection ()
{
- return *m_priv->connection ;
+ return *m_priv->connection;
}
bool
@@ -116,17 +116,17 @@ Transaction::begin (const UString &a_subtransaction_name)
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
- m_priv->transaction_stack.push (a_subtransaction_name) ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->transaction_stack.push (a_subtransaction_name);
if (m_priv->transaction_stack.size () == 1) {
//This is the higher level subtransaction,
//let's start a table level transaction then.
- m_priv->connection->start_transaction () ;
- m_priv->is_started = true ;
+ m_priv->connection->start_transaction ();
+ m_priv->is_started = true;
}
LOG_VERBOSE ("sub transaction " << a_subtransaction_name
- <<"started") ;
- return true ;
+ <<"started");
+ return true;
}
bool
@@ -134,12 +134,12 @@ Transaction::commit (const UString &a_subtrans_name)
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
if (m_priv->transaction_stack.empty ()) {
LOG_ERROR ("There is no sub transaction named '"
- << a_subtrans_name << "' to close") ;
- return false ;
+ << a_subtrans_name << "' to close");
+ return false;
}
UString opened_subtrans = m_priv->transaction_stack.top ();
if (opened_subtrans != a_subtrans_name) {
@@ -147,30 +147,30 @@ Transaction::commit (const UString &a_subtrans_name)
<<a_subtrans_name
<<"' while sub transaction '"
<< opened_subtrans
- << "' remains opened") ;
- return false ;
+ << "' remains opened");
+ return false;
}
- m_priv->transaction_stack.pop () ;
+ m_priv->transaction_stack.pop ();
if (m_priv->transaction_stack.empty ()) {
if (m_priv->is_started) {
if (!m_priv->connection->commit_transaction ()) {
LOG_ERROR ("error during commit: "
- << m_priv->connection->get_last_error ()) ;
- return false ;
+ << m_priv->connection->get_last_error ());
+ return false;
}
- m_priv->is_started = false ;
- m_priv->is_commited = true ;
- LOG_VERBOSE ("table level commit done") ;
+ m_priv->is_started = false;
+ m_priv->is_commited = true;
+ LOG_VERBOSE ("table level commit done");
}
}
- return true ;
+ return true;
}
bool
Transaction::is_commited ()
{
- THROW_IF_FAIL (m_priv) ;
- return m_priv->is_commited ;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->is_commited;
}
bool
@@ -178,23 +178,23 @@ Transaction::rollback ()
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
while (m_priv->transaction_stack.size ()) {
- m_priv->transaction_stack.pop () ;
+ m_priv->transaction_stack.pop ();
}
if (m_priv->is_started) {
RETURN_VAL_IF_FAIL
(m_priv->connection->rollback_transaction (), false);
}
- m_priv->is_started = false ;
- m_priv->is_commited = false ;
- return true ;
+ m_priv->is_started = false;
+ m_priv->is_commited = false;
+ return true;
}
long long
Transaction::get_id ()
{
- return m_priv->id ;
+ return m_priv->id;
}
}//end namespace common
diff --git a/src/common/nmv-transaction.h b/src/common/nmv-transaction.h
index c92dc60..6bc549e 100644
--- a/src/common/nmv-transaction.h
+++ b/src/common/nmv-transaction.h
@@ -37,7 +37,7 @@
namespace nemiver {
namespace common {
-struct TransactionPriv ;
+struct TransactionPriv;
/// \brief the application level persistence transaction class.
/// abstracts a transaction several persistent objects can be part of.
@@ -48,28 +48,28 @@ struct TransactionPriv ;
/// Read docs/nmv-persistence.txt to learn more.
class NEMIVER_API Transaction: public common::Object
{
- friend struct TransactionPriv ;
- TransactionPriv *m_priv ;
- Transaction () ;
+ friend struct TransactionPriv;
+ TransactionPriv *m_priv;
+ Transaction ();
public:
- Transaction (Connection &a_con) ;
- Transaction (const Transaction &) ;
- Transaction& operator= (const Transaction &) ;
- virtual ~Transaction () ;
- Connection& get_connection () ;
- bool begin (const common::UString &a_subtransaction_name="") ;
- bool commit (const common::UString &a_subtransaction_name="") ;
- bool is_commited () ;
- bool rollback () ;
- long long get_id () ;
- Glib::Mutex& get_mutex () const ;
+ Transaction (Connection &a_con);
+ Transaction (const Transaction &);
+ Transaction& operator= (const Transaction &);
+ virtual ~Transaction ();
+ Connection& get_connection ();
+ bool begin (const common::UString &a_subtransaction_name="");
+ bool commit (const common::UString &a_subtransaction_name="");
+ bool is_commited ();
+ bool rollback ();
+ long long get_id ();
+ Glib::Mutex& get_mutex () const;
};//end class Transaction
typedef common::SafePtr<Transaction,
common::ObjectRef,
- common::ObjectUnref> TransactionSafePtr ;
+ common::ObjectUnref> TransactionSafePtr;
//this class starts a transaction
//upon instanciation, and reverts
@@ -80,9 +80,9 @@ typedef common::SafePtr<Transaction,
//based transaction code.
struct TransactionAutoHelper
{
- Transaction &m_trans ;
- bool m_is_started ;
- bool m_ignore ;
+ Transaction &m_trans;
+ bool m_is_started;
+ bool m_ignore;
TransactionAutoHelper (common::Transaction &a_trans,
const common::UString &a_name ="generic-transaction",
@@ -91,24 +91,24 @@ struct TransactionAutoHelper
m_ignore (a_ignore)
{
if (m_ignore) {
- return ;
+ return;
}
- THROW_IF_FAIL (m_trans.begin (a_name)) ;
+ THROW_IF_FAIL (m_trans.begin (a_name));
m_is_started = true;
}
void end (const common::UString& a_name="generic-transaction")
{
if (m_ignore) {
- return ;
+ return;
}
- THROW_IF_FAIL (m_trans.commit (a_name)) ;
- m_is_started = false ;
+ THROW_IF_FAIL (m_trans.commit (a_name));
+ m_is_started = false;
}
operator common::Transaction& ()
{
- return m_trans ;
+ return m_trans;
}
common::Transaction& get ()
@@ -119,11 +119,11 @@ struct TransactionAutoHelper
~TransactionAutoHelper ()
{
if (m_ignore) {
- return ;
+ return;
}
if (m_is_started) {
- THROW_IF_FAIL (m_trans.rollback ()) ;
- m_is_started = false ;
+ THROW_IF_FAIL (m_trans.rollback ());
+ m_is_started = false;
}
}
};//end TransactionAutoHelper
diff --git a/src/common/nmv-ustring.cc b/src/common/nmv-ustring.cc
index e3bb08f..cfc1cc4 100644
--- a/src/common/nmv-ustring.cc
+++ b/src/common/nmv-ustring.cc
@@ -33,7 +33,7 @@
#include "nmv-safe-ptr-utils.h"
#include "nmv-log-stream-utils.h"
-using namespace std ;
+using namespace std;
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
@@ -53,11 +53,11 @@ strnlen (const gchar *string, gulong a_len)
UString
UString::from_int (long long an_int)
{
- UString str ;
- ostringstream os ;
- os << an_int ;
- str = os.str ().c_str () ;
- return str ;
+ UString str;
+ ostringstream os;
+ os << an_int;
+ str = os.str ().c_str ();
+ return str;
}
UString::UString ()
@@ -67,25 +67,25 @@ UString::UString ()
UString::UString (const char *a_cstr, long a_len)
{
if (!a_cstr) {
- Glib::ustring::operator= ("") ;
+ Glib::ustring::operator= ("");
} else {
if (a_len < 0)
- Glib::ustring::operator= (a_cstr) ;
+ Glib::ustring::operator= (a_cstr);
else
- Glib::ustring::assign (a_cstr, a_len) ;
+ Glib::ustring::assign (a_cstr, a_len);
}
}
UString::UString (const unsigned char *a_cstr, long a_len)
{
- const char* cstr = reinterpret_cast<const char*> (a_cstr) ;
+ const char* cstr = reinterpret_cast<const char*> (a_cstr);
if (!cstr) {
- Glib::ustring::operator= ("") ;
+ Glib::ustring::operator= ("");
} else {
if (a_len < 0)
- Glib::ustring::operator= (cstr) ;
+ Glib::ustring::operator= (cstr);
else
- Glib::ustring::assign (cstr, a_len) ;
+ Glib::ustring::assign (cstr, a_len);
}
}
@@ -107,73 +107,73 @@ UString&
UString::set (const gchar* a_buf, gulong a_len)
{
if (!a_buf) {
- return *this ;
+ return *this;
}
//truncate the length of string if it contains
//zeros, otherwise, Glib::ustring throws an exception.
- gulong length_to_first_zero = strnlen (a_buf, a_len) ;
- gulong len = a_len ;
+ gulong length_to_first_zero = strnlen (a_buf, a_len);
+ gulong len = a_len;
if (length_to_first_zero != a_len) {
- len = length_to_first_zero ;
+ len = length_to_first_zero;
}
- Glib::ustring::assign (a_buf, len) ;
- return *this ;
+ Glib::ustring::assign (a_buf, len);
+ return *this;
}
bool
UString::is_integer () const
{
- UString::value_type c (0) ;
+ UString::value_type c (0);
if (*this == "")
- return false ;
+ return false;
- for (UString::size_type i = 0; i < size () ; ++i) {
- c = (*this)[i] ;
+ for (UString::size_type i = 0; i < size (); ++i) {
+ c = (*this)[i];
if (c < '0' && c > '9') {
- return false ;
+ return false;
}
}
- return true ;
+ return true;
}
UString&
UString::append_int (long long an_int)
{
- this->operator+= (from_int (an_int)) ;
- return *this ;
+ this->operator+= (from_int (an_int));
+ return *this;
}
UString&
UString::assign_int (long long an_int)
{
- this->operator= (from_int (an_int)) ;
- return *this ;
+ this->operator= (from_int (an_int));
+ return *this;
}
UString&
UString::operator= (const char *a_cstr)
{
if (!a_cstr) {
- Glib::ustring::operator= ("") ;
+ Glib::ustring::operator= ("");
} else {
- Glib::ustring::operator= (a_cstr) ;
+ Glib::ustring::operator= (a_cstr);
}
- return *this ;
+ return *this;
}
UString&
UString::operator= (const unsigned char *a_cstr)
{
- return operator= (reinterpret_cast<const char*> (a_cstr)) ;
+ return operator= (reinterpret_cast<const char*> (a_cstr));
}
UString&
UString::operator= (UString const &a_cstr)
{
if (this == &a_cstr)
- return *this ;
- Glib::ustring::operator= (a_cstr) ;
- return *this ;
+ return *this;
+ Glib::ustring::operator= (a_cstr);
+ return *this;
}
bool
@@ -188,42 +188,42 @@ UString::operator! () const
vector<UString>
UString::split (const UString &a_delim) const
{
- vector<UString> result ;
+ vector<UString> result;
if (size () == Glib::ustring::size_type (0)) {return result;}
- gint len = bytes () + 1 ;
- CharSafePtr buf (new gchar[len]) ;
- memset (buf.get (), 0, len) ;
- memcpy (buf.get (), c_str (), bytes ()) ;
+ gint len = bytes () + 1;
+ CharSafePtr buf (new gchar[len]);
+ memset (buf.get (), 0, len);
+ memcpy (buf.get (), c_str (), bytes ());
- gchar **splited = g_strsplit (buf.get (), a_delim.c_str (), -1) ;
+ gchar **splited = g_strsplit (buf.get (), a_delim.c_str (), -1);
try {
- for (gchar **cur = splited ; cur && *cur; ++cur) {
- result.push_back (UString (*cur)) ;
+ for (gchar **cur = splited; cur && *cur; ++cur) {
+ result.push_back (UString (*cur));
}
} catch (...) {
}
if (splited) {
- g_strfreev (splited) ;
+ g_strfreev (splited);
}
- return result ;
+ return result;
}
vector<UString>
UString::split_set (const UString &a_delim_set) const
{
- vector<UString> result ;
+ vector<UString> result;
if (size () == Glib::ustring::size_type (0)) {return result;}
- gint len = bytes () + 1 ;
+ gint len = bytes () + 1;
CharSafePtr buf (new gchar[len]);
memset (buf.get (), 0, len);
memcpy (buf.get (), c_str (), bytes ());
gchar **splited = g_strsplit_set (buf.get (), a_delim_set.c_str (), -1);
try {
- for (gchar **cur = splited ; cur && *cur; ++cur) {
+ for (gchar **cur = splited; cur && *cur; ++cur) {
result.push_back (UString (*cur));
}
} catch (...) {
@@ -240,11 +240,11 @@ UString::join (const vector<UString> &a_elements,
const UString &a_delim)
{
if (!a_elements.size ()) {
- return UString ("") ;
+ return UString ("");
}
- vector<UString>::const_iterator from = a_elements.begin () ;
- vector<UString>::const_iterator to = a_elements.end () ;
- return join (from, to, a_delim) ;
+ vector<UString>::const_iterator from = a_elements.begin ();
+ vector<UString>::const_iterator to = a_elements.end ();
+ return join (from, to, a_delim);
}
UString
@@ -254,12 +254,12 @@ UString::join (vector<UString>::const_iterator &a_from,
{
if (a_from == a_to) {return UString ("");}
- vector<UString>::const_iterator iter = a_from ;
- UString result = *iter ;
- for (; ++iter != a_to ; ) {
- result += a_delim + *iter ;
+ vector<UString>::const_iterator iter = a_from;
+ UString result = *iter;
+ for (; ++iter != a_to; ) {
+ result += a_delim + *iter;
}
- return result ;
+ return result;
}
void
@@ -267,20 +267,20 @@ UString::chomp ()
{
if (!size ()) {return;}
- Glib::ustring::size_type i = 0 ;
+ Glib::ustring::size_type i = 0;
//remove the ws from the beginning of the string.
while (!empty () && isspace (at (0))) {
- erase (0, 1) ;
+ erase (0, 1);
}
//remove the ws from the end of the string.
- i = size () ;
+ i = size ();
if (!i) {return;}
- --i ;
+ --i;
while (i > 0 && isspace (at (i))) {
- erase (i, 1) ;
- i = size () ;
+ erase (i, 1);
+ i = size ();
if (!i) {return;}
--i;
}
@@ -290,24 +290,24 @@ UString::chomp ()
UString::size_type
UString::get_number_of_lines () const
{
- UString::size_type res = 0 ;
- for (UString::const_iterator it = begin () ; it != end () ; ++it) {
+ UString::size_type res = 0;
+ for (UString::const_iterator it = begin (); it != end () ; ++it) {
if (*it == '\n') {++res;}
}
- return res ;
+ return res;
}
UString::size_type
UString::get_number_of_words () const
{
- UString::size_type i=0, num_words=0 ;
+ UString::size_type i=0, num_words=0;
skip_blanks:
for (;i < raw ().size (); ++i) {
if (!isblank (raw ()[i]))
goto eat_word;
}
- goto out ;
+ goto out;
eat_word:
num_words++;
@@ -323,9 +323,9 @@ out:
UString&
UString::vprintf (const UString &a_format, va_list a_args)
{
- GCharSafePtr str (g_strdup_vprintf (a_format.c_str (), a_args)) ;
- assign (str.get ()) ;
- return *this ;
+ GCharSafePtr str (g_strdup_vprintf (a_format.c_str (), a_args));
+ assign (str.get ());
+ return *this;
}
UString&
@@ -335,7 +335,7 @@ UString::printf (const UString &a_format, ...)
va_start (args, a_format);
this->vprintf (a_format, args);
va_end (args);
- return *this ;
+ return *this;
}
WString::~WString ()
@@ -353,9 +353,9 @@ WString::WString (const super_type &a_str) : super_type (a_str)
WString::WString (const char* a_str, unsigned int a_len)
{
if (!a_str) {
- assign ("") ;
+ assign ("");
} else {
- assign (a_str, a_len) ;
+ assign (a_str, a_len);
}
}
@@ -406,57 +406,57 @@ WString&
WString::assign (const char *a_str, long a_len)
{
if (!a_str) {
- static gunichar s_empty_str[]={0} ;
- super_type::assign (s_empty_str) ;
+ static gunichar s_empty_str[]={0};
+ super_type::assign (s_empty_str);
} else {
if (a_len <0) {
- a_len = strlen (a_str) ;
+ a_len = strlen (a_str);
}
if (a_len) {
if ((long)capacity () < a_len) {resize (a_len);}
- for (long i=0; i < a_len ; ++i) {
- at (i) = a_str[i] ;
+ for (long i=0; i < a_len; ++i) {
+ at (i) = a_str[i];
}
}
}
- return *this ;
+ return *this;
}
WString&
WString::assign (const WString &a_str)
{
- super_type::assign (a_str) ;
- return *this ;
+ super_type::assign (a_str);
+ return *this;
}
WString&
WString::assign (const WString &a_str, size_type a_position,
super_type::size_type a_n)
{
- super_type::assign ((super_type)a_str, a_position, a_n) ;
- return *this ;
+ super_type::assign ((super_type)a_str, a_position, a_n);
+ return *this;
}
WString&
WString::assign (const gunichar *a_str,
super_type::size_type a_n)
{
- super_type::assign (a_str, a_n) ;
- return *this ;
+ super_type::assign (a_str, a_n);
+ return *this;
}
WString&
WString::assign (const gunichar *a_str)
{
- super_type::assign (a_str) ;
- return *this ;
+ super_type::assign (a_str);
+ return *this;
}
WString&
WString::assign (super_type::size_type a_n, gunichar a_c)
{
- super_type::assign (a_n, a_c) ;
- return *this ;
+ super_type::assign (a_n, a_c);
+ return *this;
}
struct GErrorRef {
@@ -469,7 +469,7 @@ struct GErrorUnref {
void operator () (GError *a_err)
{
if (a_err) {
- g_error_free (a_err) ;
+ g_error_free (a_err);
}
}
};
@@ -478,55 +478,55 @@ bool
wstring_to_ustring (const WString &a_wstr,
UString &a_ustr)
{
- glong wstr_len=0, utf8_bytes_len=0 ;
- GCharSafePtr utf8_buf ;
- GError *err=0 ;
+ glong wstr_len=0, utf8_bytes_len=0;
+ GCharSafePtr utf8_buf;
+ GError *err=0;
utf8_buf.reset (g_ucs4_to_utf8 (a_wstr.c_str (),
a_wstr.size (), &wstr_len,
- &utf8_bytes_len, &err)) ;
+ &utf8_bytes_len, &err));
SafePtr<GError, GErrorRef, GErrorUnref> error;
- error.reset (err) ;
+ error.reset (err);
if (error) {
- LOG_ERROR ("got error conversion error: '" << error->message << "'") ;
- return false ;
+ LOG_ERROR ("got error conversion error: '" << error->message << "'");
+ return false;
}
if (!utf8_bytes_len && a_wstr.size ()) {
- LOG_ERROR ("Conversion from ucs4 str to utf8 str failed.") ;
+ LOG_ERROR ("Conversion from ucs4 str to utf8 str failed.");
return false;
}
- a_ustr.assign (utf8_buf.get (), wstr_len) ;
- return true ;
+ a_ustr.assign (utf8_buf.get (), wstr_len);
+ return true;
}
bool
ustring_to_wstring (const UString &a_ustr,
WString &a_wstr)
{
- glong wstr_len=0, utf8_bytes_len=0 ;
- SafePtr<gunichar, DefaultRef, FreeUnref> wbuf ;
- GError *err=0 ;
+ glong wstr_len=0, utf8_bytes_len=0;
+ SafePtr<gunichar, DefaultRef, FreeUnref> wbuf;
+ GError *err=0;
wbuf.reset (g_utf8_to_ucs4 (a_ustr.c_str (),
a_ustr.bytes (),
&utf8_bytes_len,
&wstr_len,
- &err)) ;
+ &err));
SafePtr<GError, GErrorRef, GErrorUnref> error;
- error.reset (err) ;
+ error.reset (err);
if (error) {
- LOG_ERROR ("got error conversion error: '" << error->message << "'") ;
- return false ;
+ LOG_ERROR ("got error conversion error: '" << error->message << "'");
+ return false;
}
if (!wstr_len && a_ustr.bytes ()) {
- LOG_ERROR ("Conversion from utf8 str to ucs4 str failed") ;
- return false ;
+ LOG_ERROR ("Conversion from utf8 str to ucs4 str failed");
+ return false;
}
if ((gulong)wstr_len != a_ustr.size ()) {
- LOG_ERROR ("Conversion from utf8 str to ucs4 str failed") ;
+ LOG_ERROR ("Conversion from utf8 str to ucs4 str failed");
}
- a_wstr.assign (wbuf.get (), wstr_len) ;
- return true ;
+ a_wstr.assign (wbuf.get (), wstr_len);
+ return true;
}
NEMIVER_END_NAMESPACE (nemiver)
NEMIVER_END_NAMESPACE (common)
diff --git a/src/common/nmv-ustring.h b/src/common/nmv-ustring.h
index 86ac5ee..36349c1 100644
--- a/src/common/nmv-ustring.h
+++ b/src/common/nmv-ustring.h
@@ -37,105 +37,105 @@
#include "nmv-namespace.h"
#include "nmv-api-macros.h"
-using namespace std ;
+using namespace std;
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
-class WString ;
+class WString;
class NEMIVER_API UString: public Glib::ustring {
public:
- UString () ;
- UString (const char *a_cstr, long a_len=-1) ;
- UString (const unsigned char *a_cstr, long a_len=-1) ;
- UString (const Glib::ustring &an_other_string) ;
- UString (const string &an_other_string) ;
- UString (UString const &an_other_string) ;
- virtual ~UString () ;
- UString& set (const gchar* a_buf, gulong a_len) ;
- static UString from_int (long long an_int) ;
- bool is_integer () const ;
- UString& append_int (long long an_int) ;
- UString& assign_int (long long) ;
- UString& operator= (const char *a_cstr) ;
- UString& operator= (const unsigned char *a_cstr) ;
- UString& operator= (UString const &a_cstr) ;
- bool operator! () const ;
- vector<UString> split (const UString &a_delim) const ;
- vector<UString> split_set (const UString &a_delim_set) const ;
+ UString ();
+ UString (const char *a_cstr, long a_len=-1);
+ UString (const unsigned char *a_cstr, long a_len=-1);
+ UString (const Glib::ustring &an_other_string);
+ UString (const string &an_other_string);
+ UString (UString const &an_other_string);
+ virtual ~UString ();
+ UString& set (const gchar* a_buf, gulong a_len);
+ static UString from_int (long long an_int);
+ bool is_integer () const;
+ UString& append_int (long long an_int);
+ UString& assign_int (long long);
+ UString& operator= (const char *a_cstr);
+ UString& operator= (const unsigned char *a_cstr);
+ UString& operator= (UString const &a_cstr);
+ bool operator! () const;
+ vector<UString> split (const UString &a_delim) const;
+ vector<UString> split_set (const UString &a_delim_set) const;
static UString join (const vector<UString> &a_elements,
- const UString &a_delim=" ") ;
+ const UString &a_delim=" ");
static UString join (vector<UString>::const_iterator &a_from,
vector<UString>::const_iterator &a_to,
- const UString &a_delim=" ") ;
- void chomp () ;
+ const UString &a_delim=" ");
+ void chomp ();
- UString::size_type get_number_of_lines () const ;
+ UString::size_type get_number_of_lines () const;
- UString::size_type get_number_of_words () const ;
+ UString::size_type get_number_of_words () const;
- UString& printf (const UString &a_format, ...) ;
+ UString& printf (const UString &a_format, ...);
UString& vprintf (const UString &a_format, va_list a_args);
};//end class UString
class NEMIVER_API WString : public basic_string<gunichar> {
-typedef basic_string<gunichar> super_type ;
+typedef basic_string<gunichar> super_type;
public:
- WString () ;
+ WString ();
- ~WString () ;
+ ~WString ();
- WString (const super_type &a_str) ;
+ WString (const super_type &a_str);
- WString (const char* a_str, unsigned int a_len=-1) ;
+ WString (const char* a_str, unsigned int a_len=-1);
- WString (const super_type::allocator_type &a) ;
+ WString (const super_type::allocator_type &a);
- WString (const WString &str) ;
+ WString (const WString &str);
WString (const WString &str,
size_type position,
- size_type n=npos) ;
+ size_type n = npos);
WString (const WString &str, size_type position,
size_type n,
- const super_type::allocator_type &a) ;
+ const super_type::allocator_type &a);
WString (const gunichar *s,
super_type::size_type n,
- const super_type::allocator_type &a=super_type::allocator_type()) ;
+ const super_type::allocator_type &a=super_type::allocator_type());
WString (const gunichar *s,
- const super_type::allocator_type &a=super_type::allocator_type()) ;
+ const super_type::allocator_type &a=super_type::allocator_type());
WString (size_type n,
gunichar c,
- const super_type::allocator_type &a=super_type::allocator_type()) ;
+ const super_type::allocator_type &a=super_type::allocator_type());
- WString& assign (const char *a_str, long a_len=-1) ;
+ WString& assign (const char *a_str, long a_len=-1);
- WString& assign (const WString &a_str) ;
+ WString& assign (const WString &a_str);
WString& assign (const WString &a_str, size_type a_position,
- super_type::size_type a_n) ;
+ super_type::size_type a_n);
WString& assign (const gunichar *a_str,
- super_type::size_type a_n) ;
+ super_type::size_type a_n);
- WString& assign (const gunichar *a_str) ;
+ WString& assign (const gunichar *a_str);
- WString& assign (super_type::size_type a_n, gunichar a_c) ;
+ WString& assign (super_type::size_type a_n, gunichar a_c);
};//end WString
bool NEMIVER_API wstring_to_ustring (const WString &a_wstr,
- UString &a_ustr) ;
+ UString &a_ustr);
bool NEMIVER_API ustring_to_wstring (const UString &a_ustr,
- WString &a_wstr) ;
+ WString &a_wstr);
NEMIVER_END_NAMESPACE (common)
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.cc b/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.cc
index 88e1b7e..23153c1 100644
--- a/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.cc
+++ b/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.cc
@@ -35,7 +35,7 @@
#include "common/nmv-sql-statement.h"
#include "nmv-sqlite-cnx-drv.h"
-using namespace nemiver::common ;
+using namespace nemiver::common;
namespace nemiver {
namespace common {
@@ -48,25 +48,25 @@ struct Sqlite3Ref {
struct Sqlite3Unref {
void operator () (sqlite3 *a_ptr)
{
- sqlite3_close (a_ptr) ;
+ sqlite3_close (a_ptr);
}
};//end struct Sqlite3Unref
-typedef common::SafePtr<sqlite3, Sqlite3Ref, Sqlite3Unref> Sqlite3SafePtr ;
+typedef common::SafePtr<sqlite3, Sqlite3Ref, Sqlite3Unref> Sqlite3SafePtr;
struct SqliteCnxDrv::Priv {
//sqlite3 database connection handle.
//Must be de-allocated by a call to
//sqlite3_close ();
- Sqlite3SafePtr sqlite ;
+ Sqlite3SafePtr sqlite;
//the current prepared sqlite statement.
//It must be deallocated after the result set
//has been read, before we can close the db,
//or before another statement is prepared.
- sqlite3_stmt *cur_stmt ;
+ sqlite3_stmt *cur_stmt;
//the result of the last sqlite3_step() function, or -333
- int last_execution_result ;
+ int last_execution_result;
Priv ():
sqlite (NULL),
@@ -75,69 +75,69 @@ struct SqliteCnxDrv::Priv {
{
}
- bool step_cur_statement () ;
+ bool step_cur_statement ();
- bool check_offset (gulong a_offset) ;
+ bool check_offset (gulong a_offset);
};
bool
SqliteCnxDrv::Priv::step_cur_statement ()
{
- RETURN_VAL_IF_FAIL (cur_stmt, false) ;
- last_execution_result = sqlite3_step (cur_stmt) ;
- bool result (false) ;
+ RETURN_VAL_IF_FAIL (cur_stmt, false);
+ last_execution_result = sqlite3_step (cur_stmt);
+ bool result (false);
decide:
switch (last_execution_result) {
case SQLITE_BUSY:
//db file is locked. Let's try again a couple of times.
for (int i=0;i<2;++i) {
- sleep (1) ;
- last_execution_result = sqlite3_step (cur_stmt) ;
+ sleep (1);
+ last_execution_result = sqlite3_step (cur_stmt);
if (last_execution_result != SQLITE_BUSY)
- goto decide ;
+ goto decide;
}
- result = false ;
- break ;
+ result = false;
+ break;
case SQLITE_DONE:
//the statement was successfuly executed and
//there is no more data to fecth.
//go advertise the good news
- result = true ;
- break ;
+ result = true;
+ break;
case SQLITE_ROW:
//the statement was successfuly executed and
//there is some rows waiting to be fetched.
//go advertise the good news.
- result = true ;
+ result = true;
break;
case SQLITE_ERROR:
LOG_ERROR ("sqlite3_step() encountered a runtime error:"
- << sqlite3_errmsg (sqlite.get ())) ;
+ << sqlite3_errmsg (sqlite.get ()));
if (cur_stmt) {
- sqlite3_finalize (cur_stmt) ;
- cur_stmt = NULL ;
+ sqlite3_finalize (cur_stmt);
+ cur_stmt = NULL;
}
- result = false ;
+ result = false;
break;
case SQLITE_MISUSE:
- LOG_ERROR ("seems like sqlite3_step() has been called too much ...") ;
+ LOG_ERROR ("seems like sqlite3_step() has been called too much ...");
if (cur_stmt) {
- sqlite3_finalize (cur_stmt) ;
- cur_stmt = NULL ;
+ sqlite3_finalize (cur_stmt);
+ cur_stmt = NULL;
}
- result = false ;
+ result = false;
break;
default:
- LOG_ERROR ("got an unknown error code from sqlite3_step") ;
+ LOG_ERROR ("got an unknown error code from sqlite3_step");
if (cur_stmt) {
- sqlite3_finalize (cur_stmt) ;
- cur_stmt = NULL ;
+ sqlite3_finalize (cur_stmt);
+ cur_stmt = NULL;
}
- result = false ;
+ result = false;
break;
}
- return result ;
+ return result;
}
bool
@@ -145,21 +145,21 @@ SqliteCnxDrv::Priv::check_offset (gulong a_offset)
{
if (!cur_stmt
|| (static_cast<glong> (a_offset) >= sqlite3_column_count (cur_stmt)))
- return false ;
- return true ;
+ return false;
+ return true;
}
SqliteCnxDrv::SqliteCnxDrv (sqlite3 *a_sqlite_handle)
{
- THROW_IF_FAIL (a_sqlite_handle) ;
- m_priv.reset (new Priv) ;
- m_priv->sqlite.reset (a_sqlite_handle) ;
+ THROW_IF_FAIL (a_sqlite_handle);
+ m_priv.reset (new Priv);
+ m_priv->sqlite.reset (a_sqlite_handle);
}
SqliteCnxDrv::~SqliteCnxDrv ()
{
- LOG_D ("delete", "destructor-domain") ;
- close () ;
+ LOG_D ("delete", "destructor-domain");
+ close ();
}
const char*
@@ -168,145 +168,145 @@ SqliteCnxDrv::get_last_error () const
if (m_priv && m_priv->sqlite) {
return sqlite3_errmsg (m_priv->sqlite.get ());
}
- return NULL ;
+ return NULL;
}
bool
SqliteCnxDrv::start_transaction ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv && m_priv->sqlite) ;
- return execute_statement (SQLStatement ("begin transaction")) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv && m_priv->sqlite);
+ return execute_statement (SQLStatement ("begin transaction"));
}
bool
SqliteCnxDrv::commit_transaction ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv && m_priv->sqlite) ;
- return execute_statement (SQLStatement ("commit")) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv && m_priv->sqlite);
+ return execute_statement (SQLStatement ("commit"));
}
bool
SqliteCnxDrv::rollback_transaction ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv && m_priv->sqlite) ;
- return execute_statement (SQLStatement ("rollback")) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv && m_priv->sqlite);
+ return execute_statement (SQLStatement ("rollback"));
}
bool
SqliteCnxDrv::execute_statement (const SQLStatement &a_statement)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv && m_priv->sqlite) ;
- LOG_VERBOSE ("sql string: " << a_statement) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv && m_priv->sqlite);
+ LOG_VERBOSE ("sql string: " << a_statement);
//if the previous statement
//(also contains the resulting context of a query
//execution) hasn't been deleted, delete it before
//we go forward.
if (m_priv->cur_stmt) {
- sqlite3_finalize (m_priv->cur_stmt) ;
- m_priv->cur_stmt = NULL ;
- m_priv->last_execution_result = SQLITE_OK ;
+ sqlite3_finalize (m_priv->cur_stmt);
+ m_priv->cur_stmt = NULL;
+ m_priv->last_execution_result = SQLITE_OK;
}
if (a_statement.to_string().bytes () == 0)
- return false ;
+ return false;
int status = sqlite3_prepare (m_priv->sqlite.get (),
a_statement.to_string ().c_str (),
a_statement.to_string ().bytes (),
&m_priv->cur_stmt,
- NULL) ;
+ NULL);
if (status != SQLITE_OK) {
LOG_ERROR ("sqlite3_prepare() failed, returning: "
<< status << ":" << get_last_error ()
- << ": sql was: '" << a_statement.to_string () + "'") ;
- return false ;
+ << ": sql was: '" << a_statement.to_string () + "'");
+ return false;
}
- THROW_IF_FAIL (m_priv->cur_stmt) ;
+ THROW_IF_FAIL (m_priv->cur_stmt);
if (!should_have_data ()) {
- return m_priv->step_cur_statement () ;
+ return m_priv->step_cur_statement ();
}
- return true ;
+ return true;
}
bool
SqliteCnxDrv::should_have_data () const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
if (get_number_of_columns () > 0)
- return true ;
- return false ;
+ return true;
+ return false;
}
bool
SqliteCnxDrv::read_next_row ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
if (m_priv->cur_stmt) {
if (m_priv->last_execution_result == SQLITE_DONE) {
- return false ;
+ return false;
} else {
- bool res = m_priv->step_cur_statement () ;
+ bool res = m_priv->step_cur_statement ();
if (res == true) {
if (m_priv->last_execution_result == SQLITE_DONE) {
//there is no more data to fetch.
- return false ;
+ return false;
} else {
- return true ;
+ return true;
}
}
}
}
- return false ;
+ return false;
}
unsigned int
SqliteCnxDrv::get_number_of_columns () const
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
if (!m_priv->cur_stmt)
- return 0 ;
- return sqlite3_column_count (m_priv->cur_stmt) ;
+ return 0;
+ return sqlite3_column_count (m_priv->cur_stmt);
}
bool
SqliteCnxDrv::get_column_content (unsigned long a_offset,
Buffer &a_column_content) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
- RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
+ RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false);
a_column_content.set
(static_cast<const char*>(sqlite3_column_blob (m_priv->cur_stmt, a_offset)),
- sqlite3_column_bytes (m_priv->cur_stmt, a_offset)) ;
- return true ;
+ sqlite3_column_bytes (m_priv->cur_stmt, a_offset));
+ return true;
}
bool
SqliteCnxDrv::get_column_content (gulong a_offset,
gint64 &a_column_content) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
- RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
- int type = sqlite3_column_type (m_priv->cur_stmt, a_offset) ;
+ RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false);
+ int type = sqlite3_column_type (m_priv->cur_stmt, a_offset);
if ((type != SQLITE_INTEGER) && (type != SQLITE_NULL)) {
LOG_ERROR ("column number "<< static_cast<int> (a_column_content)
- << " is not of integer type") ;
- return false ;
+ << " is not of integer type");
+ return false;
}
- a_column_content = sqlite3_column_int64 (m_priv->cur_stmt, a_offset) ;
- return true ;
+ a_column_content = sqlite3_column_int64 (m_priv->cur_stmt, a_offset);
+ return true;
}
@@ -314,92 +314,92 @@ bool
SqliteCnxDrv::get_column_content (gulong a_offset,
double& a_column_content) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
- int type = sqlite3_column_type (m_priv->cur_stmt, a_offset) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false);
+ int type = sqlite3_column_type (m_priv->cur_stmt, a_offset);
if ((type != SQLITE_FLOAT) && (type != SQLITE_NULL)) {
LOG_ERROR ("column number " << (int) a_offset
- << " is not of type float") ;
- return false ;
+ << " is not of type float");
+ return false;
}
- a_column_content = sqlite3_column_double (m_priv->cur_stmt, a_offset) ;
- return true ;
+ a_column_content = sqlite3_column_double (m_priv->cur_stmt, a_offset);
+ return true;
}
bool
SqliteCnxDrv::get_column_content (gulong a_offset,
UString& a_column_content) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
- RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
- int type = sqlite3_column_type (m_priv->cur_stmt, a_offset) ;
+ RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false);
+ int type = sqlite3_column_type (m_priv->cur_stmt, a_offset);
if (type == SQLITE_BLOB) {
- LOG_ERROR ("column number " << (int) a_offset << " is of type blob") ;
- return false ;
+ LOG_ERROR ("column number " << (int) a_offset << " is of type blob");
+ return false;
}
a_column_content =
reinterpret_cast<const char*>(sqlite3_column_text(m_priv->cur_stmt,a_offset));
- return true ;
+ return true;
}
bool
SqliteCnxDrv::get_column_type (unsigned long a_offset,
enum ColumnType &a_type) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
- int type = sqlite3_column_type (m_priv->cur_stmt, a_offset) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false);
+ int type = sqlite3_column_type (m_priv->cur_stmt, a_offset);
switch (type) {
case SQLITE_INTEGER:
- a_type = COLUMN_TYPE_INT ;
+ a_type = COLUMN_TYPE_INT;
break;
case SQLITE_FLOAT:
- a_type = COLUMN_TYPE_DOUBLE ;
+ a_type = COLUMN_TYPE_DOUBLE;
break;
case SQLITE_TEXT:
- a_type = COLUMN_TYPE_STRING ;
- break ;
+ a_type = COLUMN_TYPE_STRING;
+ break;
case SQLITE_BLOB:
- a_type = COLUMN_TYPE_BLOB ;
+ a_type = COLUMN_TYPE_BLOB;
break;
case SQLITE_NULL:
- a_type = COLUMN_TYPE_BLOB ;
- break ;
+ a_type = COLUMN_TYPE_BLOB;
+ break;
default:
- a_type = COLUMN_TYPE_UNKNOWN ;
+ a_type = COLUMN_TYPE_UNKNOWN;
break;
}
- return true ;
+ return true;
}
bool
SqliteCnxDrv::get_column_name (unsigned long a_offset, Buffer &a_name) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
- RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false) ;
- const char* name = sqlite3_column_name (m_priv->cur_stmt, a_offset) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
+ RETURN_VAL_IF_FAIL (m_priv->check_offset (a_offset), false);
+ const char* name = sqlite3_column_name (m_priv->cur_stmt, a_offset);
if (!name)
- return false ;
- a_name.set (name, strlen (name)) ;
- return true ;
+ return false;
+ a_name.set (name, strlen (name));
+ return true;
}
void
SqliteCnxDrv::close ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- THROW_IF_FAIL (m_priv) ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ THROW_IF_FAIL (m_priv);
if (m_priv->sqlite) {
if (m_priv->cur_stmt) {
- sqlite3_finalize (m_priv->cur_stmt) ;
+ sqlite3_finalize (m_priv->cur_stmt);
m_priv->cur_stmt = NULL;
}
}
diff --git a/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.h b/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.h
index 74ad66e..05031e2 100644
--- a/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.h
+++ b/src/dbdimpl/sqlite/nmv-sqlite-cnx-drv.h
@@ -31,60 +31,60 @@
namespace nemiver {
namespace common {
-class SQLStatement ;
+class SQLStatement;
}
namespace common {
namespace sqlite {
class SqliteCnxDrv: public common::IConnectionDriver {
- struct Priv ;
- friend class SqliteCnxMgrDrv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ friend class SqliteCnxMgrDrv;
+ SafePtr<Priv> m_priv;
//forbid copy
- SqliteCnxDrv (const SqliteCnxDrv &) ;
- SqliteCnxDrv& operator= (const SqliteCnxDrv &) ;
+ SqliteCnxDrv (const SqliteCnxDrv &);
+ SqliteCnxDrv& operator= (const SqliteCnxDrv &);
- SqliteCnxDrv (sqlite3 *a_sqlite_handle) ;
- virtual ~SqliteCnxDrv () ;
+ SqliteCnxDrv (sqlite3 *a_sqlite_handle);
+ virtual ~SqliteCnxDrv ();
public:
- const char* get_last_error () const ;
+ const char* get_last_error () const;
- bool start_transaction () ;
+ bool start_transaction ();
- bool commit_transaction () ;
+ bool commit_transaction ();
- bool rollback_transaction () ;
+ bool rollback_transaction ();
- bool execute_statement (const common::SQLStatement &a_statement) ;
+ bool execute_statement (const common::SQLStatement &a_statement);
- bool should_have_data () const ;
+ bool should_have_data () const;
- bool read_next_row () ;
+ bool read_next_row ();
- unsigned int get_number_of_columns () const ;
+ unsigned int get_number_of_columns () const;
bool get_column_type (unsigned long a_offset,
- enum common::ColumnType &a_type) const ;
+ enum common::ColumnType &a_type) const;
- bool get_column_name (unsigned long a_offset, common::Buffer &a_name) const ;
+ bool get_column_name (unsigned long a_offset, common::Buffer &a_name) const;
bool get_column_content (unsigned long a_offset,
- common::Buffer &a_column_content) const ;
+ common::Buffer &a_column_content) const;
bool get_column_content (gulong a_offset,
- gint64 &a_column_content) const ;
+ gint64 &a_column_content) const;
bool get_column_content (gulong a_offset,
- double& a_column_content) const ;
+ double& a_column_content) const;
bool get_column_content (gulong a_offset,
- common::UString& a_column_content) const ;
+ common::UString& a_column_content) const;
- void close () ;
+ void close ();
};//end IConnectionDriver
}//end namespace sqlite
diff --git a/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.cc b/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.cc
index 4af3860..348d7c9 100644
--- a/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.cc
+++ b/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.cc
@@ -33,7 +33,7 @@
#include "nmv-sqlite-cnx-drv.h"
#include "nmv-sqlite-cnx-mgr-drv.h"
-using namespace nemiver::common ;
+using namespace nemiver::common;
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (common)
@@ -45,20 +45,20 @@ struct SqliteCnxMgrDrvPriv {
SqliteCnxMgrDrv::SqliteCnxMgrDrv (DynamicModule *a_dynmod) :
IConnectionManagerDriver (a_dynmod)
{
- m_priv = new SqliteCnxMgrDrvPriv () ;
+ m_priv = new SqliteCnxMgrDrvPriv ();
//this is a singleton.
- enable_refcount (false) ;
+ enable_refcount (false);
}
SqliteCnxMgrDrv::~SqliteCnxMgrDrv ()
{
if (!m_priv) {
- return ;
+ return;
}
- delete m_priv ;
- m_priv = NULL ;
+ delete m_priv;
+ m_priv = NULL;
}
@@ -74,36 +74,36 @@ SqliteCnxMgrDrv::connect_to_db (const DBDesc &a_db_desc,
//HACK. As we are using sqlite, make sure to use a db file
//that is in $HOME/.nemiver/db/sqlite
- UString db_name (a_db_desc.name ()) ;
+ UString db_name (a_db_desc.name ());
if (!Glib::path_is_absolute (db_name)) {
if (!Glib::file_test (env::get_user_db_dir (),
Glib::FILE_TEST_IS_DIR)) {
- env::create_user_db_dir () ;
+ env::create_user_db_dir ();
}
db_name = Glib::build_filename (env::get_user_db_dir (),
- db_name).c_str () ;
+ db_name).c_str ();
}
- int result = sqlite3_open (db_name.c_str (), &sqlite) ;
+ int result = sqlite3_open (db_name.c_str (), &sqlite);
if (result != SQLITE_OK) {
THROW ("could not connect to sqlite database: "
- + UString (sqlite3_errmsg(sqlite))) ;
+ + UString (sqlite3_errmsg(sqlite)));
sqlite3_close (sqlite);
exit(1);
}
common::IConnectionDriverSafePtr connection_driver
- (new SqliteCnxDrv (sqlite)) ;
- return connection_driver ;
+ (new SqliteCnxDrv (sqlite));
+ return connection_driver;
}
class SqliteCnxMgrModule : public DynamicModule {
void get_info (Info &a_info) const
{
- a_info.module_name = "org.nemiver.db.sqlitedriver.default" ;
+ a_info.module_name = "org.nemiver.db.sqlitedriver.default";
a_info.module_description = "The nemiver database driver for sqlite."
" Implements the IConnectionManagerDriver "
- "iface" ;
- a_info.module_version = "0.0.1" ;
+ "iface";
+ a_info.module_version = "0.0.1";
}
void do_init ()
@@ -114,13 +114,13 @@ class SqliteCnxMgrModule : public DynamicModule {
DynModIfaceSafePtr &a_iface)
{
if (a_iface_name == "IConnectionManagerDriver") {
- static SqliteCnxMgrDrv s_driver (this) ;
- s_driver.enable_refcount (false) ;
- a_iface.reset (&s_driver, true) ;
+ static SqliteCnxMgrDrv s_driver (this);
+ s_driver.enable_refcount (false);
+ a_iface.reset (&s_driver, true);
} else {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
};//end class SqliteCnxMgrModule
@@ -134,22 +134,22 @@ bool
NEMIVER_API
nemiver_common_create_dynamic_module_instance (void **a_new_instance)
{
- RETURN_VAL_IF_FAIL (a_new_instance, false) ;
+ RETURN_VAL_IF_FAIL (a_new_instance, false);
try {
nemiver::common::sqlite::SqliteCnxMgrModule *module =
- new nemiver::common::sqlite::SqliteCnxMgrModule ;
- *a_new_instance = module ;
+ new nemiver::common::sqlite::SqliteCnxMgrModule;
+ *a_new_instance = module;
} catch (std::exception &e) {
- TRACE_EXCEPTION (e) ;
- return false ;
+ TRACE_EXCEPTION (e);
+ return false;
} catch (Glib::Exception &e) {
- TRACE_EXCEPTION (e) ;
- return false ;
+ TRACE_EXCEPTION (e);
+ return false;
} catch (...) {
- LOG ("Got an unknown exception") ;
- return false ;
+ LOG ("Got an unknown exception");
+ return false;
}
- return true ;
+ return true;
}
}//end extern C
diff --git a/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.h b/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.h
index dc2bb8a..877bbd4 100644
--- a/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.h
+++ b/src/dbdimpl/sqlite/nmv-sqlite-cnx-mgr-drv.h
@@ -33,25 +33,25 @@ namespace nemiver {
namespace common {
namespace sqlite {
-struct SqliteCnxMgrDrvPriv ;
+struct SqliteCnxMgrDrvPriv;
class SqliteCnxMgrDrv : public common::IConnectionManagerDriver {
- friend struct SqliteCnxMgrDrvPriv ;
- friend class SqliteCnxMgrModule ;
- struct SqliteCnxMgrDrvPriv *m_priv ;
+ friend struct SqliteCnxMgrDrvPriv;
+ friend class SqliteCnxMgrModule;
+ struct SqliteCnxMgrDrvPriv *m_priv;
//forbid copy
- SqliteCnxMgrDrv (const SqliteCnxMgrDrv&) ;
- SqliteCnxMgrDrv& operator= (const SqliteCnxMgrDrv&) ;
+ SqliteCnxMgrDrv (const SqliteCnxMgrDrv&);
+ SqliteCnxMgrDrv& operator= (const SqliteCnxMgrDrv&);
- SqliteCnxMgrDrv (DynamicModule *a_dynmod) ;
- virtual ~SqliteCnxMgrDrv () ;
+ SqliteCnxMgrDrv (DynamicModule *a_dynmod);
+ virtual ~SqliteCnxMgrDrv ();
public:
common::IConnectionDriverSafePtr connect_to_db
(const common::DBDesc &a_desc,
const common::UString &a_user,
- const common::UString &a_pass) ;
+ const common::UString &a_pass);
};//end SqliteCnxMgrDrv
}//end namespace sqlite
diff --git a/src/dbgengine/nmv-cpp-trait.cc b/src/dbgengine/nmv-cpp-trait.cc
index 771c3d3..f6baa14 100644
--- a/src/dbgengine/nmv-cpp-trait.cc
+++ b/src/dbgengine/nmv-cpp-trait.cc
@@ -27,32 +27,32 @@
#include "nmv-i-lang-trait.h"
-using nemiver::common::UString ;
-using nemiver::common::DynModIfaceSafePtr ;
+using nemiver::common::UString;
+using nemiver::common::DynModIfaceSafePtr;
NEMIVER_BEGIN_NAMESPACE (nemiver)
class CPPTrait : public ILangTrait {
//non copyable
- CPPTrait (const CPPTrait &) ;
- CPPTrait& operator= (const CPPTrait &) ;
+ CPPTrait (const CPPTrait &);
+ CPPTrait& operator= (const CPPTrait &);
- UString m_name ;
+ UString m_name;
public:
- CPPTrait (DynamicModule *a_dynmod) ;
- ~CPPTrait () ;
- const UString& get_name () const ;
- bool has_pointers () const ;
- bool is_type_a_pointer (const UString &a_type) const ;
- bool is_variable_compound (const IDebugger::VariableSafePtr a_var) const ;
+ CPPTrait (DynamicModule *a_dynmod);
+ ~CPPTrait ();
+ const UString& get_name () const;
+ bool has_pointers () const;
+ bool is_type_a_pointer (const UString &a_type) const;
+ bool is_variable_compound (const IDebugger::VariableSafePtr a_var) const;
};//end class CPPTrait
CPPTrait::CPPTrait (DynamicModule *a_dynmod):
ILangTrait (a_dynmod)
{
- m_name = "cpptrait" ;
+ m_name = "cpptrait";
}
CPPTrait::~CPPTrait ()
@@ -62,7 +62,7 @@ CPPTrait::~CPPTrait ()
const UString&
CPPTrait::get_name () const
{
- return m_name ;
+ return m_name;
}
bool
@@ -73,26 +73,26 @@ CPPTrait::has_pointers () const
bool
CPPTrait::is_type_a_pointer (const UString &a_type) const
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- LOG_DD ("type: '" << a_type << "'") ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ LOG_DD ("type: '" << a_type << "'");
UString type (a_type);
- type.chomp () ;
+ type.chomp ();
if (type[type.size () - 1] == '*') {
- LOG_DD ("type is a pointer") ;
- return true ;
+ LOG_DD ("type is a pointer");
+ return true;
}
if (type.size () < 8) {
- LOG_DD ("type is not a pointer") ;
- return false ;
+ LOG_DD ("type is not a pointer");
+ return false;
}
- UString::size_type i = type.size () - 7 ;
+ UString::size_type i = type.size () - 7;
if (!a_type.compare (i, 7, "* const")) {
- LOG_DD ("type is a pointer") ;
- return true ;
+ LOG_DD ("type is a pointer");
+ return true;
}
- LOG_DD ("type is not a pointer") ;
- return false ;
+ LOG_DD ("type is not a pointer");
+ return false;
}
bool
@@ -113,8 +113,8 @@ public:
const static Info s_info ("cpptraitmodule",
"The C++ languaqe trait. "
"Implements the ILangTrait interface",
- "1.0") ;
- a_info = s_info ;
+ "1.0");
+ a_info = s_info;
}
void do_init ()
@@ -125,11 +125,11 @@ public:
DynModIfaceSafePtr &a_iface)
{
if (a_iface_name == "ILangTrait") {
- a_iface.reset (new CPPTrait (this)) ;
+ a_iface.reset (new CPPTrait (this));
} else {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
};//end CPPTraitModule
@@ -140,8 +140,8 @@ extern "C" {
bool
NEMIVER_API nemiver_common_create_dynamic_module_instance (void **a_new_instance)
{
- *a_new_instance = new nemiver::CPPTraitModule () ;
- return (*a_new_instance != 0) ;
+ *a_new_instance = new nemiver::CPPTraitModule ();
+ return (*a_new_instance != 0);
}
}//end extern C
diff --git a/src/dbgengine/nmv-dbg-common.cc b/src/dbgengine/nmv-dbg-common.cc
index cdc9445..9c4d2f0 100644
--- a/src/dbgengine/nmv-dbg-common.cc
+++ b/src/dbgengine/nmv-dbg-common.cc
@@ -28,12 +28,12 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
struct OutputHandlerList::Priv {
- list<OutputHandlerSafePtr> output_handlers ;
+ list<OutputHandlerSafePtr> output_handlers;
};//end OutputHandlerList
OutputHandlerList::OutputHandlerList ()
{
- m_priv.reset (new OutputHandlerList::Priv) ;
+ m_priv.reset (new OutputHandlerList::Priv);
}
OutputHandlerList::~OutputHandlerList ()
@@ -43,20 +43,20 @@ OutputHandlerList::~OutputHandlerList ()
void
OutputHandlerList::add (const OutputHandlerSafePtr &a_handler)
{
- THROW_IF_FAIL (m_priv) ;
- m_priv->output_handlers.push_back (a_handler) ;
+ THROW_IF_FAIL (m_priv);
+ m_priv->output_handlers.push_back (a_handler);
}
void
OutputHandlerList::submit_command_and_output (CommandAndOutput &a_cao)
{
- list<OutputHandlerSafePtr>::iterator iter ;
- for (iter = m_priv->output_handlers.begin () ;
+ list<OutputHandlerSafePtr>::iterator iter;
+ for (iter = m_priv->output_handlers.begin ();
iter != m_priv->output_handlers.end ();
++iter)
{
if ((*iter)->can_handle (a_cao)) {
- (*iter)->do_handle (a_cao) ;
+ (*iter)->do_handle (a_cao);
}
}
}
diff --git a/src/dbgengine/nmv-dbg-common.h b/src/dbgengine/nmv-dbg-common.h
index 7723bbd..ad84589 100644
--- a/src/dbgengine/nmv-dbg-common.h
+++ b/src/dbgengine/nmv-dbg-common.h
@@ -30,13 +30,13 @@ NEMIVER_BEGIN_NAMESPACE (nemiver)
/// \brief A container of the textual command sent to the debugger
class Command {
- UString m_cookie ;
- UString m_name ;
+ UString m_cookie;
+ UString m_name;
UString m_value;
- UString m_tag0 ;
- UString m_tag1 ;
+ UString m_tag0;
+ UString m_tag1;
int m_tag2;
- IDebugger::VariableSafePtr m_var ;
+ IDebugger::VariableSafePtr m_var;
sigc::slot_base m_slot;
public:
@@ -121,7 +121,7 @@ public:
void clear ()
{
- m_name.clear () ;
+ m_name.clear ();
m_value.clear ();
m_tag0.clear ();
m_tag1.clear ();
@@ -144,9 +144,9 @@ public:
///debugger console (to be displayed by the CLI),
///or the target output stream or the debugger log stream.
class StreamRecord {
- UString m_debugger_console ;
- UString m_target_output ;
- UString m_debugger_log ;
+ UString m_debugger_console;
+ UString m_target_output;
+ UString m_debugger_log;
public:
@@ -178,9 +178,9 @@ public:
void clear ()
{
- m_debugger_console = "" ;
- m_target_output = "" ;
- m_debugger_log = "" ;
+ m_debugger_console = "";
+ m_target_output = "";
+ m_debugger_log = "";
}
};//end class StreamRecord
@@ -197,15 +197,15 @@ public:
private:
bool m_has_stream_record;
- StreamRecord m_stream_record ;
- bool m_is_stopped ;
- IDebugger::StopReason m_stop_reason ;
- bool m_has_frame ;
- IDebugger::Frame m_frame ;
- long m_breakpoint_number ;
- long m_thread_id ;
- UString m_signal_type ;
- UString m_signal_meaning ;
+ StreamRecord m_stream_record;
+ bool m_is_stopped;
+ IDebugger::StopReason m_stop_reason;
+ bool m_has_frame;
+ IDebugger::Frame m_frame;
+ long m_breakpoint_number;
+ long m_thread_id;
+ UString m_signal_type;
+ UString m_signal_meaning;
public:
@@ -213,50 +213,50 @@ public:
UString stop_reason_to_string (IDebugger::StopReason a_reason) const
{
- UString result ("undefined") ;
+ UString result ("undefined");
switch (a_reason) {
case IDebugger::UNDEFINED_REASON:
- return "undefined" ;
- break ;
+ return "undefined";
+ break;
case IDebugger::BREAKPOINT_HIT:
- return "breakpoint-hit" ;
- break ;
+ return "breakpoint-hit";
+ break;
case IDebugger::WATCHPOINT_TRIGGER:
- return "watchpoint-trigger" ;
- break ;
+ return "watchpoint-trigger";
+ break;
case IDebugger::READ_WATCHPOINT_TRIGGER:
- return "read-watchpoint-trigger" ;
- break ;
+ return "read-watchpoint-trigger";
+ break;
case IDebugger::ACCESS_WATCHPOINT_TRIGGER:
- return "access-watchpoint-trigger" ;
- break ;
+ return "access-watchpoint-trigger";
+ break;
case IDebugger::FUNCTION_FINISHED:
- return "function-finished" ;
- break ;
+ return "function-finished";
+ break;
case IDebugger::LOCATION_REACHED:
- return "location-reached" ;
- break ;
+ return "location-reached";
+ break;
case IDebugger::WATCHPOINT_SCOPE:
- return "watchpoint-scope" ;
- break ;
+ return "watchpoint-scope";
+ break;
case IDebugger::END_STEPPING_RANGE:
- return "end-stepping-range" ;
- break ;
+ return "end-stepping-range";
+ break;
case IDebugger::EXITED_SIGNALLED:
- return "exited-signaled" ;
- break ;
+ return "exited-signaled";
+ break;
case IDebugger::EXITED:
- return "exited" ;
- break ;
+ return "exited";
+ break;
case IDebugger::EXITED_NORMALLY:
- return "exited-normally" ;
- break ;
+ return "exited-normally";
+ break;
case IDebugger::SIGNAL_RECEIVED:
- return "signal-received" ;
- break ;
+ return "signal-received";
+ break;
}
- return result ;
+ return result;
}
/// \accessors
@@ -273,10 +273,10 @@ public:
bool is_stopped () const {return m_is_stopped;}
void is_stopped (bool a_in) {m_is_stopped = a_in;}
- IDebugger::StopReason stop_reason () const {return m_stop_reason ;}
+ IDebugger::StopReason stop_reason () const {return m_stop_reason;}
UString stop_reason_as_str () const
{
- return stop_reason_to_string (m_stop_reason) ;
+ return stop_reason_to_string (m_stop_reason);
}
void stop_reason (IDebugger::StopReason a_in) {m_stop_reason = a_in;}
@@ -287,7 +287,7 @@ public:
IDebugger::Frame& frame () {return m_frame;}
void frame (const IDebugger::Frame &a_in) {m_frame = a_in;}
- long breakpoint_number () const {return m_breakpoint_number ;}
+ long breakpoint_number () const {return m_breakpoint_number;}
void breakpoint_number (long a_in) {m_breakpoint_number = a_in;}
long thread_id () const {return m_thread_id;}
@@ -305,15 +305,15 @@ public:
void clear ()
{
- m_has_stream_record = false ;
- m_stream_record.clear () ;
- m_is_stopped = false ;
- m_stop_reason = IDebugger::UNDEFINED_REASON ;
- m_has_frame = false ;
- m_frame.clear () ;
- m_breakpoint_number = 0 ;
+ m_has_stream_record = false;
+ m_stream_record.clear ();
+ m_is_stopped = false;
+ m_stop_reason = IDebugger::UNDEFINED_REASON;
+ m_has_frame = false;
+ m_frame.clear ();
+ m_breakpoint_number = 0;
m_thread_id = -1;
- m_signal_type.clear () ;
+ m_signal_type.clear ();
}
};//end class OutOfBandRecord
@@ -339,55 +339,55 @@ public:
};//end enum Kind
private:
- Kind m_kind ;
- map<int, IDebugger::BreakPoint> m_breakpoints ;
- map<UString, UString> m_attrs ;
+ Kind m_kind;
+ map<int, IDebugger::BreakPoint> m_breakpoints;
+ map<UString, UString> m_attrs;
//call stack listed members
- vector<IDebugger::Frame> m_call_stack ;
- bool m_has_call_stack ;
+ vector<IDebugger::Frame> m_call_stack;
+ bool m_has_call_stack;
//frame parameters listed members
- map<int, list<IDebugger::VariableSafePtr> > m_frames_parameters ;
+ map<int, list<IDebugger::VariableSafePtr> > m_frames_parameters;
bool m_has_frames_parameters;
//local variable listed members
- list<IDebugger::VariableSafePtr> m_local_variables ;
- bool m_has_local_variables ;
+ list<IDebugger::VariableSafePtr> m_local_variables;
+ bool m_has_local_variables;
//variable value evaluated members
- IDebugger::VariableSafePtr m_variable_value ;
- bool m_has_variable_value ;
+ IDebugger::VariableSafePtr m_variable_value;
+ bool m_has_variable_value;
//threads listed members
- std::list<int> m_thread_list ;
- bool m_has_thread_list ;
+ std::list<int> m_thread_list;
+ bool m_has_thread_list;
//files listed members
- std::vector<UString> m_file_list ;
- bool m_has_file_list ;
+ std::vector<UString> m_file_list;
+ bool m_has_file_list;
//new thread id selected members
- int m_thread_id ;
- IDebugger::Frame m_frame_in_thread ;
- bool m_thread_id_got_selected ;
+ int m_thread_id;
+ IDebugger::Frame m_frame_in_thread;
+ bool m_thread_id_got_selected;
//TODO: finish (re)initialisation of thread id selected members
//current frame, in the context of a core file stack trace.
- IDebugger::Frame m_current_frame_in_core_stack_trace ;
- bool m_has_current_frame_in_core_stack_trace ;
+ IDebugger::Frame m_current_frame_in_core_stack_trace;
+ bool m_has_current_frame_in_core_stack_trace;
// register names
- std::map<IDebugger::register_id_t, UString> m_register_names ;
- bool m_has_register_names ;
+ std::map<IDebugger::register_id_t, UString> m_register_names;
+ bool m_has_register_names;
// register values
- std::map<IDebugger::register_id_t, UString> m_register_values ;
- bool m_has_register_values ;
+ std::map<IDebugger::register_id_t, UString> m_register_values;
+ bool m_has_register_values;
// changed registers
- std::list<IDebugger::register_id_t> m_changed_registers ;
- bool m_has_changed_registers ;
+ std::list<IDebugger::register_id_t> m_changed_registers;
+ bool m_has_changed_registers;
// memory values
std::vector<uint8_t> m_memory_values;
@@ -415,30 +415,30 @@ public:
bool m_has_path_expression;
public:
- ResultRecord () {clear () ;}
+ ResultRecord () {clear ();}
/// blank out everything
void clear ()
{
- m_kind = UNDEFINED ;
- m_breakpoints.clear () ;
- m_attrs.clear () ;
- m_call_stack.clear () ;
- m_has_call_stack = false ;
- m_frames_parameters.clear () ;
- m_has_frames_parameters = false ;
- m_local_variables.clear () ;
- m_has_local_variables = false ;
- m_variable_value.reset () ;
- m_has_variable_value = false ;
- m_thread_list.clear () ;
- m_has_thread_list = false ;
+ m_kind = UNDEFINED;
+ m_breakpoints.clear ();
+ m_attrs.clear ();
+ m_call_stack.clear ();
+ m_has_call_stack = false;
+ m_frames_parameters.clear ();
+ m_has_frames_parameters = false;
+ m_local_variables.clear ();
+ m_has_local_variables = false;
+ m_variable_value.reset ();
+ m_has_variable_value = false;
+ m_thread_list.clear ();
+ m_has_thread_list = false;
m_thread_id = 0;
- m_frame_in_thread.clear () ;
+ m_frame_in_thread.clear ();
m_thread_id_got_selected = false;
- m_file_list.clear () ;
- m_has_file_list = false ;
- m_has_current_frame_in_core_stack_trace = false ;
+ m_file_list.clear ();
+ m_has_file_list = false;
+ m_has_current_frame_in_core_stack_trace = false;
m_has_changed_registers = false;
m_changed_registers.clear ();
m_has_register_values = false;
@@ -479,7 +479,7 @@ public:
void call_stack (const vector<IDebugger::Frame> &a_in)
{
m_call_stack = a_in;
- has_call_stack (true) ;
+ has_call_stack (true);
}
bool has_register_names () const { return m_has_register_names; }
void has_register_names (bool a_flag) { m_has_register_names = a_flag; }
@@ -540,13 +540,13 @@ public:
const map<int, list<IDebugger::VariableSafePtr> >&
frames_parameters () const
{
- return m_frames_parameters ;
+ return m_frames_parameters;
}
void frames_parameters
(const map<int, list<IDebugger::VariableSafePtr> > &a_in)
{
- m_frames_parameters = a_in ;
- has_frames_parameters (true) ;
+ m_frames_parameters = a_in;
+ has_frames_parameters (true);
}
bool has_frames_parameters () const {return m_has_frames_parameters;}
@@ -554,12 +554,12 @@ public:
const list<IDebugger::VariableSafePtr>& local_variables () const
{
- return m_local_variables ;
+ return m_local_variables;
}
void local_variables (const list<IDebugger::VariableSafePtr> &a_in)
{
- m_local_variables = a_in ;
- has_local_variables (true) ;
+ m_local_variables = a_in;
+ has_local_variables (true);
}
bool has_local_variables () const {return m_has_local_variables;}
@@ -567,12 +567,12 @@ public:
const IDebugger::VariableSafePtr& variable_value () const
{
- return m_variable_value ;
+ return m_variable_value;
}
void variable_value (const IDebugger::VariableSafePtr &a_in)
{
- m_variable_value = a_in ;
- has_variable_value (true) ;
+ m_variable_value = a_in;
+ has_variable_value (true);
}
bool has_variable_value () const {return m_has_variable_value;}
@@ -585,7 +585,7 @@ public:
void thread_list (const std::list<int> &a_in)
{
m_thread_list = a_in;
- has_thread_list (true) ;
+ has_thread_list (true);
}
bool thread_id_got_selected () const {return m_thread_id_got_selected;}
@@ -599,9 +599,9 @@ public:
void thread_id_selected_info (int a_thread_id,
const IDebugger::Frame &a_frame_in_thread)
{
- m_thread_id = a_thread_id ;
- m_frame_in_thread = a_frame_in_thread ;
- thread_id_got_selected (true) ;
+ m_thread_id = a_thread_id;
+ m_frame_in_thread = a_frame_in_thread;
+ thread_id_got_selected (true);
}
bool has_file_list () const {return m_has_file_list;}
@@ -611,26 +611,26 @@ public:
void file_list (const std::vector<UString> &a_in)
{
m_file_list = a_in;
- has_file_list (true) ;
+ has_file_list (true);
}
const IDebugger::Frame& current_frame_in_core_stack_trace ()
{
- return m_current_frame_in_core_stack_trace ;
+ return m_current_frame_in_core_stack_trace;
}
void current_frame_in_core_stack_trace (const IDebugger::Frame& a_in)
{
- m_current_frame_in_core_stack_trace = a_in ;
- has_current_frame_in_core_stack_trace (true) ;
+ m_current_frame_in_core_stack_trace = a_in;
+ has_current_frame_in_core_stack_trace (true);
}
bool has_current_frame_in_core_stack_trace ()
{
- return m_has_current_frame_in_core_stack_trace ;
+ return m_has_current_frame_in_core_stack_trace;
}
void has_current_frame_in_core_stack_trace (bool a_in)
{
- m_has_current_frame_in_core_stack_trace = a_in ;
+ m_has_current_frame_in_core_stack_trace = a_in;
}
bool has_variable () {return m_has_variable; }
@@ -720,12 +720,12 @@ public:
};//end class ResultRecord
private:
- UString m_value ;
- bool m_parsing_succeeded ;
- bool m_has_out_of_band_record ;
- list<OutOfBandRecord> m_out_of_band_records ;
- bool m_has_result_record ;
- ResultRecord m_result_record ;
+ UString m_value;
+ bool m_parsing_succeeded;
+ bool m_has_out_of_band_record;
+ list<OutOfBandRecord> m_out_of_band_records;
+ bool m_has_result_record;
+ ResultRecord m_result_record;
public:
@@ -765,21 +765,21 @@ public:
void clear ()
{
- m_value = "" ;
- m_parsing_succeeded = false ;
- m_has_out_of_band_record = false ;
- m_out_of_band_records.clear () ;
- m_has_result_record = false ;
- m_result_record.clear () ;
+ m_value = "";
+ m_parsing_succeeded = false;
+ m_has_out_of_band_record = false;
+ m_out_of_band_records.clear ();
+ m_has_result_record = false;
+ m_result_record.clear ();
}
};//end class Output
/// A container of the Command sent to the debugger
/// and the output it sent back.
class CommandAndOutput {
- bool m_has_command ;
- Command m_command ;
- Output m_output ;
+ bool m_has_command;
+ Command m_command;
+ Output m_output;
public:
@@ -799,7 +799,7 @@ public:
/// @{
- bool has_command () const {return m_has_command ;}
+ bool has_command () const {return m_has_command;}
void has_command (bool a_in) {m_has_command = a_in;}
const Command& command () const {return m_command;}
@@ -835,7 +835,7 @@ struct OutputHandler : Object {
//how to handle a given debugger output
virtual void do_handle (CommandAndOutput &) {}
};//end struct OutputHandler
-typedef SafePtr<OutputHandler, ObjectRef, ObjectUnref> OutputHandlerSafePtr ;
+typedef SafePtr<OutputHandler, ObjectRef, ObjectUnref> OutputHandlerSafePtr;
/// A list of OutputHandlers
/// Instances of CommandAndOutput can be submitted
@@ -848,18 +848,18 @@ typedef SafePtr<OutputHandler, ObjectRef, ObjectUnref> OutputHandlerSafePtr ;
/// This is the mechanism that must be used to send signals about the state
/// of implementations of IDebugger.
class OutputHandlerList : Object {
- struct Priv ;
+ struct Priv;
SafePtr<Priv> m_priv;
//non copyable
- OutputHandlerList (const OutputHandlerList&) ;
- OutputHandlerList& operator= (const OutputHandlerList&) ;
+ OutputHandlerList (const OutputHandlerList&);
+ OutputHandlerList& operator= (const OutputHandlerList&);
public:
- OutputHandlerList () ;
- ~OutputHandlerList () ;
- void add (const OutputHandlerSafePtr &a_handler) ;
- void submit_command_and_output (CommandAndOutput &a_cao) ;
+ OutputHandlerList ();
+ ~OutputHandlerList ();
+ void add (const OutputHandlerSafePtr &a_handler);
+ void submit_command_and_output (CommandAndOutput &a_cao);
};//end class OutputHandlerList
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index ecad344..f08510b 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -129,11 +129,11 @@ public:
sigc::signal<void, const UString& > gdb_stdout_signal;
sigc::signal<void, const UString& > gdb_stderr_signal;
- mutable sigc::signal<void, Output&> pty_signal ;
+ mutable sigc::signal<void, Output&> pty_signal;
- mutable sigc::signal<void, CommandAndOutput&> stdout_signal ;
+ mutable sigc::signal<void, CommandAndOutput&> stdout_signal;
- mutable sigc::signal<void, Output&> stderr_signal ;
+ mutable sigc::signal<void, Output&> stderr_signal;
mutable sigc::signal<void, const UString&> console_message_signal;
mutable sigc::signal<void, const UString&> target_output_message_signal;
@@ -194,10 +194,10 @@ public:
current_frame_signal;
mutable sigc::signal<void, const list<VariableSafePtr>&, const UString& >
- local_variables_listed_signal ;
+ local_variables_listed_signal;
mutable sigc::signal<void, const list<VariableSafePtr>&, const UString& >
- global_variables_listed_signal ;
+ global_variables_listed_signal;
mutable sigc::signal<void,
const UString&,
@@ -1854,7 +1854,7 @@ struct OnResultRecordHandler : OutputHandler {
//set the name caption of the resulting variable.
UString name_caption;
a_in.command ().variable ()->build_qname (name_caption);
- name_caption = "*" + name_caption ;
+ name_caption = "*" + name_caption;
derefed->name_caption (name_caption);
//now associate the resulting variable or the dereferencing to
diff --git a/src/dbgengine/nmv-gdb-engine.h b/src/dbgengine/nmv-gdb-engine.h
index 8f6f4ed..d5b8e57 100644
--- a/src/dbgengine/nmv-gdb-engine.h
+++ b/src/dbgengine/nmv-gdb-engine.h
@@ -33,56 +33,56 @@ NEMIVER_BEGIN_NAMESPACE (nemiver)
class GDBEngine : public IDebugger {
- GDBEngine (const GDBEngine &) ;
- GDBEngine& operator= (const GDBEngine &) ;
+ GDBEngine (const GDBEngine &);
+ GDBEngine& operator= (const GDBEngine &);
- struct Priv ;
- SafePtr<Priv> m_priv ;
- friend struct Priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
+ friend struct Priv;
public:
- GDBEngine (DynamicModule *a_dynmod) ;
- virtual ~GDBEngine () ;
+ GDBEngine (DynamicModule *a_dynmod);
+ virtual ~GDBEngine ();
//*************
//<signals>
//*************
- sigc::signal<void, Output&>& pty_signal () const ;
+ sigc::signal<void, Output&>& pty_signal () const;
- sigc::signal<void, CommandAndOutput&>& stdout_signal () const ;
+ sigc::signal<void, CommandAndOutput&>& stdout_signal () const;
- sigc::signal<void, Output&>& stderr_signal () const ;
+ sigc::signal<void, Output&>& stderr_signal () const;
- sigc::signal<void>& engine_died_signal () const ;
+ sigc::signal<void>& engine_died_signal () const;
- sigc::signal<void, const UString&>& console_message_signal () const ;
+ sigc::signal<void, const UString&>& console_message_signal () const;
- sigc::signal<void, const UString&>& target_output_message_signal () const ;
+ sigc::signal<void, const UString&>& target_output_message_signal () const;
- sigc::signal<void, const UString&>& log_message_signal () const ;
+ sigc::signal<void, const UString&>& log_message_signal () const;
sigc::signal<void, const UString&, const UString&>&
- command_done_signal () const ;
+ command_done_signal () const;
- sigc::signal<void>& connected_to_server_signal () const ;
+ sigc::signal<void>& connected_to_server_signal () const;
- sigc::signal<void>& detached_from_target_signal () const ;
+ sigc::signal<void>& detached_from_target_signal () const;
sigc::signal<void, const map<int, IDebugger::BreakPoint>&, const UString&>&
- breakpoints_set_signal () const ;
+ breakpoints_set_signal () const;
sigc::signal<void, const vector<OverloadsChoiceEntry>&, const UString&>&
got_overloads_choice_signal () const;
sigc::signal<void, const IDebugger::BreakPoint&, int, const UString&>&
- breakpoint_deleted_signal () const ;
+ breakpoint_deleted_signal () const;
sigc::signal<void, const IDebugger::BreakPoint&, int>&
- breakpoint_disabled_signal () const ;
+ breakpoint_disabled_signal () const;
sigc::signal<void, const IDebugger::BreakPoint&, int>&
- breakpoint_enabled_signal () const ;
+ breakpoint_enabled_signal () const;
sigc::signal<void,
@@ -91,11 +91,11 @@ public:
const IDebugger::Frame&,
int,
int,
- const UString& /*cookie*/>& stopped_signal () const ;
+ const UString& /*cookie*/>& stopped_signal () const;
sigc::signal<void,
const list<int>,
- const UString& >& threads_listed_signal () const ;
+ const UString& >& threads_listed_signal () const;
sigc::signal<void, const vector<UString>&, const UString& >&
files_listed_signal () const;
@@ -103,11 +103,11 @@ public:
sigc::signal<void,
int,
const Frame* const,
- const UString&>& thread_selected_signal () const ;
+ const UString&>& thread_selected_signal () const ;
sigc::signal<void,
const vector<IDebugger::Frame>&,
- const UString&>& frames_listed_signal () const ;
+ const UString&>& frames_listed_signal () const;
sigc::signal<void,
const map<int, list<IDebugger::VariableSafePtr> >&,
@@ -115,47 +115,47 @@ public:
frames_arguments_listed_signal () const;
sigc::signal<void, const IDebugger::Frame&, const UString&>&
- current_frame_signal () const ;
+ current_frame_signal () const;
sigc::signal<void, const list<VariableSafePtr>&, const UString&>&
- local_variables_listed_signal () const ;
+ local_variables_listed_signal () const;
sigc::signal<void, const list<VariableSafePtr>&, const UString&>&
- global_variables_listed_signal () const ;
+ global_variables_listed_signal () const;
sigc::signal<void,
const UString&,
const IDebugger::VariableSafePtr,
- const UString&>& variable_value_signal () const ;
+ const UString&>& variable_value_signal () const ;
sigc::signal<void,
const VariableSafePtr/*variable*/,
const UString& /*cookie*/>&
- variable_value_set_signal () const ;
+ variable_value_set_signal () const;
sigc::signal<void, const UString&, const VariableSafePtr, const UString&>&
- pointed_variable_value_signal () const ;
+ pointed_variable_value_signal () const ;
sigc::signal<void, const UString&, const UString&, const UString&>&
- variable_type_signal () const ;
+ variable_type_signal () const;
sigc::signal<void, const VariableSafePtr, const UString&>&
- variable_type_set_signal () const ;
+ variable_type_set_signal () const;
sigc::signal<void, const VariableSafePtr, const UString&>
- variable_dereferenced_signal () const ;
+ variable_dereferenced_signal () const;
- sigc::signal<void, int, const UString&>& got_target_info_signal () const ;
+ sigc::signal<void, int, const UString&>& got_target_info_signal () const ;
- sigc::signal<void>& running_signal () const ;
+ sigc::signal<void>& running_signal () const;
sigc::signal<void, const UString&, const UString&>&
- signal_received_signal () const ;
+ signal_received_signal () const;
- sigc::signal<void, const UString&>& error_signal () const ;
+ sigc::signal<void, const UString&>& error_signal () const;
- sigc::signal<void>& program_finished_signal () const ;
+ sigc::signal<void>& program_finished_signal () const;
sigc::signal<void, IDebugger::State>& state_changed_signal () const;
@@ -201,8 +201,8 @@ public:
//<signal handlers>
//***************
- void on_debugger_stdout_signal (CommandAndOutput &a_cao) ;
- void on_got_target_info_signal (int a_pid, const UString& a_exe_path) ;
+ void on_debugger_stdout_signal (CommandAndOutput &a_cao);
+ void on_got_target_info_signal (int a_pid, const UString& a_exe_path);
void on_stopped_signal (IDebugger::StopReason a_reason,
bool has_frame,
const IDebugger::Frame &a_frame,
@@ -217,77 +217,77 @@ public:
//***************
//for internal use
- void init () ;
+ void init ();
// to be called by client code
- void do_init (IConfMgrSafePtr &a_conf_mgr) ;
-
- IConfMgr& get_conf_mgr () ;
-
- map<UString, UString>& properties () ;
- void set_event_loop_context (const Glib::RefPtr<Glib::MainContext> &) ;
- void run_loop_iterations (int a_nb_iters) ;
- void set_state (IDebugger::State a_state) ;
- bool stop_target () ;
- void exit_engine () ;
- void execute_command (const Command &a_command) ;
- bool queue_command (const Command &a_command) ;
- bool busy () const ;
- void set_debugger_full_path (const UString &a_full_path) ;
- const UString& get_debugger_full_path () const ;
+ void do_init (IConfMgrSafePtr &a_conf_mgr);
+
+ IConfMgr& get_conf_mgr ();
+
+ map<UString, UString>& properties ();
+ void set_event_loop_context (const Glib::RefPtr<Glib::MainContext> &);
+ void run_loop_iterations (int a_nb_iters);
+ void set_state (IDebugger::State a_state);
+ bool stop_target () ;
+ void exit_engine ();
+ void execute_command (const Command &a_command);
+ bool queue_command (const Command &a_command);
+ bool busy () const;
+ void set_debugger_full_path (const UString &a_full_path);
+ const UString& get_debugger_full_path () const;
void set_debugger_parameter (const UString &a_name,
- const UString &a_value) ;
- void set_solib_prefix_path (const UString &a_name) ;
+ const UString &a_value);
+ void set_solib_prefix_path (const UString &a_name);
void load_program (const UString &a_prog,
const vector<UString> &a_args,
- const UString &a_working_dir) ;
+ const UString &a_working_dir);
void load_program (const UString &a_prog,
const vector<UString> &a_argv,
const UString &working_dir,
const vector<UString> &a_source_search_dirs,
- const UString &a_tty_path) ;
+ const UString &a_tty_path);
void load_core_file (const UString &a_prog_file,
const UString &a_core_path);
bool attach_to_target (unsigned int a_pid,
- const UString &a_tty_path) ;
+ const UString &a_tty_path);
- bool attach_to_remote_target (const UString &a_host, int a_port) ;
+ bool attach_to_remote_target (const UString &a_host, int a_port);
- bool attach_to_remote_target (const UString &a_serial_line) ;
+ bool attach_to_remote_target (const UString &a_serial_line);
- void detach_from_target (const UString &a_cookie="") ;
+ void detach_from_target (const UString &a_cookie="");
bool is_attached_to_target () const;
void set_attached_to_target (bool a_is_attached);
- void add_env_variables (const map<UString, UString> &a_vars) ;
+ void add_env_variables (const map<UString, UString> &a_vars);
- map<UString, UString>& get_env_variables () ;
+ map<UString, UString>& get_env_variables () ;
- const UString& get_target_path () ;
+ const UString& get_target_path ();
- void init_output_handlers () ;
+ void init_output_handlers ();
- void append_breakpoints_to_cache (const map<int, IDebugger::BreakPoint>&) ;
+ void append_breakpoints_to_cache (const map<int, IDebugger::BreakPoint>&);
- void do_continue (const UString &a_cookie) ;
+ void do_continue (const UString &a_cookie);
- void run (const UString &a_cookie) ;
+ void run (const UString &a_cookie) ;
- void get_target_info (const UString &a_cookie) ;
+ void get_target_info (const UString &a_cookie);
- ILangTraitSafePtr create_language_trait () ;
+ ILangTraitSafePtr create_language_trait ();
- ILangTrait& get_language_trait () ;
+ ILangTrait& get_language_trait ();
bool is_variable_editable (const VariableSafePtr) const;
- IDebugger::State get_state () const ;
+ IDebugger::State get_state () const;
int get_current_frame_level () const;
@@ -301,28 +301,28 @@ public:
void get_mi_thread_and_frame_location (UString &a_str) const;
- void step_in (const UString &a_cookie) ;
+ void step_in (const UString &a_cookie);
- void step_out (const UString &a_cookie) ;
+ void step_out (const UString &a_cookie);
void step_instruction (const UString &a_cookie);
- void step_over (const UString &a_cookie) ;
+ void step_over (const UString &a_cookie);
void continue_to_position (const UString &a_path,
gint a_line_num,
- const UString &a_cookie) ;
+ const UString &a_cookie) ;
void set_breakpoint (const UString &a_path,
gint a_line_num,
const UString &a_condition,
unsigned a_ignore_count,
- const UString &a_cookie) ;
+ const UString &a_cookie) ;
void set_breakpoint (const UString &a_func_name,
const UString &a_condition,
unsigned a_ignore_count,
- const UString &a_cookie) ;
+ const UString &a_cookie) ;
void enable_breakpoint (gint a_break_num,
const UString &a_cookie="");
@@ -340,38 +340,38 @@ public:
void delete_breakpoint (const UString &a_path,
gint a_line_num,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void set_watchpoint (const UString &a_expression,
bool a_write, bool a_read,
const UString &a_cookie);
- void list_breakpoints (const UString &a_cookie) ;
+ void list_breakpoints (const UString &a_cookie);
- map<int, IDebugger::BreakPoint>& get_cached_breakpoints () ;
+ map<int, IDebugger::BreakPoint>& get_cached_breakpoints ();
void set_catch (const UString &a_event,
- const UString &a_cookie) ;
+ const UString &a_cookie) ;
void choose_function_overload (int a_overload_number,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void choose_function_overloads (const vector<int> &a_numbers,
- const UString &a_cookie) ;
+ const UString &a_cookie);
- void list_threads (const UString &a_cookie) ;
+ void list_threads (const UString &a_cookie);
void select_thread (unsigned int a_thread_id,
- const UString &a_cookie) ;
+ const UString &a_cookie);
unsigned int get_current_thread () const;
void delete_breakpoint (gint a_break_num,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void select_frame (int a_frame_id,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void list_frames (int a_low_frame,
int a_high_frame,
@@ -379,46 +379,46 @@ public:
void list_frames_arguments (int a_low_frame,
int a_high_frame,
- const UString &a_cookie) ;
+ const UString &a_cookie);
- void list_local_variables (const UString &a_cookie) ;
+ void list_local_variables (const UString &a_cookie);
- void list_global_variables ( const UString &a_cookie ) ;
+ void list_global_variables ( const UString &a_cookie );
void evaluate_expression (const UString &a_expr,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void call_function (const UString &a_call_expression,
const UString &a_cookie="");
void print_variable_value (const UString &a_var_name,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void get_variable_value (const VariableSafePtr &a_var,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void print_pointed_variable_value (const UString &a_var_name,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void print_variable_type (const UString &a_var_name,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void get_variable_type (const VariableSafePtr &a_var,
- const UString &a_cookie) ;
+ const UString &a_cookie);
bool dereference_variable (const VariableSafePtr &a_var,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void list_files (const UString &a_cookie);
bool extract_proc_info (Output &a_output,
int &a_proc_pid,
- UString &a_exe_path) ;
+ UString &a_exe_path);
typedef std::map<UString, std::list<IDebugger::VariableSafePtr> >
- VarsPerFilesMap ;
+ VarsPerFilesMap;
bool extract_global_variable_list (Output &a_output,
- VarsPerFilesMap &a_vars) ;
+ VarsPerFilesMap &a_vars);
void list_register_names (const UString &a_cookie);
@@ -435,7 +435,7 @@ public:
void read_memory (size_t a_start_addr,
size_t a_num_bytes,
- const UString& a_cookie) ;
+ const UString& a_cookie);
void set_memory (size_t a_addr,
const std::vector<uint8_t>& a_bytes,
const UString& a_cookie);
diff --git a/src/dbgengine/nmv-gdbmi-parser.cc b/src/dbgengine/nmv-gdbmi-parser.cc
index f6639ae..ff8a27f 100644
--- a/src/dbgengine/nmv-gdbmi-parser.cc
+++ b/src/dbgengine/nmv-gdbmi-parser.cc
@@ -1832,7 +1832,7 @@ fetch_gdbmi_result:
} else {
LOG_D ("parsed stack args", GDBMI_PARSING_DOMAIN);
}
- result_record.frames_parameters (frames_args) ;
+ result_record.frames_parameters (frames_args);
} else if (!m_priv->input.raw ().compare (cur, strlen (PREFIX_LOCALS),
PREFIX_LOCALS)) {
list<IDebugger::VariableSafePtr> vars;
@@ -2208,7 +2208,7 @@ GDBMIParser::parse_breakpoint_table (UString::size_type a_from,
}
//skip table headers and go to table body.
- cur = RAW_INPUT.find ("body=[", 0) ;
+ cur = RAW_INPUT.find ("body=[", 0);
if (!cur) {
LOG_PARSING_ERROR2 (cur);
return false;
@@ -2558,7 +2558,7 @@ GDBMIParser::parse_call_stack (const UString::size_type a_from,
LOG_PARSING_ERROR2 (cur);
return false;
}
- list<GDBMIResultSafePtr> result_list ;
+ list<GDBMIResultSafePtr> result_list;
result_value_list->get_result_content (result_list);
GDBMITupleSafePtr frame_tuple;
@@ -3169,7 +3169,7 @@ GDBMIParser::parse_variable_value (const UString::size_type a_from,
}
SKIP_BLANK2 (cur);
if (RAW_CHAR_AT (cur) != '"') {
- UString value ;
+ UString value;
if (!parse_c_string_body (cur, cur, value)) {
LOG_PARSING_ERROR2 (cur);
return false;
diff --git a/src/dbgengine/nmv-gdbmi-parser.h b/src/dbgengine/nmv-gdbmi-parser.h
index d886302..03cb3db 100644
--- a/src/dbgengine/nmv-gdbmi-parser.h
+++ b/src/dbgengine/nmv-gdbmi-parser.h
@@ -31,22 +31,22 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
-class GDBMITuple ;
-class GDBMIResult ;
-class GDBMIValue ;
-class GDBMIList ;
-typedef SafePtr<GDBMIResult, ObjectRef, ObjectUnref> GDBMIResultSafePtr ;
-typedef SafePtr<GDBMITuple, ObjectRef, ObjectUnref> GDBMITupleSafePtr ;
+class GDBMITuple;
+class GDBMIResult;
+class GDBMIValue;
+class GDBMIList;
+typedef SafePtr<GDBMIResult, ObjectRef, ObjectUnref> GDBMIResultSafePtr;
+typedef SafePtr<GDBMITuple, ObjectRef, ObjectUnref> GDBMITupleSafePtr;
typedef SafePtr<GDBMIValue, ObjectRef, ObjectUnref> GDBMIValueSafePtr;
-typedef SafePtr<GDBMIList, ObjectRef, ObjectUnref> GDBMIListSafePtr ;
+typedef SafePtr<GDBMIList, ObjectRef, ObjectUnref> GDBMIListSafePtr;
/// This type abstracts a GDB/MI TUPLE.
/// TUPLE ==> "{}" | "{" RESULT ( "," RESULT )* "}"
class GDBMITuple : public Object {
- GDBMITuple (const GDBMITuple&) ;
- GDBMITuple& operator= (const GDBMITuple&) ;
+ GDBMITuple (const GDBMITuple&);
+ GDBMITuple& operator= (const GDBMITuple&);
- list<GDBMIResultSafePtr> m_content ;
+ list<GDBMIResultSafePtr> m_content;
public:
@@ -69,14 +69,14 @@ public:
/// LIST is a GDBMIList class.
/// please, read the GDB/MI output syntax documentation for more.
class GDBMIValue : public Object {
- GDBMIValue (const GDBMIValue&) ;
- GDBMIValue& operator= (const GDBMIValue&) ;
+ GDBMIValue (const GDBMIValue&);
+ GDBMIValue& operator= (const GDBMIValue&);
typedef boost::variant<bool,
UString,
GDBMIListSafePtr,
- GDBMITupleSafePtr> ContentType ;
- ContentType m_content ;
- friend class GDBMIResult ;
+ GDBMITupleSafePtr> ContentType;
+ ContentType m_content;
+ friend class GDBMIResult;
public:
@@ -89,48 +89,48 @@ public:
GDBMIValue () {m_content = false;}
- GDBMIValue (const UString &a_str) {m_content = a_str ;}
+ GDBMIValue (const UString &a_str) {m_content = a_str;}
GDBMIValue (const GDBMIListSafePtr &a_list)
{
- m_content = a_list ;
+ m_content = a_list;
}
GDBMIValue (const GDBMITupleSafePtr &a_tuple)
{
- m_content = a_tuple ;
+ m_content = a_tuple;
}
Type content_type () const {return (Type) m_content.which ();}
const UString& get_string_content ()
{
- THROW_IF_FAIL (content_type () == STRING_TYPE) ;
- return boost::get<UString> (m_content) ;
+ THROW_IF_FAIL (content_type () == STRING_TYPE);
+ return boost::get<UString> (m_content);
}
const GDBMIListSafePtr get_list_content () const
{
- THROW_IF_FAIL (content_type () == LIST_TYPE) ;
- return boost::get<GDBMIListSafePtr> (m_content) ;
+ THROW_IF_FAIL (content_type () == LIST_TYPE);
+ return boost::get<GDBMIListSafePtr> (m_content);
}
GDBMIListSafePtr get_list_content ()
{
- THROW_IF_FAIL (content_type () == LIST_TYPE) ;
- return boost::get<GDBMIListSafePtr> (m_content) ;
+ THROW_IF_FAIL (content_type () == LIST_TYPE);
+ return boost::get<GDBMIListSafePtr> (m_content);
}
const GDBMITupleSafePtr get_tuple_content () const
{
- THROW_IF_FAIL (content_type () == TUPLE_TYPE) ;
- THROW_IF_FAIL (boost::get<GDBMITupleSafePtr> (&m_content)) ;
- return boost::get<GDBMITupleSafePtr> (m_content) ;
+ THROW_IF_FAIL (content_type () == TUPLE_TYPE);
+ THROW_IF_FAIL (boost::get<GDBMITupleSafePtr> (&m_content));
+ return boost::get<GDBMITupleSafePtr> (m_content);
}
GDBMITupleSafePtr get_tuple_content ()
{
- THROW_IF_FAIL (content_type () == TUPLE_TYPE) ;
- THROW_IF_FAIL (boost::get<GDBMITupleSafePtr> (&m_content)) ;
- return boost::get<GDBMITupleSafePtr> (m_content) ;
+ THROW_IF_FAIL (content_type () == TUPLE_TYPE);
+ THROW_IF_FAIL (boost::get<GDBMITupleSafePtr> (&m_content));
+ return boost::get<GDBMITupleSafePtr> (m_content);
}
@@ -148,11 +148,11 @@ public:
/// It syntax looks like VARIABLE=VALUE,
/// where VALUE is a complex type.
class GDBMIResult : public Object {
- GDBMIResult (const GDBMIResult&) ;
- GDBMIResult& operator= (const GDBMIResult&) ;
+ GDBMIResult (const GDBMIResult&);
+ GDBMIResult& operator= (const GDBMIResult&);
- UString m_variable ;
- GDBMIValueSafePtr m_value ;
+ UString m_variable;
+ GDBMIValueSafePtr m_value;
bool m_is_singular;
public:
@@ -176,12 +176,12 @@ public:
/// A GDB/MI LIST. It can be a list of either GDB/MI Result or GDB/MI Value.
class GDBMIList : public Object {
- GDBMIList (const GDBMIList &) ;
- GDBMIList& operator= (const GDBMIList &) ;
+ GDBMIList (const GDBMIList &);
+ GDBMIList& operator= (const GDBMIList &);
- //boost::variant<list<GDBMIResultSafePtr>, list<GDBMIValueSafePtr> > m_content ;
- list<boost::variant<GDBMIResultSafePtr, GDBMIValueSafePtr> > m_content ;
- bool m_empty ;
+ //boost::variant<list<GDBMIResultSafePtr>, list<GDBMIValueSafePtr> > m_content;
+ list<boost::variant<GDBMIResultSafePtr, GDBMIValueSafePtr> > m_content;
+ bool m_empty;
public:
enum ContentType {
@@ -197,46 +197,46 @@ public:
GDBMIList (const GDBMITupleSafePtr &a_tuple) :
m_empty (false)
{
- GDBMIValueSafePtr value (new GDBMIValue (a_tuple)) ;
- //list<GDBMIValueSafePtr> value_list ; value_list.push_back (value) ;
- //list<GDBMIValueSafePtr> value_list ; value_list.push_back (value) ;
- //m_content = value_list ;
- m_content.push_back (value) ;
+ GDBMIValueSafePtr value (new GDBMIValue (a_tuple));
+ //list<GDBMIValueSafePtr> value_list; value_list.push_back (value) ;
+ //list<GDBMIValueSafePtr> value_list; value_list.push_back (value) ;
+ //m_content = value_list;
+ m_content.push_back (value);
}
GDBMIList (const UString &a_str) :
m_empty (false)
{
- GDBMIValueSafePtr value (new GDBMIValue (a_str)) ;
- //list<GDBMIValueSafePtr> list ;
- //list.push_back (value) ;
- //m_content = list ;
- m_content.push_back (value) ;
+ GDBMIValueSafePtr value (new GDBMIValue (a_str));
+ //list<GDBMIValueSafePtr> list;
+ //list.push_back (value);
+ //m_content = list;
+ m_content.push_back (value);
}
GDBMIList (const GDBMIResultSafePtr &a_result) :
m_empty (false)
{
- //list<GDBMIResultSafePtr> list ;
- //list.push_back (a_result) ;
- //m_content = list ;
- m_content.push_back (a_result) ;
+ //list<GDBMIResultSafePtr> list;
+ //list.push_back (a_result);
+ //m_content = list;
+ m_content.push_back (a_result);
}
GDBMIList (const GDBMIValueSafePtr &a_value) :
m_empty (false)
{
- //list<GDBMIValueSafePtr> list ;
- //list.push_back (a_value) ;
- //m_content = list ;
- m_content.push_back (a_value) ;
+ //list<GDBMIValueSafePtr> list;
+ //list.push_back (a_value);
+ //m_content = list;
+ m_content.push_back (a_value);
}
virtual ~GDBMIList () {}
ContentType content_type () const
{
if (m_content.empty ()) {
- return UNDEFINED_TYPE ;
+ return UNDEFINED_TYPE;
}
return (ContentType) m_content.front ().which ();
}
@@ -245,40 +245,40 @@ public:
void append (const GDBMIResultSafePtr &a_result)
{
- THROW_IF_FAIL (a_result) ;
+ THROW_IF_FAIL (a_result);
if (!m_content.empty ()) {
- THROW_IF_FAIL (m_content.front ().which () == RESULT_TYPE) ;
+ THROW_IF_FAIL (m_content.front ().which () == RESULT_TYPE);
}
- m_content.push_back (a_result) ;
- m_empty = false ;
+ m_content.push_back (a_result);
+ m_empty = false;
}
void append (const GDBMIValueSafePtr &a_value)
{
- THROW_IF_FAIL (a_value) ;
+ THROW_IF_FAIL (a_value);
if (!m_content.empty ()) {
- THROW_IF_FAIL (m_content.front ().which () == VALUE_TYPE) ;
+ THROW_IF_FAIL (m_content.front ().which () == VALUE_TYPE);
}
- m_content.push_back (a_value) ;
- m_empty = false ;
+ m_content.push_back (a_value);
+ m_empty = false;
}
void get_result_content (list<GDBMIResultSafePtr> &a_list) const
{
if (empty ()) {return;}
- THROW_IF_FAIL (content_type () == RESULT_TYPE) ;
+ THROW_IF_FAIL (content_type () == RESULT_TYPE);
list<boost::variant<GDBMIResultSafePtr,GDBMIValueSafePtr> >::const_iterator it;
- for (it= m_content.begin () ; it!= m_content.end () ; ++it) {
- a_list.push_back (boost::get<GDBMIResultSafePtr> (*it)) ;
+ for (it= m_content.begin (); it!= m_content.end () ; ++it) {
+ a_list.push_back (boost::get<GDBMIResultSafePtr> (*it));
}
}
void get_value_content (list<GDBMIValueSafePtr> &a_list) const
{
if (empty ()) {return;}
- THROW_IF_FAIL (content_type () == VALUE_TYPE) ;
+ THROW_IF_FAIL (content_type () == VALUE_TYPE);
list<boost::variant<GDBMIResultSafePtr,GDBMIValueSafePtr> >::const_iterator it;
- for (it= m_content.begin () ; it!= m_content.end () ; ++it) {
- a_list.push_back (boost::get<GDBMIValueSafePtr> (*it)) ;
+ for (it= m_content.begin (); it!= m_content.end () ; ++it) {
+ a_list.push_back (boost::get<GDBMIValueSafePtr> (*it));
}
}
};//end class GDBMIList
@@ -287,20 +287,20 @@ public:
//<gdbmi datastructure streaming operators>
//******************************************
-ostream& operator<< (ostream &a_out, const GDBMIValueSafePtr &a_val) ;
+ostream& operator<< (ostream &a_out, const GDBMIValueSafePtr &a_val);
-ostream& operator<< (ostream &a_out, const GDBMIResultSafePtr &a_result) ;
+ostream& operator<< (ostream &a_out, const GDBMIResultSafePtr &a_result);
-ostream& operator<< (ostream &a_out, const GDBMITupleSafePtr &a_tuple) ;
+ostream& operator<< (ostream &a_out, const GDBMITupleSafePtr &a_tuple);
ostream&
-operator<< (ostream &a_out, const GDBMIListSafePtr a_list) ;
+operator<< (ostream &a_out, const GDBMIListSafePtr a_list);
ostream&
-operator<< (ostream &a_out, const GDBMIValueSafePtr &a_val) ;
+operator<< (ostream &a_out, const GDBMIValueSafePtr &a_val);
std::ostream&
-operator<< (std::ostream &a_out, const IDebugger::Variable &a_var) ;
+operator<< (std::ostream &a_out, const IDebugger::Variable &a_var);
//******************************************
//</gdbmi datastructure streaming operators>
@@ -381,7 +381,7 @@ public:
bool parse_embedded_c_string (UString::size_type a_from,
UString::size_type &a_to,
- UString &a_string) ;
+ UString &a_string);
/// parse a GDB/MI Result data structure.
/// A result basically has the form:
@@ -408,7 +408,7 @@ public:
//// \param a_value the result of the parsing.
bool parse_gdbmi_value (UString::size_type a_from,
UString::size_type &a_to,
- GDBMIValueSafePtr &a_value) ;
+ GDBMIValueSafePtr &a_value);
/// parse a GDB/MI Tuple is a actualy a set of name=value constructs,
/// where 'value' can be quite complicated.
diff --git a/src/dbgengine/nmv-i-lang-trait.h b/src/dbgengine/nmv-i-lang-trait.h
index d0ad0f4..ffeccda 100644
--- a/src/dbgengine/nmv-i-lang-trait.h
+++ b/src/dbgengine/nmv-i-lang-trait.h
@@ -29,22 +29,22 @@
#include "common/nmv-dynamic-module.h"
#include "nmv-i-debugger.h"
-using nemiver::common::UString ;
-using nemiver::common::DynModIface ;
-using nemiver::common::DynamicModule ;
-using nemiver::common::SafePtr ;
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::SafePtr ;
+using nemiver::common::UString;
+using nemiver::common::DynModIface;
+using nemiver::common::DynamicModule;
+using nemiver::common::SafePtr;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::SafePtr;
NEMIVER_BEGIN_NAMESPACE (nemiver)
-class ILangTrait ;
-typedef SafePtr<ILangTrait, ObjectRef, ObjectUnref> ILangTraitSafePtr ;
+class ILangTrait;
+typedef SafePtr<ILangTrait, ObjectRef, ObjectUnref> ILangTraitSafePtr;
class NEMIVER_API ILangTrait : public DynModIface {
//non copyable
- ILangTrait (const ILangTrait &) ;
- ILangTrait& operator= (const ILangTrait &) ;
+ ILangTrait (const ILangTrait &);
+ ILangTrait& operator= (const ILangTrait &);
protected:
ILangTrait (DynamicModule *a_dynmod) : DynModIface (a_dynmod)
@@ -55,16 +55,16 @@ public:
virtual ~ILangTrait () {}
- virtual const UString& get_name () const = 0 ;
+ virtual const UString& get_name () const = 0;
/// \name language features tests
/// @{
- virtual bool has_pointers () const = 0 ;
+ virtual bool has_pointers () const = 0;
/// @}
/// \name language features
/// @{
- virtual bool is_type_a_pointer (const UString &a_type) const = 0 ;
+ virtual bool is_type_a_pointer (const UString &a_type) const = 0;
virtual bool is_variable_compound
(const nemiver::IDebugger::VariableSafePtr) const = 0;
/// @}
diff --git a/src/dbgengine/nmv-i-var-list-walker.h b/src/dbgengine/nmv-i-var-list-walker.h
index 7705a1c..dde7d6b 100644
--- a/src/dbgengine/nmv-i-var-list-walker.h
+++ b/src/dbgengine/nmv-i-var-list-walker.h
@@ -29,20 +29,20 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::SafePtr ;
-using nemiver::common::DynModIface ;
-using nemiver::common::DynModIfaceSafePtr ;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::SafePtr;
+using nemiver::common::DynModIface;
+using nemiver::common::DynModIfaceSafePtr;
class IVarListWalker;
-typedef SafePtr<IVarListWalker, ObjectRef, ObjectUnref> IVarListWalkerSafePtr ;
+typedef SafePtr<IVarListWalker, ObjectRef, ObjectUnref> IVarListWalkerSafePtr;
class NEMIVER_API IVarListWalker : public DynModIface {
//non copyable
- IVarListWalker () ;
- IVarListWalker (const IVarListWalker&) ;
+ IVarListWalker ();
+ IVarListWalker (const IVarListWalker&);
protected:
IVarListWalker (DynamicModule *a_dynmod) :
@@ -59,7 +59,7 @@ public:
virtual sigc::signal<void>& variable_list_visited_signal () const=0;
///@}
- virtual void initialize (IDebuggerSafePtr &a_debugger)=0 ;
+ virtual void initialize (IDebuggerSafePtr &a_debugger)=0;
virtual void append_variable (const IDebugger::VariableSafePtr a_var)=0;
diff --git a/src/dbgengine/nmv-i-var-list.h b/src/dbgengine/nmv-i-var-list.h
index 7157f36..d809015 100644
--- a/src/dbgengine/nmv-i-var-list.h
+++ b/src/dbgengine/nmv-i-var-list.h
@@ -31,18 +31,18 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::SafePtr ;
-using nemiver::common::DynModIface ;
-using nemiver::common::DynModIfaceSafePtr ;
-
-typedef std::list<IDebugger::VariableSafePtr> DebuggerVariableList ;
-class IVarList ;
-typedef SafePtr<IVarList, ObjectRef, ObjectUnref> IVarListSafePtr ;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::SafePtr;
+using nemiver::common::DynModIface;
+using nemiver::common::DynModIfaceSafePtr;
+
+typedef std::list<IDebugger::VariableSafePtr> DebuggerVariableList;
+class IVarList;
+typedef SafePtr<IVarList, ObjectRef, ObjectUnref> IVarListSafePtr;
class NEMIVER_API IVarList : public DynModIface {
- IVarList () ;
- IVarList (const IVarList &) ;
+ IVarList ();
+ IVarList (const IVarList &);
protected:
IVarList (DynamicModule *a_dynmod) :
@@ -73,7 +73,7 @@ public:
//// the variables.
virtual void initialize (IDebuggerSafePtr &a_debugger) = 0;
- virtual IDebugger& get_debugger () const = 0 ;
+ virtual IDebugger& get_debugger () const = 0;
/// \return the raw list of variables maintained internally.
virtual const DebuggerVariableList& get_raw_list() const = 0;
@@ -85,7 +85,7 @@ public:
/// the variable. This will trigger an invocation of the IDebugger
/// interface.
virtual void append_variable (const IDebugger::VariableSafePtr &a_var,
- bool a_update_type=true) = 0 ;
+ bool a_update_type=true) = 0;
/// \brief append a set list of variables to the list
///
@@ -94,22 +94,22 @@ public:
/// the variable. This will trigger an invocation of the IDebugger
/// interface.
virtual void append_variables (const DebuggerVariableList& a_vars,
- bool a_update_type=true) = 0 ;
+ bool a_update_type=true) = 0;
/// \brief remove a variable from the list
///
/// \param a_var the variable to remove from the list
/// \return true if the variable has been found and removed
- virtual bool remove_variable (const IDebugger::VariableSafePtr &a_var) = 0 ;
+ virtual bool remove_variable (const IDebugger::VariableSafePtr &a_var) = 0;
/// \brief remove a variable from the list
///
/// \param a_var_name the name of the variable to remove
/// \return true if the variable has been found and removed
- virtual bool remove_variable (const UString &a_var_name) = 0 ;
+ virtual bool remove_variable (const UString &a_var_name) = 0;
/// \brief remove all variables from the list
- virtual void remove_variables () = 0 ;
+ virtual void remove_variables () = 0;
/// \brief lookup a variable from its name
///
@@ -133,7 +133,7 @@ public:
///
/// issue many calls to the underlying IDebugger interface to query
/// the new values of variables contained in the list
- virtual void update_state () = 0 ;
+ virtual void update_state () = 0;
};//end class IVarList
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/dbgengine/nmv-var-list.cc b/src/dbgengine/nmv-var-list.cc
index 3ad6164..393e893 100644
--- a/src/dbgengine/nmv-var-list.cc
+++ b/src/dbgengine/nmv-var-list.cc
@@ -27,8 +27,8 @@
#include "nmv-i-var-list.h"
#include "common/nmv-exception.h"
-static const char* INSTANCE_NOT_INITIALIZED = "instance not initialized" ;
-static const char* VAR_LIST_COOKIE = "var-list-cookie" ;
+static const char* INSTANCE_NOT_INITIALIZED = "instance not initialized";
+static const char* VAR_LIST_COOKIE = "var-list-cookie";
#ifndef CHECK_INIT
#define CHECK_INIT THROW_IF_FAIL2 (m_debugger, INSTANCE_NOT_INITIALIZED)
@@ -36,15 +36,15 @@ static const char* VAR_LIST_COOKIE = "var-list-cookie" ;
NEMIVER_BEGIN_NAMESPACE (nemiver)
-using nemiver::common::DynamicModule ;
-using nemiver::common::DynamicModuleSafePtr ;
-using nemiver::common::DynModIface ;
-using nemiver::common::DynModIfaceSafePtr ;
+using nemiver::common::DynamicModule;
+using nemiver::common::DynamicModuleSafePtr;
+using nemiver::common::DynModIface;
+using nemiver::common::DynModIfaceSafePtr;
class NameElement {
- UString m_name ;
- bool m_is_pointer ;
- bool m_is_pointer_member ;
+ UString m_name;
+ bool m_is_pointer;
+ bool m_is_pointer_member;
public:
@@ -83,14 +83,14 @@ public:
bool is_pointer_member () const {return m_is_pointer_member;}
void is_pointer_member (bool a_flag) {m_is_pointer_member = a_flag;}
};//end class NameElement
-typedef std::list<NameElement> NameElementList ;
+typedef std::list<NameElement> NameElementList;
//******************************
//<static function declarations>
//******************************
static bool break_qname_into_name_elements (const UString &a_qname,
- NameElementList &a_name_elems) ;
+ NameElementList &a_name_elems);
//******************************
@@ -106,22 +106,22 @@ static bool break_qname_into_name_elements (const UString &a_qname,
static bool
is_qname_a_pointer_member (const UString &a_qname)
{
- LOG_DD ("a_qname: " << a_qname) ;
- std::list<NameElement> name_elems ;
+ LOG_DD ("a_qname: " << a_qname);
+ std::list<NameElement> name_elems;
if (!break_qname_into_name_elements (a_qname, name_elems)) {
- LOG_DD ("return false") ;
- return false ;
+ LOG_DD ("return false");
+ return false;
}
- std::list<NameElement>::const_iterator end_it = name_elems.end () ;
+ std::list<NameElement>::const_iterator end_it = name_elems.end ();
--end_it;
if (end_it == name_elems.end ()) {
- LOG_DD ("return false") ;
- return false ;
+ LOG_DD ("return false");
+ return false;
}
- LOG_DD ("result: " << (int) end_it->is_pointer_member ()) ;
- return end_it->is_pointer_member () ;
+ LOG_DD ("result: " << (int) end_it->is_pointer_member ());
+ return end_it->is_pointer_member ();
}
*/
@@ -133,18 +133,18 @@ break_qname_into_name_elements (const UString &a_qname,
NEMIVER_TRY
- THROW_IF_FAIL (a_qname != "") ;
- LOG_D ("qname: '" << a_qname << "'", "break-qname-domain") ;
+ THROW_IF_FAIL (a_qname != "");
+ LOG_D ("qname: '" << a_qname << "'", "break-qname-domain");
- UString::size_type len=a_qname.size (),cur=0, name_start=0, name_end=0 ;
- UString name_element ;
- bool is_pointer=false, is_pointer_member=false ;
- NameElementList name_elems ;
+ UString::size_type len = a_qname.size (),cur=0, name_start=0, name_end=0;
+ UString name_element;
+ bool is_pointer=false, is_pointer_member=false;
+ NameElementList name_elems;
fetch_element:
- name_start = cur ;
- name_element="" ;
- gunichar c = 0 ;
+ name_start = cur;
+ name_element="";
+ gunichar c = 0;
//okay, let's define what characters can be part of a variable name.
//Note that variable names can be a template type -
//in case a templated class extends another one, inline; in that
@@ -169,65 +169,65 @@ fetch_element:
c == ')' /*ditto*/ ||
isspace (c)
)
- ; ++cur) {
+ ; ++cur) {
}
if (is_pointer) {
- is_pointer_member = true ;
+ is_pointer_member = true;
}
if (cur == name_start) {
name_element = "";
} else if (cur >= len) {
- name_end = cur - 1 ;
+ name_end = cur - 1;
name_element = a_qname.substr (name_start, name_end - name_start + 1);
- is_pointer = false ;
+ is_pointer = false;
} else if (c == '.'
|| (cur + 1 < len
&& c == '-'
&& a_qname[cur+1] == '>')
|| cur >= len){
- name_end = cur - 1 ;
+ name_end = cur - 1;
name_element = a_qname.substr (name_start, name_end - name_start + 1);
//update is_pointer state
if (c != '.' || name_element[0] == '*') {
- is_pointer = true ;
+ is_pointer = true;
}
//advance cur.
if (c == '-') {
- //name_element = '*' + name_element ;
- cur += 2 ;
+ //name_element = '*' + name_element;
+ cur += 2;
} else if (cur < len){
- ++cur ;
+ ++cur;
}
} else {
LOG_ERROR ("failed to parse name element. Index was: "
- << (int) cur << " buf was '" << a_qname << "'") ;
- return false ;
+ << (int) cur << " buf was '" << a_qname << "'");
+ return false;
}
- name_element.chomp () ;
- LOG_D ("got name element: '" << name_element << "'", "break-qname-domain") ;
- LOG_D ("is_pointer: '" << (int) is_pointer << "'", "break-qname-domain") ;
+ name_element.chomp ();
+ LOG_D ("got name element: '" << name_element << "'", "break-qname-domain");
+ LOG_D ("is_pointer: '" << (int) is_pointer << "'", "break-qname-domain");
LOG_D ("is_pointer_member: '" << (int) is_pointer_member << "'",
- "break-qname-domain") ;
+ "break-qname-domain");
name_elems.push_back (NameElement (name_element,
is_pointer,
- is_pointer_member)) ;
+ is_pointer_member));
if (cur < len) {
- LOG_D ("go fetch next name element", "break-qname-domain") ;
- goto fetch_element ;
+ LOG_D ("go fetch next name element", "break-qname-domain");
+ goto fetch_element;
}
- LOG_D ("getting out", "break-qname-domain") ;
+ LOG_D ("getting out", "break-qname-domain");
if (a_qname[0] == '*' && !name_elems.empty ()) {
- NameElementList::iterator it = name_elems.end () ;
- --it ;
- it->is_pointer (true) ;
+ NameElementList::iterator it = name_elems.end ();
+ --it;
+ it->is_pointer (true);
}
- a_name_elems = name_elems ;
+ a_name_elems = name_elems;
NEMIVER_CATCH_AND_RETURN_NOX (false)
- return true ;
+ return true;
}
//******************************
//</static function definitions>
@@ -241,12 +241,12 @@ class VarList : public IVarList {
sigc::signal<void, const IDebugger::VariableSafePtr&>
m_variable_type_set_signal;
sigc::signal<void, const IDebugger::VariableSafePtr&>
- m_variable_updated_signal ;
+ m_variable_updated_signal;
sigc::signal<void, const IDebugger::VariableSafePtr&>
m_variable_removed_signal;
- DebuggerVariableList m_raw_list ;
- IDebuggerSafePtr m_debugger ;
+ DebuggerVariableList m_raw_list;
+ IDebuggerSafePtr m_debugger;
public:
VarList (DynamicModule *a_dynmod) :
@@ -262,31 +262,31 @@ public:
sigc::signal<void, const IDebugger::VariableSafePtr&>&
variable_added_signal ()
{
- return m_variable_added_signal ;
+ return m_variable_added_signal;
}
sigc::signal<void, const IDebugger::VariableSafePtr>&
variable_value_set_signal ()
{
- return m_variable_value_set_signal ;
+ return m_variable_value_set_signal;
}
sigc::signal<void, const IDebugger::VariableSafePtr&>&
variable_type_set_signal ()
{
- return m_variable_type_set_signal ;
+ return m_variable_type_set_signal;
}
sigc::signal<void, const IDebugger::VariableSafePtr&>&
variable_updated_signal ()
{
- return m_variable_updated_signal ;
+ return m_variable_updated_signal;
}
sigc::signal<void, const IDebugger::VariableSafePtr&>&
variable_removed_signal ()
{
- return m_variable_removed_signal ;
+ return m_variable_removed_signal;
}
//*******************
//</events getters>
@@ -296,38 +296,38 @@ public:
//<signal slots>
//***************
void on_variable_type_set_signal (const IDebugger::VariableSafePtr &a_var,
- const UString &a_cookie) ;
+ const UString &a_cookie);
void on_variable_value_set_signal (const IDebugger::VariableSafePtr &a_var,
- const UString &a_cookie) ;
+ const UString &a_cookie);
//***************
//</signal slots>
//***************
- void initialize (IDebuggerSafePtr &a_debugger) ;
+ void initialize (IDebuggerSafePtr &a_debugger);
IDebugger& get_debugger () const
{
- CHECK_INIT ;
- return *m_debugger ;
+ CHECK_INIT;
+ return *m_debugger;
}
- const DebuggerVariableList& get_raw_list () const ;
+ const DebuggerVariableList& get_raw_list () const;
void append_variable (const IDebugger::VariableSafePtr &a_var,
- bool a_update_type) ;
+ bool a_update_type);
void append_variables (const DebuggerVariableList& a_vars,
- bool a_update_type) ;
+ bool a_update_type);
bool remove_variable (const IDebugger::VariableSafePtr &a_var);
- bool remove_variable (const UString &a_var_name) ;
+ bool remove_variable (const UString &a_var_name);
- void remove_variables () ;
+ void remove_variables ();
bool find_variable (const UString &a_var_name,
- IDebugger::VariableSafePtr &a_var) ;
+ IDebugger::VariableSafePtr &a_var);
bool find_variable_from_qname
(const NameElementList &a_name_elems,
@@ -339,21 +339,21 @@ public:
(const NameElementList &a_name_elems,
const NameElementList::const_iterator &a_cur_elem_it,
const IDebugger::VariableSafePtr &a_from_it,
- IDebugger::VariableSafePtr &a_result) ;
+ IDebugger::VariableSafePtr &a_result);
bool find_variable_from_qname
(const UString &a_qname,
const DebuggerVariableList::iterator &a_from,
- IDebugger::VariableSafePtr &a_var) ;
+ IDebugger::VariableSafePtr &a_var);
bool find_variable_from_qname (const UString &a_qname,
IDebugger::VariableSafePtr &a_var);
bool update_variable (const UString &a_var_name,
- const IDebugger::VariableSafePtr &a_new_var_value) ;
+ const IDebugger::VariableSafePtr &a_new_var_value);
- void update_state () ;
+ void update_state ();
};//end class VarList
void
@@ -364,14 +364,14 @@ VarList::on_variable_type_set_signal (const IDebugger::VariableSafePtr &a_var,
NEMIVER_TRY
- THROW_IF_FAIL (a_var && a_var->name () != "" && a_var->type () != "") ;
+ THROW_IF_FAIL (a_var && a_var->name () != "" && a_var->type () != "");
- IDebugger::VariableSafePtr variable ;
- THROW_IF_FAIL (find_variable (a_var->name (), variable)) ;
- THROW_IF_FAIL (variable == a_var) ;
- THROW_IF_FAIL (variable->type () != "") ;
+ IDebugger::VariableSafePtr variable;
+ THROW_IF_FAIL (find_variable (a_var->name (), variable));
+ THROW_IF_FAIL (variable == a_var);
+ THROW_IF_FAIL (variable->type () != "");
- variable_type_set_signal ().emit (a_var) ;
+ variable_type_set_signal ().emit (a_var);
NEMIVER_CATCH_NOX
}
@@ -384,10 +384,10 @@ VarList::on_variable_value_set_signal (const IDebugger::VariableSafePtr &a_var,
if (a_cookie != VAR_LIST_COOKIE) {return;}
- THROW_IF_FAIL (update_variable (a_var->name (), a_var)) ;
+ THROW_IF_FAIL (update_variable (a_var->name (), a_var));
- variable_value_set_signal ().emit (a_var) ;
- variable_updated_signal ().emit (a_var) ;
+ variable_value_set_signal ().emit (a_var);
+ variable_updated_signal ().emit (a_var);
NEMIVER_CATCH_NOX
}
@@ -395,9 +395,9 @@ VarList::on_variable_value_set_signal (const IDebugger::VariableSafePtr &a_var,
void
VarList::initialize (IDebuggerSafePtr &a_debugger)
{
- m_debugger = a_debugger ;
+ m_debugger = a_debugger;
- THROW_IF_FAIL (m_debugger) ;
+ THROW_IF_FAIL (m_debugger);
m_debugger->variable_type_set_signal ().connect (sigc::mem_fun
(*this, &VarList::on_variable_type_set_signal));
m_debugger->variable_value_set_signal ().connect (sigc::mem_fun
@@ -407,87 +407,87 @@ VarList::initialize (IDebuggerSafePtr &a_debugger)
const DebuggerVariableList&
VarList::get_raw_list () const
{
- CHECK_INIT ;
- return m_raw_list ;
+ CHECK_INIT;
+ return m_raw_list;
}
void
VarList::append_variable (const IDebugger::VariableSafePtr &a_var,
bool a_update_type)
{
- CHECK_INIT ;
- THROW_IF_FAIL (a_var) ;
- THROW_IF_FAIL (a_var->name () != "") ;
+ CHECK_INIT;
+ THROW_IF_FAIL (a_var);
+ THROW_IF_FAIL (a_var->name () != "");
- m_raw_list.push_back (a_var) ;
+ m_raw_list.push_back (a_var);
if (a_update_type) {
- get_debugger ().get_variable_type (a_var, VAR_LIST_COOKIE) ;
+ get_debugger ().get_variable_type (a_var, VAR_LIST_COOKIE);
}
- variable_added_signal ().emit (a_var) ;
+ variable_added_signal ().emit (a_var);
}
void
VarList::append_variables (const DebuggerVariableList& a_vars,
bool a_update_type)
{
- CHECK_INIT ;
+ CHECK_INIT;
- DebuggerVariableList::const_iterator var_iter ;
- for (var_iter = a_vars.begin (); var_iter != a_vars.end () ; ++ var_iter) {
- append_variable (*var_iter, a_update_type) ;
+ DebuggerVariableList::const_iterator var_iter;
+ for (var_iter = a_vars.begin (); var_iter != a_vars.end (); ++ var_iter) {
+ append_variable (*var_iter, a_update_type);
}
}
bool
VarList::remove_variable (const IDebugger::VariableSafePtr &a_var)
{
- CHECK_INIT ;
+ CHECK_INIT;
DebuggerVariableList::iterator result_iter =
- std::find (m_raw_list.begin (), m_raw_list.end (), a_var) ;
+ std::find (m_raw_list.begin (), m_raw_list.end (), a_var);
if (result_iter == get_raw_list ().end ()) {
return false;
}
- IDebugger::VariableSafePtr variable = *result_iter ;
- m_raw_list.erase (result_iter) ;
- variable_removed_signal ().emit (variable) ;
+ IDebugger::VariableSafePtr variable = *result_iter;
+ m_raw_list.erase (result_iter);
+ variable_removed_signal ().emit (variable);
- return true ;
+ return true;
}
bool
VarList::remove_variable (const UString &a_var_name)
{
- CHECK_INIT ;
+ CHECK_INIT;
- DebuggerVariableList::iterator iter ;
- for (iter = m_raw_list.begin () ; iter != m_raw_list.end () ; ++iter) {
+ DebuggerVariableList::iterator iter;
+ for (iter = m_raw_list.begin (); iter != m_raw_list.end () ; ++iter) {
if (!(*iter)) {
- continue ;
+ continue;
}
if ((*iter)->name () == a_var_name) {
- IDebugger::VariableSafePtr variable = *iter ;
- m_raw_list.erase (iter) ;
- variable_removed_signal ().emit (variable) ;
+ IDebugger::VariableSafePtr variable = *iter;
+ m_raw_list.erase (iter);
+ variable_removed_signal ().emit (variable);
return true;
}
}
- return false ;
+ return false;
}
void
VarList::remove_variables ()
{
- CHECK_INIT ;
+ CHECK_INIT;
- DebuggerVariableList::iterator var_iter ;
+ DebuggerVariableList::iterator var_iter;
if (m_raw_list.empty ()) {return;}
- for (var_iter = m_raw_list.begin () ;
- var_iter != m_raw_list.end () ;
+ for (var_iter = m_raw_list.begin ();
+ var_iter != m_raw_list.end ();
var_iter = m_raw_list.begin ()) {
- remove_variable (*var_iter) ;
+ remove_variable (*var_iter);
}
}
@@ -495,11 +495,11 @@ bool
VarList::find_variable (const UString &a_var_name,
IDebugger::VariableSafePtr &a_var)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
return VarList::find_variable_from_qname (a_var_name,
m_raw_list.begin (),
- a_var) ;
+ a_var);
}
bool
@@ -508,35 +508,35 @@ VarList::find_variable_from_qname
const DebuggerVariableList::iterator &a_from,
IDebugger::VariableSafePtr &a_result)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
- THROW_IF_FAIL (a_var_qname != "") ;
- LOG_DD ("a_var_qname: '" << a_var_qname << "'") ;
+ THROW_IF_FAIL (a_var_qname != "");
+ LOG_DD ("a_var_qname: '" << a_var_qname << "'");
if (a_from == m_raw_list.end ()) {
- LOG_ERROR ("got null a_from iterator") ;
- return false ;
+ LOG_ERROR ("got null a_from iterator");
+ return false;
}
- std::list<NameElement> name_elems ;
- bool is_ok = break_qname_into_name_elements (a_var_qname, name_elems) ;
+ std::list<NameElement> name_elems;
+ bool is_ok = break_qname_into_name_elements (a_var_qname, name_elems);
if (!is_ok) {
- LOG_ERROR ("failed to break qname into path elements") ;
- return false ;
+ LOG_ERROR ("failed to break qname into path elements");
+ return false;
}
bool ret = find_variable_from_qname (name_elems,
name_elems.begin (),
a_from,
- a_result) ;
+ a_result);
if (!ret) {
- name_elems.clear () ;
- name_elems.push_back (a_var_qname) ;
+ name_elems.clear ();
+ name_elems.push_back (a_var_qname);
ret = find_variable_from_qname (name_elems,
name_elems.begin (),
a_from,
- a_result) ;
+ a_result);
}
- return ret ;
+ return ret;
}
bool
@@ -546,48 +546,48 @@ VarList::find_variable_from_qname
const DebuggerVariableList::iterator &a_from_it,
IDebugger::VariableSafePtr &a_result)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
- THROW_IF_FAIL (!a_name_elems.empty ()) ;
+ THROW_IF_FAIL (!a_name_elems.empty ());
if (a_cur_elem_it != a_name_elems.end ()) {
- LOG_DD ("a_cur_elem_it: " << a_cur_elem_it->get_name ()) ;
+ LOG_DD ("a_cur_elem_it: " << a_cur_elem_it->get_name ());
LOG_DD ("a_cur_elem_it->is_pointer: "
- << (int) a_cur_elem_it->is_pointer ()) ;
+ << (int) a_cur_elem_it->is_pointer ());
} else {
- LOG_DD ("a_cur_elem_it: end") ;
+ LOG_DD ("a_cur_elem_it: end");
}
if (a_from_it == m_raw_list.end ()) {
- LOG_ERROR ("got null a_from iterator") ;
- return false ;
+ LOG_ERROR ("got null a_from iterator");
+ return false;
}
std::list<NameElement>::const_iterator cur_elem_it = a_cur_elem_it;
if (cur_elem_it == a_name_elems.end ()) {
- a_result = *a_from_it ;
- LOG_DD ("found iter") ;
+ a_result = *a_from_it;
+ LOG_DD ("found iter");
return true;
}
- DebuggerVariableList::iterator var_iter ;
- for (var_iter = a_from_it ;
+ DebuggerVariableList::iterator var_iter;
+ for (var_iter = a_from_it;
var_iter != m_raw_list.end ();
++var_iter) {
- UString var_name = (*var_iter)->name () ;
- LOG_DD ("current var list iter name: " << var_name) ;
+ UString var_name = (*var_iter)->name ();
+ LOG_DD ("current var list iter name: " << var_name);
if (var_name == cur_elem_it->get_name ()) {
- LOG_DD ("walked to path element: '" << cur_elem_it->get_name ()) ;
+ LOG_DD ("walked to path element: '" << cur_elem_it->get_name ());
bool res = find_variable_in_tree (a_name_elems,
cur_elem_it,
*var_iter,
- a_result) ;
+ a_result);
if (res) {
- return true ;
+ return true;
}
}
}
- LOG_DD ("iter not found") ;
- return false ;
+ LOG_DD ("iter not found");
+ return false;
}
bool
@@ -597,116 +597,116 @@ VarList::find_variable_in_tree
const IDebugger::VariableSafePtr &a_from,
IDebugger::VariableSafePtr &a_result)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
- THROW_IF_FAIL (a_from) ;
+ THROW_IF_FAIL (a_from);
if (a_cur_elem_it == a_name_elems.end ()) {
- LOG_DD ("reached end of name elements' list, returning false") ;
- return false ;
+ LOG_DD ("reached end of name elements' list, returning false");
+ return false;
}
- IDebugger::VariableSafePtr variable = a_from ;
- NameElementList::const_iterator name_elem_it = a_cur_elem_it ;
+ IDebugger::VariableSafePtr variable = a_from;
+ NameElementList::const_iterator name_elem_it = a_cur_elem_it;
if (variable->name () != name_elem_it->get_name ()) {
- LOG_DD ("variable name doesn't match name element, returning false") ;
- return false ;
+ LOG_DD ("variable name doesn't match name element, returning false");
+ return false;
}
- UString str ; variable->to_string (str) ;
+ UString str; variable->to_string (str) ;
LOG_DD ("inspecting variable: '"
<< variable->name ()
<< "' |content->|"
<< str);
- ++name_elem_it ;
+ ++name_elem_it;
if (name_elem_it == a_name_elems.end ()) {
- a_result = variable ;
- LOG_DD ("Found variable, returning true") ;
- return true ;
+ a_result = variable;
+ LOG_DD ("Found variable, returning true");
+ return true;
} else if (variable->members ().empty ()) {
LOG_DD ("reached end of variable tree without finding a matching one, "
- "returning false") ;
- return false ;
+ "returning false");
+ return false;
} else {
- std::list<IDebugger::VariableSafePtr>::const_iterator var_it ;
- for (var_it = variable->members ().begin () ;
- var_it != variable->members ().end () ;
+ std::list<IDebugger::VariableSafePtr>::const_iterator var_it;
+ for (var_it = variable->members ().begin ();
+ var_it != variable->members ().end ();
++var_it) {
if ((*var_it)->name () == name_elem_it->get_name ()) {
bool res = find_variable_in_tree (a_name_elems,
name_elem_it,
*var_it,
- a_result) ;
+ a_result);
if (res) {
- LOG_DD ("Found the variable, returning true") ;
- return true ;
+ LOG_DD ("Found the variable, returning true");
+ return true;
}
}
}
}
- LOG_DD ("Didn't found the variable, returning false") ;
- return false ;
+ LOG_DD ("Didn't found the variable, returning false");
+ return false;
}
bool
VarList::find_variable_from_qname (const UString &a_qname,
IDebugger::VariableSafePtr &a_var)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
- THROW_IF_FAIL (a_qname != "") ;
- LOG_DD ("a_qname: '" << a_qname << "'") ;
+ THROW_IF_FAIL (a_qname != "");
+ LOG_DD ("a_qname: '" << a_qname << "'");
- std::list<NameElement> name_elems ;
- bool ret = break_qname_into_name_elements (a_qname, name_elems) ;
+ std::list<NameElement> name_elems;
+ bool ret = break_qname_into_name_elements (a_qname, name_elems);
if (!ret) {
- LOG_ERROR ("failed to break qname into path elements") ;
- return false ;
+ LOG_ERROR ("failed to break qname into path elements");
+ return false;
}
ret = find_variable_from_qname (name_elems,
name_elems.begin (),
m_raw_list.begin (),
- a_var) ;
- return ret ;
+ a_var);
+ return ret;
}
bool
VarList::update_variable (const UString &a_var_name,
const IDebugger::VariableSafePtr &a_new_var_value)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
- DebuggerVariableList::iterator var_it ;
+ DebuggerVariableList::iterator var_it;
for (var_it = m_raw_list.begin ();
var_it != m_raw_list.end ();
++var_it) {
if (!(*var_it)) {continue;}
if (a_var_name == (*var_it)->name ()) {
- *var_it = a_new_var_value ;
- return true ;
+ *var_it = a_new_var_value;
+ return true;
}
}
- return false ;
+ return false;
}
void
VarList::update_state ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
- CHECK_INIT ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
+ CHECK_INIT;
- DebuggerVariableList::iterator var_it ;
- for (var_it = m_raw_list.begin () ;
+ DebuggerVariableList::iterator var_it;
+ for (var_it = m_raw_list.begin ();
var_it != m_raw_list.end ();
++var_it) {
if (!(*var_it) || (*var_it)->name () == "") {
- continue ;
+ continue;
}
- get_debugger ().get_variable_value (*var_it, VAR_LIST_COOKIE) ;
+ get_debugger ().get_variable_value (*var_it, VAR_LIST_COOKIE);
}
}
@@ -719,8 +719,8 @@ class VarListDynMod : public DynamicModule {
const static Info s_info ("variablelist",
"The Variable Model dynmod. "
"Implements the IVarList interface",
- "1.0") ;
- a_info = s_info ;
+ "1.0");
+ a_info = s_info;
}
void do_init ()
@@ -731,11 +731,11 @@ class VarListDynMod : public DynamicModule {
DynModIfaceSafePtr &a_iface)
{
if (a_iface_name == "IVarList") {
- a_iface.reset (new VarList (this)) ;
+ a_iface.reset (new VarList (this));
} else {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
};//end class varListDynMod
@@ -748,8 +748,8 @@ extern "C" {
bool
NEMIVER_API nemiver_common_create_dynamic_module_instance (void **a_new_instance)
{
- *a_new_instance = new nemiver::VarListDynMod () ;
- return (*a_new_instance != 0) ;
+ *a_new_instance = new nemiver::VarListDynMod ();
+ return (*a_new_instance != 0);
}
}
diff --git a/src/dbgengine/nmv-var-walker.cc b/src/dbgengine/nmv-var-walker.cc
index bbd1bad..ed406e3 100644
--- a/src/dbgengine/nmv-var-walker.cc
+++ b/src/dbgengine/nmv-var-walker.cc
@@ -113,7 +113,7 @@ public:
const IDebugger::VariableSafePtr get_variable () const;
- IDebuggerSafePtr get_debugger () const ;
+ IDebuggerSafePtr get_debugger () const;
void set_maximum_member_depth (unsigned a_max_depth);
diff --git a/src/dbgengine/nmv-var.h b/src/dbgengine/nmv-var.h
index bcce2a8..dec7f26 100644
--- a/src/dbgengine/nmv-var.h
+++ b/src/dbgengine/nmv-var.h
@@ -29,18 +29,18 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
-class Var ;
-typedef SafePtr<Var, ObjectRef, ObjectUnref> VarSafePtr ;
+class Var;
+typedef SafePtr<Var, ObjectRef, ObjectUnref> VarSafePtr;
class Var : public Object {
list<VarSafePtr> m_members;
- UString m_name ;
- UString m_value ;
- UString m_type ;
- Var *m_parent ;
+ UString m_name;
+ UString m_value;
+ UString m_type;
+ Var *m_parent;
//if this variable is a pointer,
//it can be dereferenced. The variable
//it points to is stored in m_dereferenced
- VarSafePtr m_dereferenced ;
+ VarSafePtr m_dereferenced;
public:
@@ -70,7 +70,7 @@ public:
{
if (!a_var) {return;}
m_members.push_back (a_var);
- a_var->parent (this) ;
+ a_var->parent (this);
}
const UString& name () const {return m_name;}
@@ -82,10 +82,10 @@ public:
const UString& type () const {return m_type;}
void type (const UString &a_type) {m_type = a_type;}
- Var* parent () const {return m_parent ;}
+ Var* parent () const {return m_parent;}
void parent (Var *a_parent)
{
- m_parent = a_parent ;
+ m_parent = a_parent;
}
void to_string (UString &a_str,
@@ -94,35 +94,35 @@ public:
{
if (a_show_var_name) {
if (name () != "") {
- a_str += a_indent_str + name () ;
+ a_str += a_indent_str + name ();
}
}
if (value () != "") {
if (a_show_var_name) {
- a_str += "=" ;
+ a_str += "=";
}
- a_str += value () ;
+ a_str += value ();
}
if (members ().empty ()) {
- return ;
+ return;
}
- UString indent_str = a_indent_str + " " ;
+ UString indent_str = a_indent_str + " ";
a_str += "\n" + a_indent_str + "{";
- list<VarSafePtr>::const_iterator it ;
- for (it = members ().begin () ; it != members ().end () ; ++it) {
+ list<VarSafePtr>::const_iterator it;
+ for (it = members ().begin (); it != members ().end () ; ++it) {
if (!(*it)) {continue;}
- a_str += "\n" ;
- (*it)->to_string (a_str, true, indent_str) ;
+ a_str += "\n";
+ (*it)->to_string (a_str, true, indent_str);
}
a_str += "\n" + a_indent_str + "}";
- a_str.chomp () ;
+ a_str.chomp ();
}
};//end class Var
class NEMIVER_API VarFragment {
- UString m_name ;
- UString m_id ;
+ UString m_name;
+ UString m_id;
public:
@@ -143,7 +143,7 @@ public:
bool operator= (const VarFragment &a_other)
{
- return a_other.m_id == m_id ;
+ return a_other.m_id == m_id;
}
};//end VarFragment
diff --git a/src/langs/nmv-cpp-ast.cc b/src/langs/nmv-cpp-ast.cc
index d853d7a..fbbe559 100644
--- a/src/langs/nmv-cpp-ast.cc
+++ b/src/langs/nmv-cpp-ast.cc
@@ -59,19 +59,19 @@ Token::Token (Kind a_kind, int a_value) :
Token::Token (const Token &a_t)
{
- m_kind = a_t.get_kind () ;
- m_str_value = a_t.get_str_value () ;
- m_int_value = a_t.get_int_value () ;
+ m_kind = a_t.get_kind ();
+ m_str_value = a_t.get_str_value ();
+ m_int_value = a_t.get_int_value ();
}
Token::Token&
Token::operator= (const Token &a_t)
{
- m_kind = a_t.get_kind () ;
- m_str_value = a_t.get_str_value () ;
- m_str_value2 = a_t.get_str_value2 () ;
- m_int_value = a_t.get_int_value () ;
- return *this ;
+ m_kind = a_t.get_kind ();
+ m_str_value = a_t.get_str_value ();
+ m_str_value2 = a_t.get_str_value2 ();
+ m_int_value = a_t.get_int_value ();
+ return *this;
}
Token::~Token ()
@@ -81,53 +81,53 @@ Token::~Token ()
const string&
Token::get_str_value () const
{
- return m_str_value ;
+ return m_str_value;
}
const string&
Token::get_str_value2 () const
{
- return m_str_value2 ;
+ return m_str_value2;
}
int
Token::get_int_value () const
{
- return m_int_value ;
+ return m_int_value;
}
Token::Kind
Token::get_kind () const
{
- return m_kind ;
+ return m_kind;
}
void
Token::set (Kind a_kind)
{
- m_kind = a_kind ;
+ m_kind = a_kind;
}
void
Token::set (Kind a_kind, const string &a_val)
{
- m_kind = a_kind ;
- m_str_value = a_val ;
+ m_kind = a_kind;
+ m_str_value = a_val;
}
void
Token::set (Kind a_kind, const string &a_val, const string &a_val2)
{
- m_kind = a_kind ;
- m_str_value = a_val ;
- m_str_value2 = a_val2 ;
+ m_kind = a_kind;
+ m_str_value = a_val;
+ m_str_value2 = a_val2;
}
void
Token::set (Kind a_kind, int a_val)
{
- m_kind = a_kind ;
- m_int_value = a_val ;
+ m_kind = a_kind;
+ m_int_value = a_val;
}
void
@@ -438,19 +438,19 @@ UnqualifiedOpFuncID::to_string (string &a_result) const
{
switch (get_kind ()) {
case Token::OPERATOR_NEW:
- a_result = "opreator new" ;
+ a_result = "opreator new";
break;
case Token::OPERATOR_DELETE:
- a_result = "opreator delete" ;
+ a_result = "opreator delete";
break;
case Token::OPERATOR_NEW_VECT:
- a_result = "opreator new []" ;
+ a_result = "opreator new []";
break;
case Token::OPERATOR_DELETE_VECT:
- a_result = "opreator delete" ;
+ a_result = "opreator delete";
break;
case Token::OPERATOR_PLUS:
- a_result = "opreator +" ;
+ a_result = "opreator +";
break;
case Token::OPERATOR_MINUS:
a_result = "opreator -";
@@ -468,7 +468,7 @@ UnqualifiedOpFuncID::to_string (string &a_result) const
a_result = "opreator ^";
break;
case Token::OPERATOR_BIT_AND:
- a_result = "opreator &" ;
+ a_result = "opreator &";
break;
case Token::OPERATOR_BIT_OR:
a_result = "opreator |";
diff --git a/src/langs/nmv-cpp-ast.h b/src/langs/nmv-cpp-ast.h
index 8d5e5bb..3b777e2 100644
--- a/src/langs/nmv-cpp-ast.h
+++ b/src/langs/nmv-cpp-ast.h
@@ -113,21 +113,21 @@ public:
};
private:
- Kind m_kind ;
- string m_str_value ;
- string m_str_value2 ;
- int m_int_value ;
+ Kind m_kind;
+ string m_str_value;
+ string m_str_value2;
+ int m_int_value;
public:
- Token () ;
- Token (Kind a_kind, const string& a_value) ;
+ Token ();
+ Token (Kind a_kind, const string& a_value);
Token (Kind a_kind,
const string& a_value,
- const string& a_value2) ;
- Token (Kind a_kind, int a_value) ;
- Token (const Token &) ;
- Token& operator= (const Token&) ;
- ~Token () ;
+ const string& a_value2);
+ Token (Kind a_kind, int a_value);
+ Token (const Token &);
+ Token& operator= (const Token&);
+ ~Token ();
const string& get_str_value () const;
const string& get_str_value2 () const;
int get_int_value () const;
@@ -865,7 +865,7 @@ public:
void set_scope (const QNamePtr a_scope) {m_scope=a_scope;}
const UnqualifiedIDExprPtr get_unqualified_id () const {return m_id;}
void set_unqualified_id (const UnqualifiedIDExprPtr a_id) {m_id = a_id;}
- bool to_string (string &) const ;
+ bool to_string (string &) const;
//TODO: support template-id
};//end QualifiedIDExpr
@@ -986,7 +986,7 @@ public:
if (m_subscript_expr) {
((ExprBase*)m_subscript_expr.get ())->to_string (str);
}
- a_str += "[" + str + "]" ;
+ a_str += "[" + str + "]";
return true;
}
};//end class ArrayPFE
@@ -2048,7 +2048,7 @@ public:
};
private:
- Kind m_kind ;
+ Kind m_kind;
DeclSpecifier ();
public:
@@ -2069,7 +2069,7 @@ public:
{
return (m_kind == AUTO || m_kind == REGISTER
|| m_kind == STATIC || m_kind == EXTERN
- || m_kind == MUTABLE) ;
+ || m_kind == MUTABLE);
}
virtual bool to_string (string &a_str) const=0;
static bool list_to_string (const list<DeclSpecifierPtr> &a_decls, string &a_str);
diff --git a/src/langs/nmv-cpp-lexer-utils.cc b/src/langs/nmv-cpp-lexer-utils.cc
index 0c95925..614516c 100644
--- a/src/langs/nmv-cpp-lexer-utils.cc
+++ b/src/langs/nmv-cpp-lexer-utils.cc
@@ -37,13 +37,13 @@ token_type_as_string (const Token &a_token, std::string &a_out)
a_out = "UNDEFINED";
break;
case Token::IDENTIFIER:
- a_out = "IDENTIFIER" ;
+ a_out = "IDENTIFIER";
break;
case Token::KEYWORD:
a_out = "KEYWORD";
break;
case Token::INTEGER_LITERAL:
- a_out = "INTEGER_LITERAL" ;
+ a_out = "INTEGER_LITERAL";
break;
case Token::CHARACTER_LITERAL:
a_out = "CHARACTER_LITERAL";
@@ -58,7 +58,7 @@ token_type_as_string (const Token &a_token, std::string &a_out)
a_out = "BOOLEAN_LITERAL";
break;
case Token::OPERATOR_NEW:
- a_out = "OPERATOR_NEW" ;
+ a_out = "OPERATOR_NEW";
break;
case Token::OPERATOR_DELETE:
a_out = "OPERATOR_DELETE";
@@ -223,13 +223,13 @@ token_type_as_string (const Token &a_token, std::string &a_out)
a_out="UNKNOWN_TOKEN";
return false;
}
- return true ;
+ return true;
}
bool
token_as_string (const Token &a_token, std::string &a_out)
{
- token_type_as_string (a_token, a_out) ;
+ token_type_as_string (a_token, a_out);
switch (a_token.get_kind ()) {
case Token::IDENTIFIER:
case Token::KEYWORD:
@@ -239,7 +239,7 @@ token_as_string (const Token &a_token, std::string &a_out)
a_out += ":" + a_token.get_str_value ();
break;
case Token::BOOLEAN_LITERAL:
- a_out += ":" + UString::from_int (a_token.get_int_value ()).raw () ;
+ a_out += ":" + UString::from_int (a_token.get_int_value ()).raw ();
break;
default:
break;
@@ -251,7 +251,7 @@ std::ostream&
operator<< (std::ostream &a_out, const Token &a_token)
{
std::string str;
- token_as_string (a_token, str) ;
+ token_as_string (a_token, str);
a_out << str;
return a_out;
}
diff --git a/src/langs/nmv-cpp-lexer-utils.h b/src/langs/nmv-cpp-lexer-utils.h
index 493549a..8757ca9 100644
--- a/src/langs/nmv-cpp-lexer-utils.h
+++ b/src/langs/nmv-cpp-lexer-utils.h
@@ -30,9 +30,9 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
NEMIVER_BEGIN_NAMESPACE (cpp)
-bool token_type_as_string (const Token&, std::string&) ;
-bool token_as_string (const Token&, std::string&) ;
-std::ostream& operator<< (std::ostream &, const Token&) ;
+bool token_type_as_string (const Token&, std::string&);
+bool token_as_string (const Token&, std::string&);
+std::ostream& operator<< (std::ostream &, const Token&);
NEMIVER_END_NAMESPACE (cpp)
diff --git a/src/langs/nmv-cpp-lexer.cc b/src/langs/nmv-cpp-lexer.cc
index 43bc13e..714047f 100644
--- a/src/langs/nmv-cpp-lexer.cc
+++ b/src/langs/nmv-cpp-lexer.cc
@@ -42,10 +42,10 @@ NEMIVER_BEGIN_NAMESPACE (cpp)
//<class Lexer implem>
//********************
struct Lexer::Priv {
- string input ;
+ string input;
//points to the current character in the char stream
- string::size_type cursor ;
- deque<string::size_type> recorded_positions ;
+ string::size_type cursor;
+ deque<string::size_type> recorded_positions;
deque<Token> tokens_queue;
//points to the next token in the token stream;
deque<Token>::size_type token_cursor;
@@ -94,14 +94,14 @@ if (!IN_BOUNDS (CUR)) {return;}
Lexer::Lexer (const string &a_in)
{
- m_priv = new Lexer::Priv (a_in) ;
+ m_priv = new Lexer::Priv (a_in);
}
Lexer::~Lexer ()
{
if (m_priv) {
- delete m_priv ;
- m_priv = NULL ;
+ delete m_priv;
+ m_priv = NULL;
}
}
@@ -111,15 +111,15 @@ Lexer::next_is (const char *a_char_seq) const
CHECK_CURSOR_BOUNDS
if (!a_char_seq)
- return false ;
+ return false;
- int len = strlen (a_char_seq) ;
+ int len = strlen (a_char_seq);
if (!len)
- return false ;
+ return false;
if (IN_BOUNDS (CUR + len - 1) && !INPUT.compare (CUR, len, a_char_seq)) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
void
@@ -128,7 +128,7 @@ Lexer::skip_blanks ()
CHECK_CURSOR_BOUNDS2;
while (CURSOR_IN_BOUNDS && isblank (CUR_CHAR)) {
- MOVE_FORWARD (1) ;
+ MOVE_FORWARD (1);
}
}
@@ -138,33 +138,33 @@ Lexer::is_nondigit (const char a_in) const
if (a_in == '_' ||
(a_in >= 'A' && a_in <= 'Z') ||
(a_in >= 'a' && a_in <= 'z')) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
bool
Lexer::is_digit (const char a_in) const
{
if (a_in >= '0' and a_in <= '9')
- return true ;
- return false ;
+ return true;
+ return false;
}
bool
Lexer::is_nonzero_digit (const char a_in) const
{
if (a_in >= '1' and a_in <= '9')
- return true ;
- return false ;
+ return true;
+ return false;
}
bool
Lexer::is_octal_digit (const char a_in) const
{
if (a_in >= '0' && a_in <= '7')
- return true ;
- return false ;
+ return true;
+ return false;
}
bool
@@ -173,22 +173,22 @@ Lexer::is_hexadecimal_digit (const char a_in) const
if (is_digit (a_in) ||
(a_in >= 'a' && a_in <= 'f') ||
(a_in >= 'A' && a_in <= 'F')) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
int
Lexer::hexadigit_to_decimal (const char a_hexa) const
{
if (a_hexa >= '0' && a_hexa <= '9') {
- return a_hexa - '0' ;
+ return a_hexa - '0';
} else if (a_hexa >= 'a' && a_hexa <= 'f') {
- return 10 + a_hexa - 'a' ;
+ return 10 + a_hexa - 'a';
} else if (a_hexa >= 'A' && a_hexa <= 'F') {
- return 10 + a_hexa - 'A' ;
+ return 10 + a_hexa - 'A';
}
- return -1 ;
+ return -1;
}
bool
@@ -197,7 +197,7 @@ Lexer::scan_decimal_literal (string &a_result)
CHECK_CURSOR_BOUNDS
record_ci_position ();
- string result ;
+ string result;
if (is_nonzero_digit (CUR_CHAR)) {
result += CUR_CHAR;
CONSUME_CHAR;
@@ -205,38 +205,38 @@ Lexer::scan_decimal_literal (string &a_result)
goto error;
}
while (CURSOR_IN_BOUNDS && is_digit (CUR_CHAR)) {
- result += CUR_CHAR ;
+ result += CUR_CHAR;
CONSUME_CHAR;
}
- a_result = result ;
+ a_result = result;
pop_recorded_ci_position ();
return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
Lexer::scan_octal_literal (string &a_result)
{
- CHECK_CURSOR_BOUNDS ;
+ CHECK_CURSOR_BOUNDS;
record_ci_position ();
- string result ;
+ string result;
if (CUR_CHAR != '0')
goto error;
- result += CUR_CHAR ;
+ result += CUR_CHAR;
CONSUME_CHAR;
while (CURSOR_IN_BOUNDS && is_octal_digit (CUR_CHAR)) {
result += CUR_CHAR;
CONSUME_CHAR;
}
- a_result = result ;
+ a_result = result;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
@@ -249,26 +249,26 @@ Lexer::scan_hexadecimal_literal (string &a_result)
CHECK_CURSOR_BOUNDS
record_ci_position ();
- string result ;
+ string result;
if (IN_BOUNDS (CUR+1)
&& INPUT[CUR] == '0'
&& (INPUT[CUR+1] == 'x' || INPUT[CUR+1] == 'X')) {
MOVE_FORWARD_AND_CHECK (2);
}
while (CURSOR_IN_BOUNDS && is_hexadecimal_digit (CUR_CHAR)) {
- result += CUR_CHAR ;
+ result += CUR_CHAR;
CONSUME_CHAR;
}
if (result.empty ()) {
goto error;
}
- a_result = result ;
+ a_result = result;
pop_recorded_ci_position ();
return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
@@ -279,9 +279,9 @@ Lexer::scan_escape_sequence (int &a_result)
if (scan_simple_escape_sequence (a_result) ||
scan_octal_escape_sequence (a_result) ||
scan_hexadecimal_escape_sequence (a_result)) {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
bool
@@ -293,14 +293,14 @@ Lexer::scan_universal_character_name (int &a_result)
if (!IN_BOUNDS (CUR+5) ||
INPUT[CUR] != '\\' ||
(INPUT[CUR+1] != 'U' && INPUT[CUR+1] != 'u')) {
- return false ;
+ return false;
}
- MOVE_FORWARD_AND_CHECK (2) ;
+ MOVE_FORWARD_AND_CHECK (2);
if (!scan_hexquad (a_result)) {
goto error;
}
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
@@ -313,32 +313,32 @@ Lexer::scan_c_char (int &a_result)
CHECK_CURSOR_BOUNDS
if (CUR_CHAR != '\\' && CUR_CHAR != '\'' && CUR_CHAR != '\n') {
- a_result = CUR_CHAR ;
+ a_result = CUR_CHAR;
CONSUME_CHAR;
- return true ;
+ return true;
} else {
if (scan_escape_sequence (a_result) ||
scan_universal_character_name (a_result)) {
- return true ;
+ return true;
}
}
- return false ;
+ return false;
}
bool
Lexer::scan_c_char_sequence (string &a_result)
{
CHECK_CURSOR_BOUNDS
- int c=0 ;
+ int c=0;
if (!scan_c_char (c)) {
- return false ;
+ return false;
}
- a_result = c ;
+ a_result = c;
while (CURSOR_IN_BOUNDS && scan_c_char (c)) {
- a_result += c ;
+ a_result += c;
}
- return true ;
+ return true;
}
bool
@@ -347,32 +347,32 @@ Lexer::scan_s_char (int &a_result)
CHECK_CURSOR_BOUNDS
if (CUR_CHAR != '\\' && CUR_CHAR != '"' && CUR_CHAR != '\n') {
- a_result = CUR_CHAR ;
+ a_result = CUR_CHAR;
CONSUME_CHAR;
- return true ;
+ return true;
} else {
if (scan_escape_sequence (a_result) ||
scan_universal_character_name (a_result)) {
- return true ;
+ return true;
}
}
- return false ;
+ return false;
}
bool
Lexer::scan_s_char_sequence (string &a_result)
{
CHECK_CURSOR_BOUNDS
- int c=0 ;
+ int c=0;
if (!scan_s_char (c)) {
- return false ;
+ return false;
}
- a_result = c ;
+ a_result = c;
while (CURSOR_IN_BOUNDS && scan_s_char (c)) {
- a_result += c ;
+ a_result += c;
}
- return true ;
+ return true;
}
bool
@@ -400,11 +400,11 @@ Lexer::scan_character_literal (string &a_result)
}
a_result = result;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
@@ -413,18 +413,18 @@ Lexer::scan_digit_sequence (string &a_result)
CHECK_CURSOR_BOUNDS
record_ci_position ();
- string result ;
+ string result;
while (CURSOR_IN_BOUNDS && is_digit (CUR_CHAR)) {
- result += CUR_CHAR ;
+ result += CUR_CHAR;
CONSUME_CHAR;
}
if (result.empty ()) {
goto error;
}
- a_result = result ;
+ a_result = result;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
@@ -439,21 +439,21 @@ Lexer::scan_fractional_constant (string &a_result)
string left, right;
- scan_digit_sequence (left) ;
+ scan_digit_sequence (left);
if (CUR_CHAR != '.') {
- goto error ;
+ goto error;
}
CONSUME_CHAR_AND_CHECK;
if (!scan_digit_sequence (right) && left.empty ()) {
- goto error ;
+ goto error;
}
- a_result = left + "." + right ;
+ a_result = left + "." + right;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
@@ -462,25 +462,25 @@ Lexer::scan_exponent_part (string &a_result)
CHECK_CURSOR_BOUNDS
record_ci_position ();
- string result, sign ;
+ string result, sign;
if (CUR_CHAR != 'e' && CUR_CHAR != 'E') {
- goto error ;
+ goto error;
}
CONSUME_CHAR_AND_CHECK;
if (INPUT[CUR] == '-' || INPUT[CUR] == '+') {
- sign = INPUT[CUR] ;
+ sign = INPUT[CUR];
CONSUME_CHAR_AND_CHECK;
}
if (!scan_digit_sequence (result)) {
- goto error ;
+ goto error;
}
- a_result = sign + result ;
+ a_result = sign + result;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
@@ -493,7 +493,7 @@ Lexer::scan_floating_literal (string &a_result,
string fract, exp;
if (scan_fractional_constant (fract)) {
- scan_exponent_part (exp) ;
+ scan_exponent_part (exp);
if (CUR_CHAR == 'f' || CUR_CHAR == 'F'
|| CUR_CHAR == 'L' || CUR_CHAR == 'l') {
CONSUME_CHAR_AND_CHECK;
@@ -513,7 +513,7 @@ Lexer::scan_floating_literal (string &a_result,
a_result = fract;
a_exponent = exp;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
@@ -527,7 +527,7 @@ Lexer::scan_string_literal (string &a_result)
CHECK_CURSOR_BOUNDS
record_ci_position ();
- string result ;
+ string result;
if (CUR_CHAR == 'L') {
CONSUME_CHAR_AND_CHECK;
}
@@ -537,20 +537,20 @@ Lexer::scan_string_literal (string &a_result)
goto error;
}
if (!scan_s_char_sequence (result)) {
- goto error ;
+ goto error;
}
if (CUR_CHAR == '"') {
CONSUME_CHAR;
} else {
goto error;
}
- a_result = result ;
+ a_result = result;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
@@ -565,18 +565,18 @@ Lexer::scan_boolean_literal (bool &a_result)
&& INPUT[CUR+3] == 's'
&& INPUT[CUR+4] == 'e') {
MOVE_FORWARD (4);
- a_result = false ;
- return true ;
+ a_result = false;
+ return true;
} else if (IN_BOUNDS (CUR+3)
&& INPUT[CUR] == 't'
&& INPUT[CUR+1] == 'r'
&& INPUT[CUR+2] == 'u'
&& INPUT[CUR+3] == 'e') {
MOVE_FORWARD (3);
- a_result = true ;
- return true ;
+ a_result = true;
+ return true;
}
- return false ;
+ return false;
}
bool
@@ -585,7 +585,7 @@ Lexer::scan_integer_suffix (string &a_result)
CHECK_CURSOR_BOUNDS
record_ci_position ();
- string result ;
+ string result;
if (CUR_CHAR == 'u' or CUR_CHAR == 'U') {
result += CUR_CHAR;
CONSUME_CHAR_AND_CHECK;
@@ -597,7 +597,7 @@ Lexer::scan_integer_suffix (string &a_result)
result += CUR_CHAR;
CONSUME_CHAR_AND_CHECK;
if (CUR_CHAR == 'u' or CUR_CHAR == 'U') {
- result += CUR_CHAR ;
+ result += CUR_CHAR;
CONSUME_CHAR;
}
} else {
@@ -606,9 +606,9 @@ Lexer::scan_integer_suffix (string &a_result)
if (result.empty ()) {
goto error;
}
- a_result = result ;
+ a_result = result;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
@@ -620,33 +620,33 @@ Lexer::scan_integer_literal (string &a_result)
{
CHECK_CURSOR_BOUNDS
- string literal, tmp ;
+ string literal, tmp;
if (is_nonzero_digit (CUR_CHAR)) {
if (!scan_decimal_literal (literal)) {
- return false ;
+ return false;
}
if (CUR_CHAR == 'l' or
CUR_CHAR == 'L' or
CUR_CHAR == 'u' or
CUR_CHAR == 'U') {
if (scan_integer_suffix (tmp)) {
- literal += tmp ;
+ literal += tmp;
}
}
} else if (IN_BOUNDS (CUR+1) and CUR_CHAR == '0' and
(INPUT[CUR+1] == 'x' or INPUT[CUR+1] == 'X')) {
if (!scan_hexadecimal_literal (literal)) {
- return false ;
+ return false;
}
} else if (CUR_CHAR == '0') {
if (!scan_octal_literal (literal)) {
- return false ;
+ return false;
}
} else {
- return false ;
+ return false;
}
- a_result = literal ;
- return true ;
+ a_result = literal;
+ return true;
}
bool
@@ -656,50 +656,50 @@ Lexer::scan_simple_escape_sequence (int &a_result)
record_ci_position ();
if (CUR_CHAR != '\\')
- return false ;
+ return false;
CONSUME_CHAR_AND_CHECK;
switch (CUR_CHAR) {
case '\'':
- a_result = '\\' ;
- break ;
+ a_result = '\\';
+ break;
case '"' :
- a_result = '"' ;
- break ;
+ a_result = '"';
+ break;
case '?':
- a_result = '?' ;
- break ;
+ a_result = '?';
+ break;
case '\\':
- a_result = '\\' ;
- break ;
+ a_result = '\\';
+ break;
case 'a' :
a_result = '\a';
- break ;
+ break;
case 'b' :
a_result = '\b';
- break ;
+ break;
case 'f' :
a_result = '\f';
- break ;
+ break;
case 'n' :
a_result = '\n';
- break ;
+ break;
case 'r' :
- a_result = '\r' ;
- break ;
+ a_result = '\r';
+ break;
case 't' :
- a_result = '\t' ;
- break ;
+ a_result = '\t';
+ break;
case 'v':
- a_result = '\v' ;
- break ;
+ a_result = '\v';
+ break;
default:
goto error;
}
CONSUME_CHAR;
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
@@ -709,73 +709,73 @@ error:
bool
Lexer::scan_octal_escape_sequence (int &a_result)
{
- CHECK_CURSOR_BOUNDS ;
+ CHECK_CURSOR_BOUNDS;
unsigned cur=CUR;
- int result=0 ;
+ int result=0;
if (!IN_BOUNDS (cur+1) || INPUT[cur] != '\\' || !is_octal_digit (INPUT[cur+1])) {
- return false ;
+ return false;
}
- ++cur ;
- result = INPUT[CUR] - '0' ;
- ++cur ;
+ ++cur;
+ result = INPUT[CUR] - '0';
+ ++cur;
if (IN_BOUNDS (cur) && is_octal_digit (INPUT[cur])) {
- result = 8*result + (INPUT[cur] - '0') ;
+ result = 8*result + (INPUT[cur] - '0');
- ++cur ;
+ ++cur;
if (IN_BOUNDS (cur) && is_octal_digit (INPUT[cur])) {
- result = 8*result + (INPUT[cur] - '0') ;
- ++cur ;
+ result = 8*result + (INPUT[cur] - '0');
+ ++cur;
}
}
- CUR = cur ;
- a_result = result ;
- return true ;
+ CUR = cur;
+ a_result = result;
+ return true;
}
bool
Lexer::scan_hexadecimal_escape_sequence (int &a_result)
{
- CHECK_CURSOR_BOUNDS ;
+ CHECK_CURSOR_BOUNDS;
unsigned cur=CUR;
if (!IN_BOUNDS (cur+1) || INPUT[cur] != '\\' ||
!is_hexadecimal_digit (INPUT[cur+1])) {
- return false ;
+ return false;
}
- ++cur ;
- a_result = INPUT[cur] ;
- ++cur ;
+ ++cur;
+ a_result = INPUT[cur];
+ ++cur;
while (IN_BOUNDS (cur) && is_hexadecimal_digit (INPUT[cur])) {
- a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur]) ;
- ++cur ;
+ a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur]);
+ ++cur;
}
- CUR = cur ;
- return true ;
+ CUR = cur;
+ return true;
}
bool
Lexer::scan_hexquad (int &a_result)
{
- CHECK_CURSOR_BOUNDS ;
+ CHECK_CURSOR_BOUNDS;
unsigned cur=CUR;
if (!IN_BOUNDS (cur+3)) {
- return false ;
+ return false;
}
if (is_hexadecimal_digit (cur) &&
is_hexadecimal_digit (cur+1) &&
is_hexadecimal_digit (cur+2) &&
is_hexadecimal_digit (cur+3)) {
- a_result = INPUT[cur] ;
- a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur+1]) ;
- a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur+2]) ;
- a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur+3]) ;
- CUR = cur+4 ;
- return true ;
- }
- return false ;
+ a_result = INPUT[cur];
+ a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur+1]);
+ a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur+2]);
+ a_result = 16*a_result + hexadigit_to_decimal (INPUT[cur+3]);
+ CUR = cur+4;
+ return true;
+ }
+ return false;
}
bool
@@ -792,26 +792,26 @@ Lexer::scan_identifier (Token &a_token)
identifier += CUR_CHAR;
CONSUME_CHAR;
while (CURSOR_IN_BOUNDS && (is_nondigit (CUR_CHAR) || is_digit (CUR_CHAR))) {
- identifier += CUR_CHAR ;
+ identifier += CUR_CHAR;
CONSUME_CHAR;
}
if (identifier.empty ()) {
goto error;
}
- a_token.set (Token::IDENTIFIER, identifier) ;
+ a_token.set (Token::IDENTIFIER, identifier);
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
bool
Lexer::scan_keyword (Token &a_token)
{
CHECK_CURSOR_BOUNDS
- int key_length=0 ;
+ int key_length=0;
if (SCAN_KEYWORD (3, "and") or
SCAN_KEYWORD (6, "and_eq") or
@@ -894,12 +894,12 @@ Lexer::scan_keyword (Token &a_token)
//could be an identifier
return false;
}
- string value = INPUT.substr (CUR, key_length) ;
- a_token.set (Token::KEYWORD, value) ;
- CUR += key_length ;
- return true ;
+ string value = INPUT.substr (CUR, key_length);
+ a_token.set (Token::KEYWORD, value);
+ CUR += key_length;
+ return true;
}
- return false ;
+ return false;
}
bool
@@ -909,19 +909,19 @@ Lexer::scan_literal (Token &a_token)
string lit1, lit2;
bool lit3=0;
if (scan_character_literal (lit1)) {
- a_token.set (Token::CHARACTER_LITERAL, lit1) ;
+ a_token.set (Token::CHARACTER_LITERAL, lit1);
} else if (scan_integer_literal (lit1)) {
- a_token.set (Token::INTEGER_LITERAL, lit1) ;
+ a_token.set (Token::INTEGER_LITERAL, lit1);
} else if (scan_floating_literal (lit1, lit2)) {
- a_token.set (Token::FLOATING_LITERAL, lit1, lit2) ;
+ a_token.set (Token::FLOATING_LITERAL, lit1, lit2);
} else if (scan_string_literal (lit1)) {
- a_token.set (Token::STRING_LITERAL, lit1) ;
+ a_token.set (Token::STRING_LITERAL, lit1);
} else if (scan_boolean_literal (lit3)) {
- a_token.set (Token::BOOLEAN_LITERAL, lit3) ;
+ a_token.set (Token::BOOLEAN_LITERAL, lit3);
} else {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
bool
@@ -937,7 +937,7 @@ Lexer::scan_operator (Token &a_token)
MOVE_FORWARD (sizeof ("[]"));
a_token.set (Token::OPERATOR_NEW_VECT);
} else {
- a_token.set (Token::OPERATOR_NEW) ;
+ a_token.set (Token::OPERATOR_NEW);
}
} else if (next_is ("delete")) {
MOVE_FORWARD (sizeof ("delete"));
@@ -982,9 +982,9 @@ Lexer::scan_operator (Token &a_token)
CONSUME_CHAR;
if (CUR_CHAR == '=') {
CONSUME_CHAR;
- a_token.set (Token::OPERATOR_MULT_EQ) ;
+ a_token.set (Token::OPERATOR_MULT_EQ);
} else {
- a_token.set (Token::OPERATOR_MULT) ;
+ a_token.set (Token::OPERATOR_MULT);
}
} else if (CUR_CHAR == '/') {
CONSUME_CHAR;
@@ -992,7 +992,7 @@ Lexer::scan_operator (Token &a_token)
CONSUME_CHAR;
a_token.set (Token::OPERATOR_DIV_EQ);
} else {
- a_token.set (Token::OPERATOR_DIV) ;
+ a_token.set (Token::OPERATOR_DIV);
}
} else if (CUR_CHAR == '%') {
CONSUME_CHAR;
@@ -1114,7 +1114,7 @@ Lexer::scan_operator (Token &a_token)
CONSUME_CHAR;
if (CUR_CHAR == ':') {
CONSUME_CHAR;
- a_token.set (Token::OPERATOR_SCOPE_RESOL) ;
+ a_token.set (Token::OPERATOR_SCOPE_RESOL);
} else {
goto error;
}
@@ -1147,19 +1147,19 @@ Lexer::scan_punctuator (Token &a_token)
break;
case ';':
a_token.set (Token::PUNCTUATOR_SEMI_COLON);
- break ;
+ break;
case '{':
a_token.set (Token::PUNCTUATOR_CURLY_BRACKET_OPEN);
break;
case '}':
a_token.set (Token::PUNCTUATOR_CURLY_BRACKET_CLOSE);
- break ;
+ break;
case '[':
a_token.set (Token::PUNCTUATOR_BRACKET_OPEN);
- break ;
+ break;
case ']':
a_token.set (Token::PUNCTUATOR_BRACKET_CLOSE);
- break ;
+ break;
case '(':
a_token.set (Token::PUNCTUATOR_PARENTHESIS_OPEN);
break;
@@ -1175,10 +1175,10 @@ Lexer::scan_punctuator (Token &a_token)
CONSUME_CHAR;
okay:
pop_recorded_ci_position ();
- return true ;
+ return true;
error:
restore_ci_position ();
- return false ;
+ return false;
}
/// scan the character input
@@ -1215,7 +1215,7 @@ Lexer::scan_next_token (Token &a_token)
case '[':
case '.':
case ':':
- is_ok = scan_operator (a_token) ;
+ is_ok = scan_operator (a_token);
if (is_ok) {
goto okay;
}
@@ -1267,14 +1267,14 @@ Lexer::scan_next_token (Token &a_token)
}
//then try keywords
if (is_nondigit (CUR_CHAR)) {
- is_ok = scan_keyword (a_token) ;
+ is_ok = scan_keyword (a_token);
if (is_ok) {
goto okay;
}
}
//then try identifiers
if (is_nondigit (CUR_CHAR)) {
- is_ok = scan_identifier (a_token) ;
+ is_ok = scan_identifier (a_token);
if (is_ok) {
goto okay;
}
@@ -1304,7 +1304,7 @@ Lexer::peek_next_token (Token &a_token)
if (m_priv->token_cursor >= m_priv->tokens_queue.size ()) {
return false;
}
- a_token = m_priv->tokens_queue[m_priv->token_cursor] ;
+ a_token = m_priv->tokens_queue[m_priv->token_cursor];
return true;
}
@@ -1358,7 +1358,7 @@ bool
Lexer::consume_next_token (Token &a_token)
{
if (!peek_next_token (a_token)) {return false;}
- ++m_priv->token_cursor ;
+ ++m_priv->token_cursor;
return true;
}
diff --git a/src/langs/nmv-cpp-lexer.h b/src/langs/nmv-cpp-lexer.h
index 83e04d0..343ce48 100644
--- a/src/langs/nmv-cpp-lexer.h
+++ b/src/langs/nmv-cpp-lexer.h
@@ -30,7 +30,7 @@
#include "common/nmv-namespace.h"
#include "common/nmv-api-macros.h"
-using std::string ;
+using std::string;
using nemiver::cpp::Token;
NEMIVER_BEGIN_NAMESPACE (nemiver)
@@ -38,10 +38,10 @@ NEMIVER_BEGIN_NAMESPACE (cpp)
class NEMIVER_API Lexer {
- Lexer (const Lexer &) ;
- Lexer& operator=(const Lexer&) ;
+ Lexer (const Lexer &);
+ Lexer& operator=(const Lexer&);
struct Priv;
- Priv *m_priv ;
+ Priv *m_priv;
private:
/// \name token scanning helpers
@@ -53,33 +53,33 @@ private:
bool is_digit (const char a_in) const;
bool is_nonzero_digit (const char a_in) const;
bool is_octal_digit (const char a_in) const;
- bool is_hexadecimal_digit (const char) const ;
+ bool is_hexadecimal_digit (const char) const;
int hexadigit_to_decimal (const char) const;
- bool scan_decimal_literal (string &a_result) ;
- bool scan_octal_literal (string &a_result) ;
- bool scan_hexadecimal_literal (string &a_result) ;
- bool scan_hexquad (string &a_result) ;
- bool scan_integer_suffix (string &a_result) ;
- bool scan_integer_literal (string &a_result) ;
- bool scan_simple_escape_sequence (int &a_result) ;
- bool scan_octal_escape_sequence (int &a_result) ;
- bool scan_hexadecimal_escape_sequence (int &a_result) ;
- bool scan_escape_sequence (int &a_result) ;
- bool scan_hexquad (int &a_result) ;
- bool scan_universal_character_name (int &a_result) ;
- bool scan_c_char (int &a_result) ;
- bool scan_c_char_sequence (string &a_result) ;
- bool scan_s_char (int &a_result) ;
- bool scan_s_char_sequence (string &a_result) ;
- bool scan_character_literal (string &a_result) ;
- bool scan_digit_sequence (string &a_result) ;
- bool scan_fractional_constant (string &a_result) ;
- bool scan_exponent_part (string &a_result) ;
+ bool scan_decimal_literal (string &a_result);
+ bool scan_octal_literal (string &a_result);
+ bool scan_hexadecimal_literal (string &a_result);
+ bool scan_hexquad (string &a_result);
+ bool scan_integer_suffix (string &a_result);
+ bool scan_integer_literal (string &a_result);
+ bool scan_simple_escape_sequence (int &a_result);
+ bool scan_octal_escape_sequence (int &a_result);
+ bool scan_hexadecimal_escape_sequence (int &a_result);
+ bool scan_escape_sequence (int &a_result);
+ bool scan_hexquad (int &a_result);
+ bool scan_universal_character_name (int &a_result);
+ bool scan_c_char (int &a_result);
+ bool scan_c_char_sequence (string &a_result);
+ bool scan_s_char (int &a_result);
+ bool scan_s_char_sequence (string &a_result);
+ bool scan_character_literal (string &a_result);
+ bool scan_digit_sequence (string &a_result);
+ bool scan_fractional_constant (string &a_result);
+ bool scan_exponent_part (string &a_result);
bool scan_floating_literal (string &a_result,
- string &a_exponent) ;
- bool scan_string_literal (string &a_result) ;
- bool scan_boolean_literal (bool &a_result) ;
+ string &a_exponent);
+ bool scan_string_literal (string &a_result);
+ bool scan_boolean_literal (bool &a_result);
/// @}
/// \name scanning methods
@@ -89,7 +89,7 @@ private:
bool scan_literal (Token &a_token);
bool scan_operator (Token &a_token);
bool scan_punctuator (Token &a_token);
- bool scan_next_token (Token &a_token) ;
+ bool scan_next_token (Token &a_token);
/// \ }
/// \name recording/restoring position in the char input stream
@@ -98,8 +98,8 @@ private:
void pop_recorded_ci_position ();
public:
- Lexer (const string &a_in) ;
- ~Lexer () ;
+ Lexer (const string &a_in);
+ ~Lexer ();
/// \name peeking/consuming tokens
diff --git a/src/langs/nmv-cpp-parser.cc b/src/langs/nmv-cpp-parser.cc
index 868662e..acf63b6 100644
--- a/src/langs/nmv-cpp-parser.cc
+++ b/src/langs/nmv-cpp-parser.cc
@@ -1572,7 +1572,7 @@ bool
Parser::parse_type_specifier (TypeSpecifierPtr &a_result)
{
string str;
- TypeSpecifierPtr result ;
+ TypeSpecifierPtr result;
SimpleTypeSpecPtr type_spec;
ElaboratedTypeSpecPtr type_spec2;
Token token;
@@ -1945,7 +1945,7 @@ Parser::parse_declarator_id (IDDeclaratorPtr &a_result)
if (token.get_kind () == Token::OPERATOR_SCOPE_RESOL) {
LEXER.consume_next_token ();
}
- parse_nested_name_specifier (scope) ;
+ parse_nested_name_specifier (scope);
if (parse_type_name (type_name)) {
IDExprPtr id_expr (new QualifiedIDExpr (scope, type_name));
result.reset (new IDDeclarator (id_expr));
@@ -2255,7 +2255,7 @@ out:
/// parse a simple-declaration production
///
/// simple-declaration:
-/// decl-specifier-seq(opt) init-declarator-list(opt) ;
+/// decl-specifier-seq(opt) init-declarator-list(opt);
///
bool
Parser::parse_simple_declaration (SimpleDeclarationPtr &a_result)
@@ -2265,7 +2265,7 @@ Parser::parse_simple_declaration (SimpleDeclarationPtr &a_result)
if (!parse_decl_specifier_seq (decl_specs))
return true;
- parse_init_declarator_list (init_decls) ;
+ parse_init_declarator_list (init_decls);
a_result.reset (new SimpleDeclaration (decl_specs, init_decls));
return true;
}
diff --git a/src/langs/nmv-cpp-parser.h b/src/langs/nmv-cpp-parser.h
index 1d103d8..16f0b9d 100644
--- a/src/langs/nmv-cpp-parser.h
+++ b/src/langs/nmv-cpp-parser.h
@@ -64,7 +64,7 @@ public:
bool parse_log_or_expr (LogOrExprPtr &);
bool parse_cond_expr (CondExprPtr &);
bool parse_assign_expr (AssignExprPtr &);
- bool parse_expr (ExprPtr &) ;
+ bool parse_expr (ExprPtr &);
bool parse_const_expr (ConstExprPtr &);
bool parse_class_or_namespace_name (UnqualifiedIDExprPtr &a_name);
bool parse_type_name (UnqualifiedIDExprPtr &);
diff --git a/src/main.cc b/src/main.cc
index 1a15f36..44750ef 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -287,7 +287,7 @@ process_gui_command_line (int& a_argc, char** a_argv, int &a_return)
<< gv_process_to_attach_to
<< "'"
<< endl
- ;
+ ;
a_return = -1;
return false;
}
@@ -298,7 +298,7 @@ process_gui_command_line (int& a_argc, char** a_argv, int &a_return)
<< gv_process_to_attach_to
<< "'"
<< endl
- ;
+ ;
a_return = -1;
return false;
} else {
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index d953b78..b3e5ad2 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -468,9 +468,9 @@ public:
const UString& get_perspective_identifier ();
- void get_toolbars (list<Gtk::Widget*> &a_tbs) ;
+ void get_toolbars (list<Gtk::Widget*> &a_tbs);
- Gtk::Widget* get_body () ;
+ Gtk::Widget* get_body ();
IWorkbench& get_workbench ();
@@ -801,8 +801,8 @@ struct DBGPerspective::Priv {
sigc::signal<void> debugger_not_started_signal;
sigc::signal<void> going_to_run_target_signal;
sigc::signal<void> default_config_read_signal;
- sigc::signal<void, bool> show_command_view_signal ;
- sigc::signal<void, bool> show_target_output_view_signal ;
+ sigc::signal<void, bool> show_command_view_signal;
+ sigc::signal<void, bool> show_target_output_view_signal;
sigc::signal<void, bool> show_log_view_signal;
bool command_view_is_visible;
bool target_output_view_is_visible;
diff --git a/src/persp/dbgperspective/nmv-global-vars-inspector-dialog.cc b/src/persp/dbgperspective/nmv-global-vars-inspector-dialog.cc
index 2434c8b..65e521f 100644
--- a/src/persp/dbgperspective/nmv-global-vars-inspector-dialog.cc
+++ b/src/persp/dbgperspective/nmv-global-vars-inspector-dialog.cc
@@ -36,7 +36,7 @@
#include "nmv-i-var-list-walker.h"
using namespace nemiver::common;
-namespace vutil=nemiver::variables_utils2;
+namespace vutil = nemiver::variables_utils2;
NEMIVER_BEGIN_NAMESPACE (nemiver)
diff --git a/src/persp/dbgperspective/nmv-local-vars-inspector.cc b/src/persp/dbgperspective/nmv-local-vars-inspector.cc
index 3562767..04e1eb9 100644
--- a/src/persp/dbgperspective/nmv-local-vars-inspector.cc
+++ b/src/persp/dbgperspective/nmv-local-vars-inspector.cc
@@ -39,8 +39,8 @@
#include "nmv-debugger-utils.h"
using namespace nemiver::common;
-namespace vutil=nemiver::variables_utils2;
-namespace dutil=nemiver::debugger_utils;
+namespace vutil = nemiver::variables_utils2;
+namespace dutil = nemiver::debugger_utils;
using Glib::RefPtr;
NEMIVER_BEGIN_NAMESPACE (nemiver)
diff --git a/src/persp/dbgperspective/nmv-vars-treeview.cc b/src/persp/dbgperspective/nmv-vars-treeview.cc
index f759719..3d0b133 100644
--- a/src/persp/dbgperspective/nmv-vars-treeview.cc
+++ b/src/persp/dbgperspective/nmv-vars-treeview.cc
@@ -27,7 +27,7 @@
#include "nmv-vars-treeview.h"
#include "nmv-variables-utils.h"
-namespace vutil=nemiver::variables_utils2;
+namespace vutil = nemiver::variables_utils2;
NEMIVER_BEGIN_NAMESPACE (nemiver)
diff --git a/src/persp/nmv-i-perspective.h b/src/persp/nmv-i-perspective.h
index 6d4eb22..fad359d 100644
--- a/src/persp/nmv-i-perspective.h
+++ b/src/persp/nmv-i-perspective.h
@@ -33,17 +33,17 @@
NEMIVER_BEGIN_NAMESPACE (nemiver)
-using nemiver::common::Plugin ;
-using std::list ;
-using nemiver::common::UString ;
+using nemiver::common::Plugin;
+using std::list;
+using nemiver::common::UString;
using nemiver::common::ObjectRef;
using nemiver::common::ObjectUnref;
using nemiver::common::SafePtr;
-using nemiver::IWorkbenchSafePtr ;
+using nemiver::IWorkbenchSafePtr;
-class IPerspective ;
+class IPerspective;
-typedef SafePtr<IPerspective, ObjectRef, ObjectUnref> IPerspectiveSafePtr ;
+typedef SafePtr<IPerspective, ObjectRef, ObjectUnref> IPerspectiveSafePtr;
/// an abstraction of a consistent user interface dedicated
/// at doing a certain task. Nemiver is a collection of perspectives
@@ -53,9 +53,9 @@ typedef SafePtr<IPerspective, ObjectRef, ObjectUnref> IPerspectiveSafePtr ;
/// all the perspective it finds, at launch time.
class NEMIVER_API IPerspective : public Plugin::EntryPoint {
//non copyable
- IPerspective (const IPerspective&) ;
- IPerspective& operator= (const IPerspective&) ;
- IPerspective () ;
+ IPerspective (const IPerspective&);
+ IPerspective& operator= (const IPerspective&);
+ IPerspective ();
protected:
IPerspective (DynamicModule *a_dynmod) :
@@ -81,10 +81,10 @@ public:
/// \params a_tbs the list of toolbars. The implementation of this method
/// must fill this parameter with the list of toolbars it wants the workbench
/// to display when this perspective becomes active.
- virtual void get_toolbars (list<Gtk::Widget*> &a_tbs) = 0 ;
+ virtual void get_toolbars (list<Gtk::Widget*> &a_tbs) = 0;
/// \returns the body of the perspective.
- virtual Gtk::Widget* get_body () = 0 ;
+ virtual Gtk::Widget* get_body () = 0;
/// \returns the workbench associated to this perspective
virtual IWorkbench& get_workbench () = 0;
@@ -104,7 +104,7 @@ public:
///
/// Let the user choose the set of files to open
/// via a file chooser dialog and open them.
- virtual void open_file () = 0 ;
+ virtual void open_file () = 0;
/// \brief close the currently selected file
virtual void close_current_file () = 0;
diff --git a/src/uicommon/nmv-hex-document.h b/src/uicommon/nmv-hex-document.h
index 86cb0c0..14cb763 100644
--- a/src/uicommon/nmv-hex-document.h
+++ b/src/uicommon/nmv-hex-document.h
@@ -55,7 +55,7 @@ protected:
Document (const std::string& filename);
public:
- virtual ~Document () ;
+ virtual ~Document ();
static DocumentSafePtr create ();
static DocumentSafePtr create (const std::string& filename);
::HexDocument* cobj();
diff --git a/src/uicommon/nmv-popup-tip.h b/src/uicommon/nmv-popup-tip.h
index b9c231e..7463d4d 100644
--- a/src/uicommon/nmv-popup-tip.h
+++ b/src/uicommon/nmv-popup-tip.h
@@ -30,29 +30,29 @@
#include "common/nmv-ustring.h"
#include "common/nmv-safe-ptr-utils.h"
-using nemiver::common::UString ;
+using nemiver::common::UString;
using nemiver::common::SafePtr;
NEMIVER_BEGIN_NAMESPACE (nemiver)
class PopupTip : public Gtk::Window {
//non copyable
- PopupTip (const PopupTip&) ;
- PopupTip& operator= (const PopupTip&) ;
- class Priv ;
- SafePtr<Priv> m_priv ;
+ PopupTip (const PopupTip&);
+ PopupTip& operator= (const PopupTip&);
+ class Priv;
+ SafePtr<Priv> m_priv;
public:
- PopupTip (const UString &a_text="") ;
+ PopupTip (const UString &a_text="");
virtual ~PopupTip ();
- void text (const UString &) ;
- UString text () const ;
+ void text (const UString &);
+ UString text () const;
void set_child (Gtk::Widget &a_widget);
- void set_show_position (int a_x, int a_y) ;
- void show () ;
- void show_all () ;
- void show_at_position (int a_x, int a_y) ;
+ void set_show_position (int a_x, int a_y);
+ void show ();
+ void show_all ();
+ void show_at_position (int a_x, int a_y);
};//end class PopupTip
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/uicommon/nmv-source-editor.cc b/src/uicommon/nmv-source-editor.cc
index 184260a..9e36276 100644
--- a/src/uicommon/nmv-source-editor.cc
+++ b/src/uicommon/nmv-source-editor.cc
@@ -40,7 +40,7 @@
#include "uicommon/nmv-ui-utils.h"
#include "nmv-source-editor.h"
-using namespace std ;
+using namespace std;
using namespace nemiver::common;
#ifdef WITH_SOURCEVIEWMM2
using gtksourceview::SourceMark;
@@ -60,14 +60,14 @@ const char* WHERE_MARK = "where-marker";
class SourceView : public gtksourceview::SourceView {
- sigc::signal<void, int, bool> m_marker_region_got_clicked_signal ;
+ sigc::signal<void, int, bool> m_marker_region_got_clicked_signal;
public:
SourceView (Glib::RefPtr<SourceBuffer> &a_buf) :
gtksourceview::SourceView (a_buf)
{
init_font ();
- enable_events () ;
+ enable_events ();
}
SourceView () :
@@ -85,36 +85,36 @@ public:
void enable_events ()
{
add_events (Gdk::LEAVE_NOTIFY_MASK
- |Gdk::BUTTON_PRESS_MASK) ;
+ |Gdk::BUTTON_PRESS_MASK);
}
void do_custom_button_press_event_handling (GdkEventButton *a_event)
{
- THROW_IF_FAIL (a_event) ;
+ THROW_IF_FAIL (a_event);
if (a_event->type == GDK_BUTTON_PRESS && a_event->button != 1) {
- return ;
+ return;
}
Glib::RefPtr<Gdk::Window> markers_window =
- get_window (Gtk::TEXT_WINDOW_LEFT) ;
- THROW_IF_FAIL (markers_window) ;
+ get_window (Gtk::TEXT_WINDOW_LEFT);
+ THROW_IF_FAIL (markers_window);
if (markers_window.operator->()->gobj () != a_event->window) {
- LOG_DD ("didn't clicked in markers region") ;
- return ;
+ LOG_DD ("didn't clicked in markers region");
+ return;
}
- LOG_DD ("got clicked in markers region !") ;
- Gtk::TextBuffer::iterator iter ;
- int line_top=0, x=0, y=0 ;
+ LOG_DD ("got clicked in markers region !");
+ Gtk::TextBuffer::iterator iter;
+ int line_top=0, x=0, y=0;
window_to_buffer_coords (Gtk::TEXT_WINDOW_LEFT,
- (int)a_event->x, (int)a_event->y, x, y) ;
+ (int)a_event->x, (int)a_event->y, x, y);
- get_line_at_y (iter, (int) y, line_top) ;
+ get_line_at_y (iter, (int) y, line_top);
- THROW_IF_FAIL (iter) ;
+ THROW_IF_FAIL (iter);
- LOG_DD ("got clicked on line: " << iter.get_line ()) ;
+ LOG_DD ("got clicked on line: " << iter.get_line ());
marker_region_got_clicked_signal ().emit (iter.get_line (),
false/*no dialog requested*/);
}
@@ -122,54 +122,54 @@ public:
bool on_button_press_event (GdkEventButton *a_event)
{
if (a_event->type == GDK_BUTTON_PRESS && a_event->button == 3) {
- return false ;
+ return false;
} else {
- Gtk::Widget::on_button_press_event (a_event) ;
- do_custom_button_press_event_handling (a_event) ;
- return false ;
+ Gtk::Widget::on_button_press_event (a_event);
+ do_custom_button_press_event_handling (a_event);
+ return false;
}
}
sigc::signal<void, int, bool>& marker_region_got_clicked_signal ()
{
- return m_marker_region_got_clicked_signal ;
+ return m_marker_region_got_clicked_signal;
}
};//end class Sourceview
struct SourceEditor::Priv {
- Sequence sequence ;
+ Sequence sequence;
#ifdef WITH_SOURCEVIEWMM2
- std::map<int, Glib::RefPtr<gtksourceview::SourceMark> > markers ;
+ std::map<int, Glib::RefPtr<gtksourceview::SourceMark> > markers;
#else
- std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> > markers ;
+ std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> > markers;
#endif // WITH_SOURCEVIEWMM2
- UString root_dir ;
- gint current_column ;
- gint current_line ;
- nemiver::SourceView *source_view ;
- Gtk::HBox *status_box ;
- Gtk::Label *line_col_label ;
+ UString root_dir;
+ gint current_column;
+ gint current_line;
+ nemiver::SourceView *source_view;
+ Gtk::HBox *status_box;
+ Gtk::Label *line_col_label;
Gtk::Label *line_count;
- sigc::signal<void, gint, gint> signal_insertion_moved ;
- sigc::signal<void, int, bool> marker_region_got_clicked_signal ;
+ sigc::signal<void, gint, gint> signal_insertion_moved;
+ sigc::signal<void, int, bool> marker_region_got_clicked_signal;
sigc::signal<void, const Gtk::TextBuffer::iterator&>
insertion_changed_signal;
- UString path ;
+ UString path;
//**************
//<signal slots>
//**************
void on_marker_region_got_clicked (int a_line, bool a_dialog_requested)
{
- marker_region_got_clicked_signal.emit (a_line, a_dialog_requested) ;
+ marker_region_got_clicked_signal.emit (a_line, a_dialog_requested);
}
void on_mark_set_signal (const Gtk::TextBuffer::iterator &a_iter,
const Glib::RefPtr<Gtk::TextBuffer::Mark> &a_mark)
{
if (a_mark->get_name () == "insert") {
- update_line_col_info_from_iter (a_iter) ;
+ update_line_col_info_from_iter (a_iter);
}
}
@@ -178,14 +178,14 @@ struct SourceEditor::Priv {
int a_unknown)
{
if (a_text == "" || a_unknown) {}
- update_line_col_info_from_iter (a_iter) ;
+ update_line_col_info_from_iter (a_iter);
}
void on_signal_insertion_moved (gint a_line, gint a_col)
{
if (a_line || a_col) {}
- current_line = a_line ;
- current_column = a_col ;
+ current_line = a_line;
+ current_column = a_col;
update_line_col_label ();
}
@@ -194,12 +194,12 @@ struct SourceEditor::Priv {
const Glib::RefPtr<Gtk::TextBuffer::Mark > &a_mark)
{
NEMIVER_TRY
- THROW_IF_FAIL (source_view) ;
+ THROW_IF_FAIL (source_view);
Glib::RefPtr<Gtk::TextBuffer::Mark> insert_mark =
source_view->get_buffer ()->get_insert ();
if (insert_mark == a_mark) {
- insertion_changed_signal.emit (a_iter) ;
+ insertion_changed_signal.emit (a_iter);
}
NEMIVER_CATCH
}
@@ -212,34 +212,34 @@ struct SourceEditor::Priv {
{
source_view->marker_region_got_clicked_signal ().connect
(sigc::mem_fun (*this,
- &SourceEditor::Priv::on_marker_region_got_clicked)) ;
+ &SourceEditor::Priv::on_marker_region_got_clicked));
source_view->get_buffer ()->signal_mark_set ().connect
- (sigc::mem_fun (*this, &SourceEditor::Priv::on_mark_set_signal)) ;
+ (sigc::mem_fun (*this, &SourceEditor::Priv::on_mark_set_signal));
source_view->get_buffer ()->signal_insert ().connect
- (sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_insert)) ;
+ (sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_insert));
signal_insertion_moved.connect
(sigc::mem_fun (*this,
- &SourceEditor::Priv::on_signal_insertion_moved)) ;
+ &SourceEditor::Priv::on_signal_insertion_moved));
source_view->get_buffer ()->signal_mark_set ().connect
- (sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_mark_set)) ;
+ (sigc::mem_fun (*this, &SourceEditor::Priv::on_signal_mark_set));
}
void update_line_col_info_from_iter (const Gtk::TextBuffer::iterator &a_iter)
{
current_line = a_iter.get_line () + 1;
- current_column = get_column_from_iter (a_iter) ;
- signal_insertion_moved.emit (current_line, current_column) ;
+ current_column = get_column_from_iter (a_iter);
+ signal_insertion_moved.emit (current_line, current_column);
}
void update_line_col_label ()
{
- gint line_count = 0 ;
+ gint line_count = 0;
if (source_view && source_view->get_buffer ()) {
- line_count = source_view->get_buffer ()->get_line_count () ;
+ line_count = source_view->get_buffer ()->get_line_count ();
}
UString message;
message.printf (_("Line: %i, Column: %i"),
- current_line, current_column) ;
+ current_line, current_column);
line_col_label->set_text (message);
}
@@ -251,45 +251,45 @@ struct SourceEditor::Priv {
bool get_absolute_resource_path (const UString &a_relative_path,
string &a_absolute_path)
{
- bool result (false) ;
+ bool result (false);
string absolute_path =
Glib::build_filename (Glib::locale_from_utf8 (root_dir),
- a_relative_path) ;
+ a_relative_path);
if (Glib::file_test (absolute_path,
Glib::FILE_TEST_IS_REGULAR
| Glib::FILE_TEST_EXISTS)) {
result = true;
- a_absolute_path = absolute_path ;
+ a_absolute_path = absolute_path;
} else {
- LOG ("could not find file: " << a_absolute_path) ;
+ LOG ("could not find file: " << a_absolute_path);
}
- return result ;
+ return result;
}
void register_breakpoint_marker_type (const UString &a_name,
const UString &a_image)
{
- string path ;
+ string path;
if (!get_absolute_resource_path (a_image,
path)) {
- THROW ("could not get path to " + a_image) ;
+ THROW ("could not get path to " + a_image);
}
Glib::RefPtr<Gdk::Pixbuf> bm_pixbuf =
- Gdk::Pixbuf::create_from_file (path) ;
+ Gdk::Pixbuf::create_from_file (path);
#ifdef WITH_SOURCEVIEWMM2
- source_view->set_mark_category_pixbuf (a_name, bm_pixbuf) ;
+ source_view->set_mark_category_pixbuf (a_name, bm_pixbuf);
source_view->set_mark_category_priority (a_name, 0);
#else
- source_view->set_marker_pixbuf (a_name, bm_pixbuf) ;
+ source_view->set_marker_pixbuf (a_name, bm_pixbuf);
#endif // WITH_SOURCEVIEWMM2
}
void init ()
{
- status_box->pack_end (*line_col_label, Gtk::PACK_SHRINK, 6 /* padding */) ;
- init_signals () ;
- source_view->set_editable (false) ;
+ status_box->pack_end (*line_col_label, Gtk::PACK_SHRINK, 6 /* padding */);
+ init_signals ();
+ source_view->set_editable (false);
register_breakpoint_marker_type (BREAKPOINT_ENABLED_CATEGORY,
"icons/breakpoint-marker.png");
register_breakpoint_marker_type
@@ -309,7 +309,7 @@ struct SourceEditor::Priv {
line_col_label (Gtk::manage (new Gtk::Label ()))
{
- init () ;
+ init ();
}
Priv (const UString &a_root_dir,
@@ -321,7 +321,7 @@ struct SourceEditor::Priv {
status_box (Gtk::manage (new Gtk::HBox)),
line_col_label (Gtk::manage (new Gtk::Label ()))
{
- init () ;
+ init ();
}
};//end class SourceEditor
@@ -329,61 +329,61 @@ void
SourceEditor::init ()
{
Gtk::ScrolledWindow *scrolled (Gtk::manage (new Gtk::ScrolledWindow));
- scrolled->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) ;
- scrolled->add (*m_priv->source_view) ;
- scrolled->show_all () ;
+ scrolled->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+ scrolled->add (*m_priv->source_view);
+ scrolled->show_all ();
scrolled->set_shadow_type (Gtk::SHADOW_IN);
- pack_start (*scrolled) ;
- pack_end (*m_priv->status_box, Gtk::PACK_SHRINK) ;
+ pack_start (*scrolled);
+ pack_end (*m_priv->status_box, Gtk::PACK_SHRINK);
//****************************
//set line pointer pixbuf
//****************************
- string path = "" ;
+ string path = "";
if (!m_priv->get_absolute_resource_path ("icons/line-pointer.png", path)) {
- THROW ("could not get path to line-pointer.png") ;
+ THROW ("could not get path to line-pointer.png");
}
- Glib::RefPtr<Gdk::Pixbuf> lp_pixbuf = Gdk::Pixbuf::create_from_file (path) ;
+ Glib::RefPtr<Gdk::Pixbuf> lp_pixbuf = Gdk::Pixbuf::create_from_file (path);
#ifdef WITH_SOURCEVIEWMM2
- source_view ().set_mark_category_pixbuf (WHERE_CATEGORY, lp_pixbuf) ;
+ source_view ().set_mark_category_pixbuf (WHERE_CATEGORY, lp_pixbuf);
// show this on top
source_view ().set_mark_category_priority (WHERE_CATEGORY, 100);
- source_view ().set_show_line_marks (true) ;
+ source_view ().set_show_line_marks (true);
#else
- source_view ().set_marker_pixbuf (WHERE_CATEGORY, lp_pixbuf) ;
- source_view ().set_show_line_markers (true) ;
+ source_view ().set_marker_pixbuf (WHERE_CATEGORY, lp_pixbuf);
+ source_view ().set_show_line_markers (true);
#endif // WITH_SOURCEVIEWMM2
}
SourceEditor::SourceEditor ()
{
- m_priv.reset (new Priv) ;
- init () ;
+ m_priv.reset (new Priv);
+ init ();
}
SourceEditor::SourceEditor (const UString &a_root_dir,
Glib::RefPtr<SourceBuffer> &a_buf)
{
- m_priv.reset (new Priv (a_root_dir, a_buf)) ;
- init () ;
+ m_priv.reset (new Priv (a_root_dir, a_buf));
+ init ();
}
SourceEditor::~SourceEditor ()
{
- LOG_D ("deleted", "destructor-domain") ;
+ LOG_D ("deleted", "destructor-domain");
}
gtksourceview::SourceView&
SourceEditor::source_view () const
{
- THROW_IF_FAIL (m_priv && m_priv->source_view) ;
- return *m_priv->source_view ;
+ THROW_IF_FAIL (m_priv && m_priv->source_view);
+ return *m_priv->source_view;
}
gint
SourceEditor::current_line () const
{
- return m_priv->current_line ;
+ return m_priv->current_line;
}
void
@@ -395,14 +395,14 @@ SourceEditor::current_line (gint &a_line)
gint
SourceEditor::current_column () const
{
- return m_priv->current_column ;
+ return m_priv->current_column;
}
void
SourceEditor::current_column (gint &a_col)
{
- LOG_DD ("current colnum " << (int) a_col) ;
- m_priv->current_column = a_col ;
+ LOG_DD ("current colnum " << (int) a_col);
+ m_priv->current_column = a_col;
}
void
@@ -410,18 +410,18 @@ SourceEditor::move_where_marker_to_line (int a_line, bool a_do_scroll)
{
LOG_DD ("a_line: " << a_line);
- THROW_IF_FAIL (a_line >= 0) ;
+ THROW_IF_FAIL (a_line >= 0);
Gtk::TextIter line_iter =
- source_view ().get_source_buffer ()->get_iter_at_line (a_line - 1) ;
- THROW_IF_FAIL (line_iter) ;
+ source_view ().get_source_buffer ()->get_iter_at_line (a_line - 1);
+ THROW_IF_FAIL (line_iter);
#ifdef WITH_SOURCEVIEWMM2
Glib::RefPtr<Gtk::TextMark> where_marker =
- source_view ().get_source_buffer ()->get_mark (WHERE_MARK) ;
+ source_view ().get_source_buffer ()->get_mark (WHERE_MARK);
#else
Glib::RefPtr<gtksourceview::SourceMarker> where_marker =
- source_view ().get_source_buffer ()->get_marker (WHERE_MARK) ;
+ source_view ().get_source_buffer ()->get_marker (WHERE_MARK);
#endif // WITH_SOURCEVIEWMM2
if (!where_marker) {
#ifdef WITH_SOURCEVIEWMM2
@@ -433,19 +433,19 @@ SourceEditor::move_where_marker_to_line (int a_line, bool a_do_scroll)
#endif // WITH_SOURCEVIEWMM2
(WHERE_MARK,
WHERE_CATEGORY,
- line_iter) ;
- THROW_IF_FAIL (where_marker) ;
+ line_iter);
+ THROW_IF_FAIL (where_marker);
} else {
#ifdef WITH_SOURCEVIEWMM2
source_view ().get_source_buffer ()->move_mark (where_marker,
- line_iter) ;
+ line_iter);
#else
source_view ().get_source_buffer ()->move_marker (where_marker,
- line_iter) ;
+ line_iter);
#endif // WITH_SOURCEVIEWMM2
}
if (a_do_scroll) {
- scroll_to_line (a_line) ;
+ scroll_to_line (a_line);
}
}
@@ -455,16 +455,16 @@ SourceEditor::unset_where_marker ()
{
#ifdef WITH_SOURCEVIEWMM2
Glib::RefPtr<Gtk::TextMark> where_marker =
- source_view ().get_source_buffer ()->get_mark (WHERE_MARK) ;
+ source_view ().get_source_buffer ()->get_mark (WHERE_MARK);
#else
Glib::RefPtr<gtksourceview::SourceMarker> where_marker =
- source_view ().get_source_buffer ()->get_marker (WHERE_MARK) ;
+ source_view ().get_source_buffer ()->get_marker (WHERE_MARK);
#endif // WITH_SOURCEVIEWMM2
if (where_marker && !where_marker->get_deleted ()) {
#ifdef WITH_SOURCEVIEWMM2
- source_view ().get_source_buffer ()->delete_mark (where_marker) ;
+ source_view ().get_source_buffer ()->delete_mark (where_marker);
#else
- source_view ().get_source_buffer ()->delete_marker (where_marker) ;
+ source_view ().get_source_buffer ()->delete_marker (where_marker);
#endif // WITH_SOURCEVIEWMM2
}
}
@@ -492,7 +492,7 @@ SourceEditor::set_visual_breakpoint_at_line (int a_line, bool enabled)
m_priv->markers.find (a_line);
if (mark_iter != m_priv->markers.end ()) {
if (!mark_iter->second->get_deleted ()) {
- LOG_DD ("deleting marker") ;
+ LOG_DD ("deleting marker");
#ifdef WITH_SOURCEVIEWMM2
source_view ().get_source_buffer ()->delete_mark
#else
@@ -504,12 +504,12 @@ SourceEditor::set_visual_breakpoint_at_line (int a_line, bool enabled)
}
// marker doesn't yet exist, so create one of the correct type
Gtk::TextIter iter =
- source_view ().get_source_buffer ()->get_iter_at_line (a_line) ;
+ source_view ().get_source_buffer ()->get_iter_at_line (a_line);
LOG_DD ("a_line: " << a_line);
- THROW_IF_FAIL (iter) ;
+ THROW_IF_FAIL (iter);
UString marker_name = UString::from_int (a_line);
- LOG_DD ("creating marker of type: " << marker_type) ;
+ LOG_DD ("creating marker of type: " << marker_type);
#ifdef WITH_SOURCEVIEWMM2
Glib::RefPtr<gtksourceview::SourceMark> marker =
source_view ().get_source_buffer ()->create_source_mark
@@ -517,49 +517,49 @@ SourceEditor::set_visual_breakpoint_at_line (int a_line, bool enabled)
Glib::RefPtr<gtksourceview::SourceMarker> marker =
source_view ().get_source_buffer ()->create_marker
#endif // WITH_SOURCEVIEWMM2
- (marker_name, marker_type, iter) ;
- m_priv->markers[a_line] = marker ;
+ (marker_name, marker_type, iter);
+ m_priv->markers[a_line] = marker;
}
void
SourceEditor::remove_visual_breakpoint_from_line (int a_line)
{
#ifdef WITH_SOURCEVIEWMM2
- std::map<int, Glib::RefPtr<gtksourceview::SourceMark> >::iterator iter ;
+ std::map<int, Glib::RefPtr<gtksourceview::SourceMark> >::iterator iter;
#else
- std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> >::iterator iter ;
+ std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> >::iterator iter;
#endif // WITH_SOURCEVIEWMM2
- iter = m_priv->markers.find (a_line) ;
+ iter = m_priv->markers.find (a_line);
if (iter == m_priv->markers.end ()) {
- return ;
+ return;
}
if (!iter->second->get_deleted ())
#ifdef WITH_SOURCEVIEWMM2
- source_view ().get_source_buffer ()->delete_mark (iter->second) ;
+ source_view ().get_source_buffer ()->delete_mark (iter->second);
#else
- source_view ().get_source_buffer ()->delete_marker (iter->second) ;
+ source_view ().get_source_buffer ()->delete_marker (iter->second);
#endif // WITH_SOURCEVIEWMM2
- m_priv->markers.erase (iter) ;
+ m_priv->markers.erase (iter);
}
bool
SourceEditor::is_visual_breakpoint_set_at_line (int a_line) const
{
#ifdef WITH_SOURCEVIEWMM2
- std::map<int, Glib::RefPtr<gtksourceview::SourceMark> >::iterator iter ;
+ std::map<int, Glib::RefPtr<gtksourceview::SourceMark> >::iterator iter;
#else
- std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> >::iterator iter ;
+ std::map<int, Glib::RefPtr<gtksourceview::SourceMarker> >::iterator iter;
#endif // WITH_SOURCEVIEWMM2
- iter = m_priv->markers.find (a_line) ;
+ iter = m_priv->markers.find (a_line);
if (iter == m_priv->markers.end ()) {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
struct ScrollToLine {
- int m_line ;
- SourceView *m_source_view ;
+ int m_line;
+ SourceView *m_source_view;
ScrollToLine () :
m_line (0),
@@ -575,65 +575,65 @@ struct ScrollToLine {
bool do_scroll ()
{
if (!m_source_view) {return false;}
- Gtk::TextIter iter = m_source_view->get_buffer ()->get_iter_at_line (m_line) ;
+ Gtk::TextIter iter = m_source_view->get_buffer ()->get_iter_at_line (m_line);
if (!iter) {return false;}
- m_source_view->scroll_to (iter, 0.1) ;
- return false ;
+ m_source_view->scroll_to (iter, 0.1);
+ return false;
}
};
void
SourceEditor::scroll_to_line (int a_line)
{
- static ScrollToLine s_scroll_functor ;
- s_scroll_functor.m_line = a_line ;
- s_scroll_functor.m_source_view = m_priv->source_view ;
+ static ScrollToLine s_scroll_functor;
+ s_scroll_functor.m_line = a_line;
+ s_scroll_functor.m_source_view = m_priv->source_view;
Glib::signal_idle ().connect (sigc::mem_fun (s_scroll_functor,
- &ScrollToLine::do_scroll)) ;
+ &ScrollToLine::do_scroll));
}
void
SourceEditor::scroll_to_iter (Gtk::TextIter &a_iter)
{
if (!a_iter) {
- LOG_DD ("iter points at end of buffer") ;
- return ;
+ LOG_DD ("iter points at end of buffer");
+ return;
}
- static ScrollToLine s_scroll_functor ;
+ static ScrollToLine s_scroll_functor;
s_scroll_functor.m_line = a_iter.get_line ();
- s_scroll_functor.m_source_view = m_priv->source_view ;
+ s_scroll_functor.m_source_view = m_priv->source_view;
Glib::signal_idle ().connect (sigc::mem_fun (s_scroll_functor,
- &ScrollToLine::do_scroll)) ;
+ &ScrollToLine::do_scroll));
}
void
SourceEditor::set_path (const UString &a_path)
{
- m_priv->path = a_path ;
+ m_priv->path = a_path;
}
void
SourceEditor::get_path (UString &a_path) const
{
- a_path = m_priv->path ;
+ a_path = m_priv->path;
}
void
SourceEditor::get_file_name (UString &a_file_name)
{
- string path ;
- path = Glib::locale_from_utf8 (m_priv->path) ;
- path = Glib::path_get_basename (path) ;
- a_file_name = Glib::locale_to_utf8 (path) ;
+ string path;
+ path = Glib::locale_from_utf8 (m_priv->path);
+ path = Glib::path_get_basename (path);
+ a_file_name = Glib::locale_to_utf8 (path);
}
bool
is_word_delimiter (gunichar a_char)
{
if (!isalnum (a_char) && a_char != '_') {
- return true ;
+ return true;
}
- return false ;
+ return false;
}
bool
@@ -645,16 +645,16 @@ SourceEditor::get_word_at_position (int a_x,
{
LOG_FUNCTION_SCOPE_NORMAL_DD
- THROW_IF_FAIL (m_priv) ;
- int buffer_x=0, buffer_y=0 ;
+ THROW_IF_FAIL (m_priv);
+ int buffer_x=0, buffer_y=0;
source_view ().window_to_buffer_coords (Gtk::TEXT_WINDOW_TEXT,
(int)a_x,
(int)a_y,
- buffer_x, buffer_y) ;
- Gtk::TextBuffer::iterator clicked_at_iter ;
- source_view ().get_iter_at_location (clicked_at_iter, buffer_x, buffer_y) ;
+ buffer_x, buffer_y);
+ Gtk::TextBuffer::iterator clicked_at_iter;
+ source_view ().get_iter_at_location (clicked_at_iter, buffer_x, buffer_y);
if (!clicked_at_iter) {
- return false ;
+ return false;
}
//go find the first white word delimiter before clicked_at_iter
@@ -663,37 +663,37 @@ SourceEditor::get_word_at_position (int a_x,
while (cur_iter.backward_char ()
&& !is_word_delimiter (cur_iter.get_char ())) {}
- THROW_IF_FAIL (cur_iter.forward_char ()) ;
- Gtk::TextBuffer::iterator start_word_iter = cur_iter ;
+ THROW_IF_FAIL (cur_iter.forward_char ());
+ Gtk::TextBuffer::iterator start_word_iter = cur_iter;
//go find the first word delimiter after clicked_at_iter
- cur_iter = clicked_at_iter ;
+ cur_iter = clicked_at_iter;
while (cur_iter.forward_char ()
&& !is_word_delimiter (cur_iter.get_char ())) {}
- Gtk::TextBuffer::iterator end_word_iter = cur_iter ;
+ Gtk::TextBuffer::iterator end_word_iter = cur_iter;
UString var_name = start_word_iter.get_slice (end_word_iter);
while (var_name != "" && !isalpha (var_name[0]) && var_name[0] != '_') {
- var_name.erase (0, 1) ;
+ var_name.erase (0, 1);
}
while (var_name != ""
&& !isalnum (var_name[var_name.size () - 1])
&& var_name[var_name.size () - 1] != '_') {
- var_name.erase (var_name.size () - 1, 1) ;
+ var_name.erase (var_name.size () - 1, 1);
}
- Gdk::Rectangle start_rect, end_rect ;
- source_view ().get_iter_location (start_word_iter, start_rect) ;
- source_view ().get_iter_location (end_word_iter, end_rect) ;
+ Gdk::Rectangle start_rect, end_rect;
+ source_view ().get_iter_location (start_word_iter, start_rect);
+ source_view ().get_iter_location (end_word_iter, end_rect);
if (!(start_rect.get_x () <= buffer_x) || !(buffer_x <= end_rect.get_x ())) {
- LOG_DD ("mouse not really on word: '" << var_name << "'") ;
- return false ;
- }
- LOG_DD ("got variable candidate name: '" << var_name << "'") ;
- a_word = var_name ;
- a_start_rect = start_rect ;
- a_end_rect = end_rect ;
- return true ;
+ LOG_DD ("mouse not really on word: '" << var_name << "'");
+ return false;
+ }
+ LOG_DD ("got variable candidate name: '" << var_name << "'");
+ a_word = var_name;
+ a_start_rect = start_rect;
+ a_end_rect = end_rect;
+ return true;
}
bool
@@ -705,65 +705,65 @@ SourceEditor::do_search (const UString &a_str,
bool a_search_backwards,
bool a_clear_selection)
{
- Glib::RefPtr<SourceBuffer> source_buffer = source_view ().get_source_buffer () ;
- THROW_IF_FAIL (source_buffer) ;
+ Glib::RefPtr<SourceBuffer> source_buffer = source_view ().get_source_buffer ();
+ THROW_IF_FAIL (source_buffer);
if (a_clear_selection) {
source_buffer->select_range (source_buffer->end (),
- source_buffer->end ()) ;
+ source_buffer->end ());
}
- SourceIter search_iter, limit ;
+ SourceIter search_iter, limit;
if (a_search_backwards) {
- search_iter = source_buffer->end () ;
- search_iter-- ;
- limit = source_buffer->begin () ;
+ search_iter = source_buffer->end ();
+ search_iter--;
+ limit = source_buffer->begin ();
} else {
- search_iter = source_buffer->begin () ;
- limit = source_buffer->end () ;
- limit-- ;
+ search_iter = source_buffer->begin ();
+ limit = source_buffer->end ();
+ limit--;
}
- Gtk::TextIter start, end ;
+ Gtk::TextIter start, end;
if (source_buffer->get_selection_bounds (start, end)) {
if (a_search_backwards) {
- search_iter = start ;
+ search_iter = start;
} else {
- search_iter = end ;
+ search_iter = end;
}
}
//*********************
//build search flags
//**********************
- namespace gsv=gtksourceview ;
- gsv::SearchFlags search_flags = gsv::SEARCH_TEXT_ONLY ;
+ namespace gsv=gtksourceview;
+ gsv::SearchFlags search_flags = gsv::SEARCH_TEXT_ONLY;
if (!a_match_case) {
- search_flags |= gsv::SEARCH_CASE_INSENSITIVE ;
+ search_flags |= gsv::SEARCH_CASE_INSENSITIVE;
}
- bool found=false ;
+ bool found=false;
if (a_search_backwards) {
if (search_iter.backward_search (a_str, search_flags,
a_start, a_end, limit)) {
- found = true ;
+ found = true;
}
} else {
if (search_iter.forward_search (a_str, search_flags,
a_start, a_end, limit)) {
- found = true ;
+ found = true;
}
}
if (found && a_match_entire_word) {
- Gtk::TextIter iter = a_start ;
+ Gtk::TextIter iter = a_start;
if (iter.backward_char ()) {
if (!is_word_delimiter (*iter)) {
- found = false ;
+ found = false;
}
}
if (found) {
- iter = a_end ;
+ iter = a_end;
if (!is_word_delimiter (*iter)) {
found = false;
}
@@ -771,23 +771,23 @@ SourceEditor::do_search (const UString &a_str,
}
if (found) {
- source_buffer->select_range (a_start, a_end) ;
- scroll_to_iter (a_start) ;
- return true ;
+ source_buffer->select_range (a_start, a_end);
+ scroll_to_iter (a_start);
+ return true;
}
- return false ;
+ return false;
}
sigc::signal<void, int, bool>&
SourceEditor::marker_region_got_clicked_signal () const
{
- return m_priv->marker_region_got_clicked_signal ;
+ return m_priv->marker_region_got_clicked_signal;
}
sigc::signal<void, const Gtk::TextBuffer::iterator&>&
SourceEditor::insertion_changed_signal () const
{
- return m_priv->insertion_changed_signal ;
+ return m_priv->insertion_changed_signal;
}
}//end namespace nemiver
diff --git a/src/uicommon/nmv-source-editor.h b/src/uicommon/nmv-source-editor.h
index 1740c54..d860e6e 100644
--- a/src/uicommon/nmv-source-editor.h
+++ b/src/uicommon/nmv-source-editor.h
@@ -31,12 +31,12 @@
#include "common/nmv-safe-ptr-utils.h"
#include "common/nmv-ustring.h"
-using gtksourceview::SourceView ;
-using gtksourceview::SourceBuffer ;
-using Gtk::VBox ;
-using nemiver::common::SafePtr ;
-using nemiver::common::UString ;
-using std::list ;
+using gtksourceview::SourceView;
+using gtksourceview::SourceBuffer;
+using Gtk::VBox;
+using nemiver::common::SafePtr;
+using nemiver::common::UString;
+using std::list;
namespace nemiver {
@@ -49,39 +49,39 @@ extern const char* WHERE_MARK;
class SourceEditor : public VBox {
//non copyable
- SourceEditor (const SourceEditor&) ;
- SourceEditor& operator= (const SourceEditor&) ;
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ SourceEditor (const SourceEditor&);
+ SourceEditor& operator= (const SourceEditor&);
+ struct Priv;
+ SafePtr<Priv> m_priv;
- void init () ;
- SourceEditor () ;
+ void init ();
+ SourceEditor ();
public:
SourceEditor (const UString &a_root_dir,
- Glib::RefPtr<SourceBuffer> &a_buf) ;
- virtual ~SourceEditor () ;
- SourceView& source_view () const ;
- gint current_line () const ;
- void current_line (gint &a_line) ;
- gint current_column () const ;
- void current_column (gint &a_col) ;
- void move_where_marker_to_line (int a_line, bool a_do_scroll=true) ;
- void unset_where_marker () ;
- void set_visual_breakpoint_at_line (int a_line, bool enabled=true) ;
- void remove_visual_breakpoint_from_line (int a_line) ;
- bool is_visual_breakpoint_set_at_line (int a_line) const ;
- void scroll_to_line (int a_line) ;
- void scroll_to_iter (Gtk::TextIter &a_iter) ;
- void set_path (const UString &a_path) ;
- void get_path (UString &a_path) const ;
- void get_file_name (UString &a_file_name) ;
+ Glib::RefPtr<SourceBuffer> &a_buf);
+ virtual ~SourceEditor ();
+ SourceView& source_view () const;
+ gint current_line () const;
+ void current_line (gint &a_line);
+ gint current_column () const;
+ void current_column (gint &a_col);
+ void move_where_marker_to_line (int a_line, bool a_do_scroll=true);
+ void unset_where_marker ();
+ void set_visual_breakpoint_at_line (int a_line, bool enabled=true);
+ void remove_visual_breakpoint_from_line (int a_line);
+ bool is_visual_breakpoint_set_at_line (int a_line) const;
+ void scroll_to_line (int a_line);
+ void scroll_to_iter (Gtk::TextIter &a_iter);
+ void set_path (const UString &a_path);
+ void get_path (UString &a_path) const;
+ void get_file_name (UString &a_file_name);
bool get_word_at_position (int a_x,
int a_y,
UString &a_word,
Gdk::Rectangle &a_start_rect,
- Gdk::Rectangle &a_end_rect) const ;
+ Gdk::Rectangle &a_end_rect) const;
bool do_search (const UString &a_str,
Gtk::TextIter &a_start,
@@ -89,16 +89,16 @@ public:
bool a_match_case=false,
bool a_match_entire_word=false,
bool a_search_backwards=false,
- bool a_clear_selection=false) ;
+ bool a_clear_selection=false);
/// \name signals
/// @{
sigc::signal<void,
int/*line clicked*/,
bool/*dialog requested*/>&
- marker_region_got_clicked_signal () const ;
+ marker_region_got_clicked_signal () const;
sigc::signal<void, const Gtk::TextBuffer::iterator&>&
- insertion_changed_signal () const ;
+ insertion_changed_signal () const;
/// @}
};//end class SourceEditor
diff --git a/src/uicommon/nmv-spinner-tool-item.cc b/src/uicommon/nmv-spinner-tool-item.cc
index 7e9aa4b..1b6f24e 100644
--- a/src/uicommon/nmv-spinner-tool-item.cc
+++ b/src/uicommon/nmv-spinner-tool-item.cc
@@ -32,9 +32,9 @@ struct ESpinnerRef {
void operator () (EphySpinnerToolItem *o)
{
if (o && G_IS_OBJECT (o)) {
- g_object_ref (G_OBJECT (o)) ;
+ g_object_ref (G_OBJECT (o));
} else {
- LOG_ERROR ("bad ephy spinner") ;
+ LOG_ERROR ("bad ephy spinner");
}
}
};
@@ -43,33 +43,33 @@ struct ESpinnerUnref {
void operator () (EphySpinnerToolItem *o)
{
if (o && G_IS_OBJECT (o)) {
- g_object_unref (G_OBJECT (o)) ;
+ g_object_unref (G_OBJECT (o));
} else {
- LOG_ERROR ("bad ephy spinner") ;
+ LOG_ERROR ("bad ephy spinner");
}
}
};
struct SpinnerToolItem::Priv {
- SafePtr<EphySpinnerToolItem, ESpinnerRef, ESpinnerUnref> spinner ;
- bool is_started ;
- Gtk::ToolItem *widget ;
+ SafePtr<EphySpinnerToolItem, ESpinnerRef, ESpinnerUnref> spinner;
+ bool is_started;
+ Gtk::ToolItem *widget;
Priv () :
spinner (EPHY_SPINNER_TOOL_ITEM (ephy_spinner_tool_item_new ()), true),
is_started (false),
widget (0)
{
- THROW_IF_FAIL (GTK_IS_WIDGET (spinner.get ())) ;
- widget = Glib::wrap (GTK_TOOL_ITEM (spinner.get ())) ;
- THROW_IF_FAIL (widget) ;
+ THROW_IF_FAIL (GTK_IS_WIDGET (spinner.get ()));
+ widget = Glib::wrap (GTK_TOOL_ITEM (spinner.get ()));
+ THROW_IF_FAIL (widget);
}
~Priv ()
{
- widget = 0 ;
- is_started = false ;
+ widget = 0;
+ is_started = false;
}
};//end struct SpinnerToolItem::Priv
@@ -79,62 +79,62 @@ SpinnerToolItem::~SpinnerToolItem ()
SpinnerToolItem::SpinnerToolItem ()
{
- m_priv.reset (new Priv) ;
+ m_priv.reset (new Priv);
}
SpinnerToolItemSafePtr
SpinnerToolItem::create ()
{
- SpinnerToolItemSafePtr result (new SpinnerToolItem) ;
- THROW_IF_FAIL (result) ;
- return result ;
+ SpinnerToolItemSafePtr result (new SpinnerToolItem);
+ THROW_IF_FAIL (result);
+ return result;
}
void
SpinnerToolItem::start ()
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->spinner) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->spinner);
- ephy_spinner_tool_item_set_spinning (m_priv->spinner.get (), true) ;
- m_priv->is_started = true ;
+ ephy_spinner_tool_item_set_spinning (m_priv->spinner.get (), true);
+ m_priv->is_started = true;
}
bool
SpinnerToolItem::is_started () const
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->spinner) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->spinner);
- return m_priv->is_started ;
+ return m_priv->is_started ;
}
void
SpinnerToolItem::stop ()
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->spinner) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->spinner);
- ephy_spinner_tool_item_set_spinning (m_priv->spinner.get (), false) ;
- m_priv->is_started = false ;
+ ephy_spinner_tool_item_set_spinning (m_priv->spinner.get (), false);
+ m_priv->is_started = false;
}
void
SpinnerToolItem::toggle_state ()
{
if (is_started ()) {
- stop () ;
+ stop ();
} else {
- start () ;
+ start ();
}
}
Gtk::ToolItem&
SpinnerToolItem::get_widget () const
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->widget) ;
- return *m_priv->widget ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->widget);
+ return *m_priv->widget;
}
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/uicommon/nmv-spinner-tool-item.h b/src/uicommon/nmv-spinner-tool-item.h
index 43b4523..2e650e3 100644
--- a/src/uicommon/nmv-spinner-tool-item.h
+++ b/src/uicommon/nmv-spinner-tool-item.h
@@ -29,32 +29,32 @@
#include "common/nmv-safe-ptr-utils.h"
namespace Gtk {
- class ToolItem ;
+ class ToolItem;
}
NEMIVER_BEGIN_NAMESPACE (nemiver)
-using nemiver::common::SafePtr ;
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::Object ;
+using nemiver::common::SafePtr;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::Object;
-class SpinnerToolItem ;
-typedef SafePtr<SpinnerToolItem, ObjectRef, ObjectUnref> SpinnerToolItemSafePtr ;
+class SpinnerToolItem;
+typedef SafePtr<SpinnerToolItem, ObjectRef, ObjectUnref> SpinnerToolItemSafePtr;
class SpinnerToolItem : public Object {
- struct Priv ;
- SafePtr<Priv> m_priv ;
- SpinnerToolItem () ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
+ SpinnerToolItem ();
public:
- virtual ~SpinnerToolItem () ;
- static SpinnerToolItemSafePtr create () ;
- void start () ;
- bool is_started () const ;
- void stop () ;
- void toggle_state () ;
- Gtk::ToolItem& get_widget () const ;
+ virtual ~SpinnerToolItem () ;
+ static SpinnerToolItemSafePtr create ();
+ void start ();
+ bool is_started () const;
+ void stop ();
+ void toggle_state ();
+ Gtk::ToolItem& get_widget () const;
};//end class SpinnerToolItem
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/uicommon/nmv-spinner.cc b/src/uicommon/nmv-spinner.cc
index 7fad243..e47fa6e 100644
--- a/src/uicommon/nmv-spinner.cc
+++ b/src/uicommon/nmv-spinner.cc
@@ -33,9 +33,9 @@ struct ESpinnerRef {
void operator () (EphySpinner *o)
{
if (o && G_IS_OBJECT (o)) {
- g_object_ref (G_OBJECT (o)) ;
+ g_object_ref (G_OBJECT (o));
} else {
- LOG_ERROR ("bad ephy spinner") ;
+ LOG_ERROR ("bad ephy spinner");
}
}
};
@@ -44,33 +44,33 @@ struct ESpinnerUnref {
void operator () (EphySpinner *o)
{
if (o && G_IS_OBJECT (o)) {
- g_object_unref (G_OBJECT (o)) ;
+ g_object_unref (G_OBJECT (o));
} else {
- LOG_ERROR ("bad ephy spinner") ;
+ LOG_ERROR ("bad ephy spinner");
}
}
};
struct Spinner::Priv {
- SafePtr<EphySpinner, ESpinnerRef, ESpinnerUnref> spinner ;
- bool is_started ;
- Gtk::Widget *widget ;
+ SafePtr<EphySpinner, ESpinnerRef, ESpinnerUnref> spinner;
+ bool is_started;
+ Gtk::Widget *widget;
Priv () :
spinner (EPHY_SPINNER (ephy_spinner_new ()), true),
is_started (false),
widget (0)
{
- THROW_IF_FAIL (GTK_IS_WIDGET (spinner.get ())) ;
- widget = Glib::wrap (GTK_WIDGET (spinner.get ())) ;
- THROW_IF_FAIL (widget) ;
+ THROW_IF_FAIL (GTK_IS_WIDGET (spinner.get ()));
+ widget = Glib::wrap (GTK_WIDGET (spinner.get ()));
+ THROW_IF_FAIL (widget);
}
~Priv ()
{
- widget = 0 ;
- is_started = false ;
+ widget = 0;
+ is_started = false;
}
};//end struct Spinner::Priv
@@ -80,62 +80,62 @@ Spinner::~Spinner ()
Spinner::Spinner ()
{
- m_priv.reset (new Priv) ;
+ m_priv.reset (new Priv);
}
SpinnerSafePtr
Spinner::create ()
{
- SpinnerSafePtr result (new Spinner) ;
- THROW_IF_FAIL (result) ;
- return result ;
+ SpinnerSafePtr result (new Spinner);
+ THROW_IF_FAIL (result);
+ return result;
}
void
Spinner::start ()
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->spinner) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->spinner);
- ephy_spinner_start (m_priv->spinner.get ()) ;
- m_priv->is_started = true ;
+ ephy_spinner_start (m_priv->spinner.get ());
+ m_priv->is_started = true;
}
bool
Spinner::is_started () const
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->spinner) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->spinner);
- return m_priv->is_started ;
+ return m_priv->is_started ;
}
void
Spinner::stop ()
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->spinner) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->spinner);
- ephy_spinner_stop (m_priv->spinner.get ()) ;
- m_priv->is_started = false ;
+ ephy_spinner_stop (m_priv->spinner.get ());
+ m_priv->is_started = false;
}
void
Spinner::toggle_state ()
{
if (is_started ()) {
- stop () ;
+ stop ();
} else {
- start () ;
+ start ();
}
}
Gtk::Widget&
Spinner::get_widget () const
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->widget) ;
- return *m_priv->widget ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->widget);
+ return *m_priv->widget;
}
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/uicommon/nmv-spinner.h b/src/uicommon/nmv-spinner.h
index 4610c9b..7d52b10 100644
--- a/src/uicommon/nmv-spinner.h
+++ b/src/uicommon/nmv-spinner.h
@@ -31,32 +31,32 @@
namespace Gtk {
class Widget;
}
-using nemiver::common::Object ;
-using nemiver::common::SafePtr ;
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::UString ;
+using nemiver::common::Object;
+using nemiver::common::SafePtr;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::UString;
NEMIVER_BEGIN_NAMESPACE (nemiver)
-class Spinner ;
-typedef SafePtr<Spinner, ObjectRef, ObjectUnref> SpinnerSafePtr ;
+class Spinner;
+typedef SafePtr<Spinner, ObjectRef, ObjectUnref> SpinnerSafePtr;
class Spinner : public Object {
- class Priv ;
- SafePtr<Priv> m_priv ;
+ class Priv;
+ SafePtr<Priv> m_priv;
protected:
- Spinner () ;
- Spinner (const UString &a_root_path) ;
+ Spinner ();
+ Spinner (const UString &a_root_path);
public:
- virtual ~Spinner () ;
- static SpinnerSafePtr create () ;
- virtual void start () ;
- virtual bool is_started () const ;
- virtual void stop () ;
- virtual void toggle_state () ;
- virtual Gtk::Widget& get_widget () const ;
+ virtual ~Spinner () ;
+ static SpinnerSafePtr create ();
+ virtual void start ();
+ virtual bool is_started () const;
+ virtual void stop ();
+ virtual void toggle_state ();
+ virtual Gtk::Widget& get_widget () const;
};//end class Spinner
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/uicommon/nmv-terminal.cc b/src/uicommon/nmv-terminal.cc
index 81dc488..1ed3317 100644
--- a/src/uicommon/nmv-terminal.cc
+++ b/src/uicommon/nmv-terminal.cc
@@ -50,14 +50,14 @@ NEMIVER_BEGIN_NAMESPACE(nemiver)
struct Terminal::Priv {
//the master pty of the terminal (and of the whole process)
- int master_pty ;
- int slave_pty ;
+ int master_pty;
+ int slave_pty;
//the real vte terminal widget
- VteTerminal *vte ;
+ VteTerminal *vte;
//the same object as
//m_vte, but wrapped as a Gtk::Widget
- Gtk::Widget *widget ;
- Gtk::Adjustment *adjustment ;
+ Gtk::Widget *widget;
+ Gtk::Adjustment *adjustment;
Priv () :
master_pty (0),
@@ -66,43 +66,43 @@ struct Terminal::Priv {
widget (0),
adjustment (0)
{
- GtkWidget *w = vte_terminal_new () ;
- vte = VTE_TERMINAL (w) ;
- THROW_IF_FAIL (vte) ;
+ GtkWidget *w = vte_terminal_new ();
+ vte = VTE_TERMINAL (w);
+ THROW_IF_FAIL (vte);
// Mandatory for vte 0.14
vte_terminal_set_font_from_string (vte, "monospace");
- vte_terminal_set_scroll_on_output (vte, TRUE) ;
- vte_terminal_set_scrollback_lines (vte, 1000) ;
- vte_terminal_set_emulation (vte, "xterm") ;
+ vte_terminal_set_scroll_on_output (vte, TRUE);
+ vte_terminal_set_scrollback_lines (vte, 1000);
+ vte_terminal_set_emulation (vte, "xterm");
- widget = Glib::wrap (w) ;
- THROW_IF_FAIL (widget) ;
- widget->set_manage () ;
+ widget = Glib::wrap (w);
+ THROW_IF_FAIL (widget);
+ widget->set_manage ();
- adjustment = Glib::wrap (vte_terminal_get_adjustment (vte)) ;
- THROW_IF_FAIL (adjustment) ;
- adjustment->set_manage () ;
+ adjustment = Glib::wrap (vte_terminal_get_adjustment (vte));
+ THROW_IF_FAIL (adjustment);
+ adjustment->set_manage ();
- widget->reference () ;
- THROW_IF_FAIL (init_pty ()) ;
+ widget->reference ();
+ THROW_IF_FAIL (init_pty ());
}
~Priv ()
{
if (slave_pty) {
- close (slave_pty) ;
- slave_pty = 0 ;
+ close (slave_pty);
+ slave_pty = 0;
}
if (master_pty) {
- close (master_pty) ;
- master_pty = 0 ;
+ close (master_pty);
+ master_pty = 0;
}
if (widget) {
- widget->unreference () ;
+ widget->unreference ();
widget = 0;
vte = 0;
}
@@ -111,66 +111,66 @@ struct Terminal::Priv {
bool init_pty ()
{
if (openpty (&master_pty, &slave_pty, NULL, NULL, NULL)) {
- LOG_ERROR ("oops") ;
- return false ;
+ LOG_ERROR ("oops");
+ return false;
}
- THROW_IF_FAIL (slave_pty) ;
- THROW_IF_FAIL (master_pty) ;
+ THROW_IF_FAIL (slave_pty);
+ THROW_IF_FAIL (master_pty);
if (grantpt (master_pty)) {
- LOG_ERROR ("oops") ;
- return false ;
+ LOG_ERROR ("oops");
+ return false;
}
if (unlockpt (master_pty)) {
- LOG_ERROR ("oops") ;
- return false ;
+ LOG_ERROR ("oops");
+ return false;
}
- vte_terminal_set_pty (vte, master_pty) ;
- return true ;
+ vte_terminal_set_pty (vte, master_pty);
+ return true;
}
};//end Terminal::Priv
Terminal::Terminal ()
{
- m_priv.reset (new Priv) ;
+ m_priv.reset (new Priv);
}
Terminal::~Terminal ()
{
- LOG_D ("deleted, ", "destructor-domain") ;
+ LOG_D ("deleted, ", "destructor-domain");
}
Gtk::Widget&
Terminal::widget () const
{
- THROW_IF_FAIL (m_priv->widget && m_priv->vte) ;
- return *m_priv->widget ;
+ THROW_IF_FAIL (m_priv->widget && m_priv->vte);
+ return *m_priv->widget;
}
Gtk::Adjustment&
Terminal::adjustment () const
{
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->adjustment) ;
- return *m_priv->adjustment ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->adjustment);
+ return *m_priv->adjustment;
}
UString
Terminal::slave_pts_name () const
{
- THROW_IF_FAIL (m_priv) ;
- UString result ;
+ THROW_IF_FAIL (m_priv);
+ UString result;
if (!m_priv->master_pty) {
- LOG_ERROR ("oops") ;
+ LOG_ERROR ("oops");
return result;
}
- result = ptsname (m_priv->master_pty) ;
- return result ;
+ result = ptsname (m_priv->master_pty);
+ return result;
}
void
diff --git a/src/uicommon/nmv-terminal.h b/src/uicommon/nmv-terminal.h
index 8450547..137c19a 100644
--- a/src/uicommon/nmv-terminal.h
+++ b/src/uicommon/nmv-terminal.h
@@ -31,37 +31,37 @@
#include "common/nmv-ustring.h"
#include "common/nmv-object.h"
-using nemiver::common::UString ;
-using nemiver::common::Object ;
-using nemiver::common::SafePtr ;
+using nemiver::common::UString;
+using nemiver::common::Object;
+using nemiver::common::SafePtr;
namespace Gtk {
- class Widget ;
- class Adjustment ;
+ class Widget;
+ class Adjustment;
}
namespace Pango {
- class FontDescription ;
+ class FontDescription;
}
NEMIVER_BEGIN_NAMESPACE(nemiver)
class Terminal : public Object {
//non copyable
- Terminal (const Terminal &) ;
- Terminal& operator= (const Terminal &) ;
+ Terminal (const Terminal &);
+ Terminal& operator= (const Terminal &);
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
public:
- Terminal () ;
- ~Terminal () ;
- Gtk::Widget& widget () const ;
- Gtk::Adjustment& adjustment () const ;
- UString slave_pts_name () const ;
- void modify_font (const Pango::FontDescription &font_desc) ;
+ Terminal ();
+ ~Terminal ();
+ Gtk::Widget& widget () const;
+ Gtk::Adjustment& adjustment () const;
+ UString slave_pts_name () const;
+ void modify_font (const Pango::FontDescription &font_desc);
void feed (const UString &a_text);
};//end class Terminal
diff --git a/src/workbench/nmv-i-pref-mgr.h b/src/workbench/nmv-i-pref-mgr.h
index f17c722..b2161a5 100644
--- a/src/workbench/nmv-i-pref-mgr.h
+++ b/src/workbench/nmv-i-pref-mgr.h
@@ -30,9 +30,9 @@
#include "common/nmv-dynamic-module.h"
#include "common/nmv-ustring.h"
-using namespace std ;
-using nemiver::common::UString ;
-using boost::variant ;
+using namespace std;
+using nemiver::common::UString;
+using boost::variant;
namespace nemiver {
@@ -41,8 +41,8 @@ namespace nemiver {
class NEMIVER_API IPrefMgr : public DynamicModule {
//non copyable
- IPrefMgr (const IPrefMgr&) ;
- IPrefMgr& operator= (const IPrefMgr&) ;
+ IPrefMgr (const IPrefMgr&);
+ IPrefMgr& operator= (const IPrefMgr&);
protected:
//must be created by the dynamic module factory
@@ -50,8 +50,8 @@ protected:
public:
class Pref {
- UString m_name ;
- boost::variant<gint32, UString> m_value ;
+ UString m_name;
+ boost::variant<gint32, UString> m_value;
public:
enum Type {
diff --git a/src/workbench/nmv-i-workbench.h b/src/workbench/nmv-i-workbench.h
index 835c96d..8890cc7 100644
--- a/src/workbench/nmv-i-workbench.h
+++ b/src/workbench/nmv-i-workbench.h
@@ -33,21 +33,21 @@
//some Gtk forward decls
//******************
namespace Gtk {
- class Widget ;
- class Notebook ;
- class Window ;
- class ActionGroup ;
- class UIManager ;
- class Main ;
+ class Widget;
+ class Notebook;
+ class Window;
+ class ActionGroup;
+ class UIManager;
+ class Main;
}//end namespace Gtk
namespace Glib {
- class MainContext ;
+ class MainContext;
}
namespace nemiver {
namespace common {
- class UString ;
+ class UString;
}
}
@@ -56,19 +56,19 @@ NEMIVER_BEGIN_NAMESPACE (nemiver)
//*******************
//some forward decls
//******************
-class IPerspective ;
-class IConfMgr ;
-using nemiver::common::SafePtr ;
+class IPerspective;
+class IConfMgr;
+using nemiver::common::SafePtr;
using nemiver::common::DynamicModule;
using nemiver::common::DynamicModuleSafePtr;
using nemiver::common::DynModIface;
using nemiver::common::DynModIfaceSafePtr;
-using nemiver::common::ObjectRef ;
-using nemiver::common::ObjectUnref ;
-using nemiver::common::UString ;
+using nemiver::common::ObjectRef;
+using nemiver::common::ObjectUnref;
+using nemiver::common::UString;
-class IWorkbench ;
-typedef SafePtr<IWorkbench, ObjectRef, ObjectUnref> IWorkbenchSafePtr ;
+class IWorkbench;
+typedef SafePtr<IWorkbench, ObjectRef, ObjectUnref> IWorkbenchSafePtr;
/// \brief the interface of the Workbench.
/// The workbench is what you see graphically when you use
@@ -93,8 +93,8 @@ typedef SafePtr<IWorkbench, ObjectRef, ObjectUnref> IWorkbenchSafePtr ;
class NEMIVER_API IWorkbench : public DynModIface {
//non copyable
- IWorkbench (const IWorkbench&) ;
- IWorkbench& operator= (const IWorkbench&) ;
+ IWorkbench (const IWorkbench&);
+ IWorkbench& operator= (const IWorkbench&);
protected:
// must be created by the dynamic modules factory
@@ -110,7 +110,7 @@ public:
/// \param a_main the main loop created by the application.
virtual void do_init (Gtk::Main &a_main) = 0;
- virtual void shut_down () = 0 ;
+ virtual void shut_down () = 0;
/// \brief signal
@@ -120,36 +120,36 @@ public:
/// @{
/// \return the action group that is always activated
- virtual Glib::RefPtr<Gtk::ActionGroup> get_default_action_group () = 0 ;
+ virtual Glib::RefPtr<Gtk::ActionGroup> get_default_action_group () = 0;
- virtual Gtk::Widget& get_menubar () = 0 ;
+ virtual Gtk::Widget& get_menubar () = 0;
/// \returns gets the container of the toolbars.
- virtual Gtk::Notebook& get_toolbar_container () = 0 ;
+ virtual Gtk::Notebook& get_toolbar_container () = 0;
/// \return the Workbench root window
- virtual Gtk::Window& get_root_window () = 0 ;
+ virtual Gtk::Window& get_root_window () = 0;
/// Set state-related information to be appended to the window title
- virtual void set_title_extension (const UString &a_str) = 0 ;
+ virtual void set_title_extension (const UString &a_str) = 0;
/// \return the Gtk::UIManager of the workbench
- virtual Glib::RefPtr<Gtk::UIManager>& get_ui_manager () = 0 ;
+ virtual Glib::RefPtr<Gtk::UIManager>& get_ui_manager () = 0;
/// \return the perspective that which name matches a_name
virtual IPerspective* get_perspective (const UString &a_name) = 0;
/// \return the interface of the configuration manager.
- virtual IConfMgrSafePtr get_configuration_manager () = 0 ;
+ virtual IConfMgrSafePtr get_configuration_manager () = 0;
///@}
- virtual Glib::RefPtr<Glib::MainContext> get_main_context () = 0 ;
+ virtual Glib::RefPtr<Glib::MainContext> get_main_context () = 0;
/// \name signals
/// @{
/// \brief emitted just before the workbench shuts down
- virtual sigc::signal<void>& shutting_down_signal () = 0 ;
+ virtual sigc::signal<void>& shutting_down_signal () = 0;
/// @}
};//end class IWorkbench
diff --git a/src/workbench/nmv-workbench.cc b/src/workbench/nmv-workbench.cc
index 082296c..31f68bd 100644
--- a/src/workbench/nmv-workbench.cc
+++ b/src/workbench/nmv-workbench.cc
@@ -42,26 +42,26 @@
#include "nmv-i-perspective.h"
#include "nmv-i-conf-mgr.h"
-using namespace std ;
-using namespace nemiver ;
-using namespace nemiver::common ;
+using namespace std;
+using namespace nemiver;
+using namespace nemiver::common;
NEMIVER_BEGIN_NAMESPACE (nemiver)
static const UString CONF_KEY_NEMIVER_WINDOW_WIDTH =
- "/apps/nemiver/workbench/window-width" ;
+ "/apps/nemiver/workbench/window-width";
static const UString CONF_KEY_NEMIVER_WINDOW_HEIGHT =
- "/apps/nemiver/workbench/window-height" ;
+ "/apps/nemiver/workbench/window-height";
static const UString CONF_KEY_NEMIVER_WINDOW_POSITION_X =
- "/apps/nemiver/workbench/window-position-x" ;
+ "/apps/nemiver/workbench/window-position-x";
static const UString CONF_KEY_NEMIVER_WINDOW_POSITION_Y =
- "/apps/nemiver/workbench/window-position-y" ;
+ "/apps/nemiver/workbench/window-position-y";
static const UString CONF_KEY_NEMIVER_WINDOW_MAXIMIZED =
- "/apps/nemiver/workbench/window-maximized" ;
+ "/apps/nemiver/workbench/window-maximized";
static const UString CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH=
- "/apps/nemiver/workbench/window-minimum-width" ;
+ "/apps/nemiver/workbench/window-minimum-width";
static const UString CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT=
- "/apps/nemiver/workbench/window-minimum-height" ;
+ "/apps/nemiver/workbench/window-minimum-height";
class WorkbenchStaticInit {
@@ -70,31 +70,31 @@ class WorkbenchStaticInit {
#ifdef WITH_GIO
Gio::init();
#else
- gnome_vfs_init () ;
+ gnome_vfs_init ();
#endif // WITH_GIO
}
~WorkbenchStaticInit ()
{
#ifndef WITH_GIO
- gnome_vfs_shutdown () ;
+ gnome_vfs_shutdown ();
#endif // WITH_GIO
}
public:
static void do_init ()
{
- static WorkbenchStaticInit s_wb_init ;
+ static WorkbenchStaticInit s_wb_init;
}
};//end class WorkbenchStaticInit
class Workbench : public IWorkbench {
- struct Priv ;
- SafePtr<Priv> m_priv ;
+ struct Priv;
+ SafePtr<Priv> m_priv;
- Workbench (const Workbench&) ;
- Workbench& operator= (const Workbench&) ;
+ Workbench (const Workbench&);
+ Workbench& operator= (const Workbench&);
private:
@@ -102,72 +102,72 @@ private:
//************************
//<slots (signal callbacks)>
//************************
- void on_quit_menu_item_action () ;
- void on_about_menu_item_action () ;
- void on_contents_menu_item_action () ;
- void on_shutting_down_signal () ;
+ void on_quit_menu_item_action ();
+ void on_about_menu_item_action ();
+ void on_contents_menu_item_action ();
+ void on_shutting_down_signal ();
//************************
//</slots (signal callbacks)>
//************************
- void init_glade () ;
- void init_window () ;
- void init_actions () ;
- void init_menubar () ;
- void init_toolbar () ;
- void init_body () ;
+ void init_glade ();
+ void init_window ();
+ void init_actions ();
+ void init_menubar ();
+ void init_toolbar ();
+ void init_body ();
void add_perspective_toolbars (IPerspectiveSafePtr &a_perspective,
- list<Gtk::Widget*> &a_tbs) ;
+ list<Gtk::Widget*> &a_tbs);
void add_perspective_body (IPerspectiveSafePtr &a_perspective,
- Gtk::Widget *a_body) ;
- bool remove_perspective_body (IPerspectiveSafePtr &a_perspective) ;
- void remove_all_perspective_bodies () ;
- void select_perspective (IPerspectiveSafePtr &a_perspective) ;
+ Gtk::Widget *a_body);
+ bool remove_perspective_body (IPerspectiveSafePtr &a_perspective);
+ void remove_all_perspective_bodies ();
+ void select_perspective (IPerspectiveSafePtr &a_perspective);
- void save_window_geometry () ;
+ void save_window_geometry ();
void do_init ()
{
WorkbenchStaticInit::do_init ();
}
- bool on_delete_event (GdkEventAny* event) ;
+ bool on_delete_event (GdkEventAny* event);
public:
- Workbench (DynamicModule *a_dynmod) ;
- virtual ~Workbench () ;
- void do_init (Gtk::Main &a_main) ;
- void shut_down () ;
- Glib::RefPtr<Gtk::ActionGroup> get_default_action_group () ;
+ Workbench (DynamicModule *a_dynmod);
+ virtual ~Workbench ();
+ void do_init (Gtk::Main &a_main);
+ void shut_down ();
+ Glib::RefPtr<Gtk::ActionGroup> get_default_action_group ();
Glib::RefPtr<Gtk::ActionGroup> get_debugger_ready_action_group ();
Gtk::Widget& get_menubar ();
Gtk::Notebook& get_toolbar_container ();
- Gtk::Window& get_root_window () ;
- void set_title_extension (const UString &a_str) ;
- Glib::RefPtr<Gtk::UIManager>& get_ui_manager () ;
- IPerspective* get_perspective (const UString &a_name) ;
- IConfMgrSafePtr get_configuration_manager () ;
- Glib::RefPtr<Glib::MainContext> get_main_context () ;
- sigc::signal<void>& shutting_down_signal () ;
+ Gtk::Window& get_root_window ();
+ void set_title_extension (const UString &a_str);
+ Glib::RefPtr<Gtk::UIManager>& get_ui_manager () ;
+ IPerspective* get_perspective (const UString &a_name);
+ IConfMgrSafePtr get_configuration_manager () ;
+ Glib::RefPtr<Glib::MainContext> get_main_context () ;
+ sigc::signal<void>& shutting_down_signal ();
};//end class Workbench
struct Workbench::Priv {
- bool initialized ;
- Gtk::Main *main ;
- Glib::RefPtr<Gtk::ActionGroup> default_action_group ;
- Glib::RefPtr<Gtk::UIManager> ui_manager ;
- Glib::RefPtr<Gnome::Glade::Xml> glade ;
- SafePtr <Gtk::Window> root_window ;
- Gtk::Widget *menubar ;
+ bool initialized;
+ Gtk::Main *main;
+ Glib::RefPtr<Gtk::ActionGroup> default_action_group;
+ Glib::RefPtr<Gtk::UIManager> ui_manager;
+ Glib::RefPtr<Gnome::Glade::Xml> glade;
+ SafePtr <Gtk::Window> root_window;
+ Gtk::Widget *menubar;
Gtk::Notebook *toolbar_container;
- Gtk::Notebook *bodies_container ;
- PluginManagerSafePtr plugin_manager ;
- list<IPerspectiveSafePtr> perspectives ;
- map<IPerspective*, int> toolbars_index_map ;
- map<IPerspective*, int> bodies_index_map ;
- map<UString, UString> properties ;
- IConfMgrSafePtr conf_mgr ;
- sigc::signal<void> shutting_down_signal ;
+ Gtk::Notebook *bodies_container;
+ PluginManagerSafePtr plugin_manager;
+ list<IPerspectiveSafePtr> perspectives;
+ map<IPerspective*, int> toolbars_index_map;
+ map<IPerspective*, int> bodies_index_map;
+ map<UString, UString> properties;
+ IConfMgrSafePtr conf_mgr;
+ sigc::signal<void> shutting_down_signal;
UString base_title;
Priv () :
@@ -183,7 +183,7 @@ struct Workbench::Priv {
};//end Workbench::Priv
#ifndef CHECK_WB_INIT
-#define CHECK_WB_INIT THROW_IF_FAIL(m_priv->initialized) ;
+#define CHECK_WB_INIT THROW_IF_FAIL(m_priv->initialized);
#endif
//****************
@@ -196,7 +196,7 @@ struct Workbench::Priv {
bool
Workbench::on_delete_event (GdkEventAny* a_event)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
NEMIVER_TRY
// use event so that compilation doesn't fail with -Werror :(
@@ -204,7 +204,7 @@ Workbench::on_delete_event (GdkEventAny* a_event)
// clicking the window manager's X and shutting down the with Quit menu item
// should do the same thing
- on_quit_menu_item_action () ;
+ on_quit_menu_item_action ();
NEMIVER_CATCH
//keep propagating
@@ -214,11 +214,11 @@ Workbench::on_delete_event (GdkEventAny* a_event)
void
Workbench::on_quit_menu_item_action ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
NEMIVER_TRY
- shut_down () ;
+ shut_down ();
NEMIVER_CATCH
}
@@ -246,7 +246,7 @@ Workbench::on_contents_menu_item_action ()
void
Workbench::on_about_menu_item_action ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
NEMIVER_TRY
@@ -308,10 +308,10 @@ Workbench::on_about_menu_item_action ()
void
Workbench::on_shutting_down_signal ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
NEMIVER_TRY
- save_window_geometry () ;
+ save_window_geometry ();
NEMIVER_CATCH
}
@@ -323,22 +323,22 @@ Workbench::Workbench (DynamicModule *a_dynmod) :
Workbench::~Workbench ()
{
- remove_all_perspective_bodies () ;
- LOG_D ("delete", "destructor-domain") ;
+ remove_all_perspective_bodies ();
+ LOG_D ("delete", "destructor-domain");
}
void
Workbench::do_init (Gtk::Main &a_main)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- DynamicModule::Loader *loader = get_dynamic_module ().get_module_loader () ;
- THROW_IF_FAIL (loader) ;
+ DynamicModule::Loader *loader = get_dynamic_module ().get_module_loader ();
+ THROW_IF_FAIL (loader);
- DynamicModuleManager *dynmod_manager = loader->get_dynamic_module_manager () ;
- THROW_IF_FAIL (dynmod_manager) ;
+ DynamicModuleManager *dynmod_manager = loader->get_dynamic_module_manager ();
+ THROW_IF_FAIL (dynmod_manager);
- m_priv->main = &a_main ;
+ m_priv->main = &a_main;
// set the icon that will be used by all workbench windows that don't
// explicitly call set_icon() (must be set before the root window is
@@ -359,61 +359,61 @@ Workbench::do_init (Gtk::Main &a_main)
m_priv->root_window->set_default_icon_list(icon_list);
}
- init_glade () ;
- init_window () ;
- init_actions () ;
- init_menubar () ;
- init_toolbar () ;
- init_body () ;
+ init_glade ();
+ init_window ();
+ init_actions ();
+ init_menubar ();
+ init_toolbar ();
+ init_body ();
- m_priv->initialized = true ;
+ m_priv->initialized = true;
m_priv->plugin_manager =
- PluginManagerSafePtr (new PluginManager (*dynmod_manager)) ;
+ PluginManagerSafePtr (new PluginManager (*dynmod_manager));
NEMIVER_TRY
- m_priv->plugin_manager->load_plugins () ;
+ m_priv->plugin_manager->load_plugins ();
- map<UString, PluginSafePtr>::const_iterator plugin_iter ;
- IPerspectiveSafePtr perspective ;
- Plugin::EntryPointSafePtr entry_point ;
- list<Gtk::Widget*> toolbars ;
+ map<UString, PluginSafePtr>::const_iterator plugin_iter;
+ IPerspectiveSafePtr perspective;
+ Plugin::EntryPointSafePtr entry_point;
+ list<Gtk::Widget*> toolbars;
//**************************************************************
//store the list of perspectives we may have loaded as plugins,
//and init each of them.
//**************************************************************
- IWorkbench *workbench = dynamic_cast<IWorkbench*> (this) ;
- for (plugin_iter = m_priv->plugin_manager->plugins_map ().begin () ;
+ IWorkbench *workbench = dynamic_cast<IWorkbench*> (this);
+ for (plugin_iter = m_priv->plugin_manager->plugins_map ().begin ();
plugin_iter != m_priv->plugin_manager->plugins_map ().end ();
++plugin_iter) {
LOG_D ("plugin '"
<< plugin_iter->second->descriptor ()->name ()
<< "' refcount: "
<< (int) plugin_iter->second->get_refcount (),
- "refcount-domain") ;
+ "refcount-domain");
if (plugin_iter->second && plugin_iter->second->entry_point_ptr ()) {
- entry_point = plugin_iter->second->entry_point_ptr () ;
- perspective = entry_point.do_dynamic_cast<IPerspective> () ;
+ entry_point = plugin_iter->second->entry_point_ptr ();
+ perspective = entry_point.do_dynamic_cast<IPerspective> ();
if (perspective) {
- m_priv->perspectives.push_front (perspective) ;
- perspective->do_init (workbench) ;
- perspective->edit_workbench_menu () ;
- toolbars.clear () ;
- perspective->get_toolbars (toolbars) ;
- add_perspective_toolbars (perspective, toolbars) ;
- add_perspective_body (perspective, perspective->get_body ()) ;
+ m_priv->perspectives.push_front (perspective);
+ perspective->do_init (workbench);
+ perspective->edit_workbench_menu ();
+ toolbars.clear ();
+ perspective->get_toolbars (toolbars);
+ add_perspective_toolbars (perspective, toolbars);
+ add_perspective_body (perspective, perspective->get_body ());
LOG_D ("perspective '"
<< perspective->get_perspective_identifier ()
<< "' refcount: "
<< (int) perspective->get_refcount (),
- "refcount-domain") ;
+ "refcount-domain");
}
}
}
if (!m_priv->perspectives.empty ()) {
- select_perspective (*m_priv->perspectives.begin ()) ;
+ select_perspective (*m_priv->perspectives.begin ());
}
NEMIVER_CATCH
}
@@ -421,45 +421,45 @@ Workbench::do_init (Gtk::Main &a_main)
void
Workbench::shut_down ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- shutting_down_signal ().emit () ;
- m_priv->main->quit () ;
+ shutting_down_signal ().emit ();
+ m_priv->main->quit ();
}
Glib::RefPtr<Gtk::ActionGroup>
Workbench::get_default_action_group ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- CHECK_WB_INIT ;
- THROW_IF_FAIL (m_priv) ;
- return m_priv->default_action_group ;
+ CHECK_WB_INIT;
+ THROW_IF_FAIL (m_priv);
+ return m_priv->default_action_group;
}
Gtk::Widget&
Workbench::get_menubar ()
{
- CHECK_WB_INIT ;
- THROW_IF_FAIL (m_priv && m_priv->menubar) ;
- return *m_priv->menubar ;
+ CHECK_WB_INIT;
+ THROW_IF_FAIL (m_priv && m_priv->menubar);
+ return *m_priv->menubar;
}
Gtk::Notebook&
Workbench::get_toolbar_container ()
{
- CHECK_WB_INIT ;
- THROW_IF_FAIL (m_priv && m_priv->toolbar_container) ;
- return *m_priv->toolbar_container ;
+ CHECK_WB_INIT;
+ THROW_IF_FAIL (m_priv && m_priv->toolbar_container);
+ return *m_priv->toolbar_container;
}
Gtk::Window&
Workbench::get_root_window ()
{
- CHECK_WB_INIT ;
- THROW_IF_FAIL (m_priv && m_priv->root_window) ;
+ CHECK_WB_INIT;
+ THROW_IF_FAIL (m_priv && m_priv->root_window);
- return *m_priv->root_window ;
+ return *m_priv->root_window;
}
void
@@ -475,81 +475,81 @@ Workbench::set_title_extension (const UString &a_str)
Glib::RefPtr<Gtk::UIManager>&
Workbench::get_ui_manager ()
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
if (!m_priv->ui_manager) {
- m_priv->ui_manager = Gtk::UIManager::create () ;
- THROW_IF_FAIL (m_priv->ui_manager) ;
+ m_priv->ui_manager = Gtk::UIManager::create ();
+ THROW_IF_FAIL (m_priv->ui_manager);
}
- return m_priv->ui_manager ;
+ return m_priv->ui_manager;
}
IPerspective*
Workbench::get_perspective (const UString &a_name)
{
- list<IPerspectiveSafePtr>::const_iterator iter ;
+ list<IPerspectiveSafePtr>::const_iterator iter;
for (iter = m_priv->perspectives.begin ();
iter != m_priv->perspectives.end ();
++iter) {
if ((*iter)->descriptor ()->name () == a_name) {
- return iter->get () ;
+ return iter->get ();
}
}
- LOG_ERROR ("could not find perspective: '" << a_name << "'") ;
+ LOG_ERROR ("could not find perspective: '" << a_name << "'");
return NULL;
}
IConfMgrSafePtr
Workbench::get_configuration_manager ()
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
if (!m_priv->conf_mgr) {
DynamicModule::Loader *loader =
- get_dynamic_module ().get_module_loader () ;
- THROW_IF_FAIL (loader) ;
+ get_dynamic_module ().get_module_loader ();
+ THROW_IF_FAIL (loader);
DynamicModuleManager *dynmod_manager =
- loader->get_dynamic_module_manager () ;
- THROW_IF_FAIL (dynmod_manager) ;
+ loader->get_dynamic_module_manager ();
+ THROW_IF_FAIL (dynmod_manager);
m_priv->conf_mgr = dynmod_manager->load_iface <IConfMgr> ("gconfmgr",
- "IConfMgr") ;
+ "IConfMgr");
NEMIVER_TRY
- m_priv->conf_mgr->set_key_dir_to_notify ("/apps/nemiver") ;
+ m_priv->conf_mgr->set_key_dir_to_notify ("/apps/nemiver");
m_priv->conf_mgr->add_key_to_notify (
- "/desktop/gnome/interface/monospace_font_name") ;
+ "/desktop/gnome/interface/monospace_font_name");
NEMIVER_CATCH_NOX
}
- THROW_IF_FAIL (m_priv->conf_mgr) ;
- return m_priv->conf_mgr ;
+ THROW_IF_FAIL (m_priv->conf_mgr);
+ return m_priv->conf_mgr;
}
Glib::RefPtr<Glib::MainContext>
Workbench::get_main_context ()
{
- THROW_IF_FAIL (m_priv) ;
- return Glib::MainContext::get_default () ;
+ THROW_IF_FAIL (m_priv);
+ return Glib::MainContext::get_default ();
}
sigc::signal<void>&
Workbench::shutting_down_signal ()
{
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
- return m_priv->shutting_down_signal ;
+ return m_priv->shutting_down_signal;
}
void
Workbench::init_glade ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
+ THROW_IF_FAIL (m_priv);
- UString file_path = env::build_path_to_glade_file ("workbench.glade") ;
- m_priv->glade = Gnome::Glade::Xml::create (file_path) ;
- THROW_IF_FAIL (m_priv->glade) ;
+ UString file_path = env::build_path_to_glade_file ("workbench.glade");
+ m_priv->glade = Gnome::Glade::Xml::create (file_path);
+ THROW_IF_FAIL (m_priv->glade);
Gtk::Widget *w =
ui_utils::get_widget_from_glade<Gtk::Window> (m_priv->glade,
@@ -569,45 +569,45 @@ void
Workbench::init_window ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->root_window) ;
- IConfMgrSafePtr conf_mgr = get_configuration_manager () ;
- THROW_IF_FAIL (conf_mgr) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->root_window);
+ IConfMgrSafePtr conf_mgr = get_configuration_manager ();
+ THROW_IF_FAIL (conf_mgr);
- int width=700, height=500, pos_x=0, pos_y=0 ;
- bool maximized=false ;
+ int width=700, height=500, pos_x=0, pos_y=0;
+ bool maximized=false;
- LOG_DD ("getting windows geometry from confmgr ...") ;
+ LOG_DD ("getting windows geometry from confmgr ...");
NEMIVER_TRY
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_WIDTH, width) ;
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_HEIGHT, height) ;
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_X, pos_x) ;
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_Y, pos_y) ;
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_MAXIMIZED, maximized) ;
- LOG_DD ("got windows geometry from confmgr.") ;
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_WIDTH, width);
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_HEIGHT, height);
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_X, pos_x);
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_Y, pos_y);
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_MAXIMIZED, maximized);
+ LOG_DD ("got windows geometry from confmgr.");
NEMIVER_CATCH_NOX
if (width) {
- LOG_DD ("restoring windows geometry from confmgr ...") ;
- m_priv->root_window->resize (width, height) ;
- m_priv->root_window->move (pos_x, pos_y) ;
+ LOG_DD ("restoring windows geometry from confmgr ...");
+ m_priv->root_window->resize (width, height);
+ m_priv->root_window->move (pos_x, pos_y);
if (maximized) {
- m_priv->root_window->maximize () ;
+ m_priv->root_window->maximize ();
}
- LOG_DD ("restored windows geometry from confmgr") ;
+ LOG_DD ("restored windows geometry from confmgr");
} else {
- LOG_DD ("null window geometry from confmgr.") ;
+ LOG_DD ("null window geometry from confmgr.");
}
//set the minimum width/height of nemiver, just in case.
- width=0, height=0 ;
+ width=0, height=0;
NEMIVER_TRY
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH, width) ;
- conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT, height) ;
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_MINIMUM_WIDTH, width);
+ conf_mgr->get_key_value (CONF_KEY_NEMIVER_WINDOW_MINIMUM_HEIGHT, height);
NEMIVER_CATCH
if (!width)
@@ -615,15 +615,15 @@ Workbench::init_window ()
if (!height)
height = 500;
- m_priv->root_window->set_size_request (width, height) ;
+ m_priv->root_window->set_size_request (width, height);
LOG_DD ("set windows min size to ("
<< (int) width
<< ","
<< (int) height
- << ")") ;
+ << ")");
shutting_down_signal ().connect (sigc::mem_fun
- (*this, &Workbench::on_shutting_down_signal)) ;
+ (*this, &Workbench::on_shutting_down_signal));
m_priv->root_window->signal_delete_event ().connect (
sigc::mem_fun (*this, &Workbench::on_delete_event));
}
@@ -631,11 +631,11 @@ Workbench::init_window ()
void
Workbench::init_actions ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- Gtk::StockID nil_stock_id ("") ;
- sigc::slot<void> nil_slot ;
- using ui_utils::ActionEntry ;
+ Gtk::StockID nil_stock_id ("");
+ sigc::slot<void> nil_slot;
+ using ui_utils::ActionEntry;
static ActionEntry s_default_action_entries [] = {
{
@@ -706,81 +706,81 @@ Workbench::init_actions ()
};
m_priv->default_action_group =
- Gtk::ActionGroup::create ("workbench-default-action-group") ;
+ Gtk::ActionGroup::create ("workbench-default-action-group");
int num_default_actions =
- sizeof (s_default_action_entries)/sizeof (ui_utils::ActionEntry) ;
+ sizeof (s_default_action_entries)/sizeof (ui_utils::ActionEntry);
ui_utils::add_action_entries_to_action_group (s_default_action_entries,
num_default_actions,
- m_priv->default_action_group) ;
- get_ui_manager ()->insert_action_group (m_priv->default_action_group) ;
+ m_priv->default_action_group);
+ get_ui_manager ()->insert_action_group (m_priv->default_action_group);
}
void
Workbench::init_menubar ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv && m_priv->default_action_group) ;
+ THROW_IF_FAIL (m_priv && m_priv->default_action_group);
- UString file_path = env::build_path_to_menu_file ("menubar.xml") ;
- m_priv->ui_manager->add_ui_from_file (file_path) ;
+ UString file_path = env::build_path_to_menu_file ("menubar.xml");
+ m_priv->ui_manager->add_ui_from_file (file_path);
- m_priv->menubar = m_priv->ui_manager->get_widget ("/MenuBar") ;
- THROW_IF_FAIL (m_priv->menubar) ;
+ m_priv->menubar = m_priv->ui_manager->get_widget ("/MenuBar");
+ THROW_IF_FAIL (m_priv->menubar);
Gtk::Box *menu_container =
ui_utils::get_widget_from_glade<Gtk::Box> (m_priv->glade, "menucontainer");
- menu_container->pack_start (*m_priv->menubar) ;
- menu_container->show_all () ;
+ menu_container->pack_start (*m_priv->menubar);
+ menu_container->show_all ();
}
void
Workbench::init_toolbar ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
m_priv->toolbar_container =
ui_utils::get_widget_from_glade<Gtk::Notebook> (m_priv->glade,
- "toolbarcontainer") ;
+ "toolbarcontainer");
}
void
Workbench::init_body ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
m_priv->bodies_container =
ui_utils::get_widget_from_glade<Gtk::Notebook> (m_priv->glade,
- "bodynotebook") ;
+ "bodynotebook");
}
void
Workbench::add_perspective_toolbars (IPerspectiveSafePtr &a_perspective,
list<Gtk::Widget*> &a_tbs)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- if (a_tbs.empty ()) {return ;}
+ if (a_tbs.empty ()) {return;}
- SafePtr<Gtk::Box> box (Gtk::manage (new Gtk::VBox)) ;
- list<Gtk::Widget*>::const_iterator iter ;
+ SafePtr<Gtk::Box> box (Gtk::manage (new Gtk::VBox));
+ list<Gtk::Widget*>::const_iterator iter;
- for (iter = a_tbs.begin (); iter != a_tbs.end () ; ++iter) {
- box->pack_start (**iter) ;
+ for (iter = a_tbs.begin (); iter != a_tbs.end (); ++iter) {
+ box->pack_start (**iter);
}
- box->show_all () ;
+ box->show_all ();
m_priv->toolbars_index_map [a_perspective.get ()] =
- m_priv->toolbar_container->insert_page (*box, -1) ;
+ m_priv->toolbar_container->insert_page (*box, -1);
- box.release () ;
+ box.release ();
}
void
Workbench::add_perspective_body (IPerspectiveSafePtr &a_perspective,
Gtk::Widget *a_body)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
if (!a_body || !a_perspective) {return;}
@@ -791,51 +791,51 @@ Workbench::add_perspective_body (IPerspectiveSafePtr &a_perspective,
bool
Workbench::remove_perspective_body (IPerspectiveSafePtr &a_perspective)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->bodies_container) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->bodies_container);
if (!a_perspective) {return false;}
map<IPerspective*, int>::iterator it;
- it = m_priv->bodies_index_map.find (a_perspective.get ()) ;
+ it = m_priv->bodies_index_map.find (a_perspective.get ());
if (it == m_priv->bodies_index_map.end ()) {
- return false ;
+ return false;
}
- m_priv->bodies_container->remove_page (it->second) ;
- m_priv->bodies_index_map.erase (it) ;
- return true ;
+ m_priv->bodies_container->remove_page (it->second) ;
+ m_priv->bodies_index_map.erase (it);
+ return true;
}
void
Workbench::save_window_geometry ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->root_window) ;
- IConfMgrSafePtr conf_mgr = get_configuration_manager () ;
- THROW_IF_FAIL (conf_mgr) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->root_window);
+ IConfMgrSafePtr conf_mgr = get_configuration_manager ();
+ THROW_IF_FAIL (conf_mgr);
- int width=0, height=0, pos_x=0, pos_y=0 ;
- m_priv->root_window->get_size (width, height) ;
- m_priv->root_window->get_position (pos_x, pos_y) ;
+ int width=0, height=0, pos_x=0, pos_y=0;
+ m_priv->root_window->get_size (width, height);
+ m_priv->root_window->get_position (pos_x, pos_y);
bool maximized = (m_priv->root_window->get_window()->get_state()
& Gdk::WINDOW_STATE_MAXIMIZED);
NEMIVER_TRY
- conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_MAXIMIZED, maximized) ;
+ conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_MAXIMIZED, maximized);
if (!maximized) {
- LOG_DD ("storing windows geometry to confmgr...") ;
- conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_WIDTH, width) ;
- conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_HEIGHT, height) ;
- conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_X, pos_x) ;
- conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_Y, pos_y) ;
- LOG_DD ("windows geometry stored to confmgr") ;
+ LOG_DD ("storing windows geometry to confmgr...");
+ conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_WIDTH, width);
+ conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_HEIGHT, height);
+ conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_X, pos_x);
+ conf_mgr->set_key_value (CONF_KEY_NEMIVER_WINDOW_POSITION_Y, pos_y);
+ LOG_DD ("windows geometry stored to confmgr");
} else {
- LOG_DD ("windows was maximized, didn't store its geometry") ;
+ LOG_DD ("windows was maximized, didn't store its geometry");
}
NEMIVER_CATCH_NOX
}
@@ -843,44 +843,44 @@ Workbench::save_window_geometry ()
void
Workbench::remove_all_perspective_bodies ()
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- map<IPerspective*, int>::iterator it ;
+ map<IPerspective*, int>::iterator it;
for (it = m_priv->bodies_index_map.begin ();
it != m_priv->bodies_index_map.end ();
++it) {
- m_priv->bodies_container->remove_page (it->second) ;
+ m_priv->bodies_container->remove_page (it->second);
}
- m_priv->bodies_index_map.clear () ;
+ m_priv->bodies_index_map.clear ();
}
void
Workbench::select_perspective (IPerspectiveSafePtr &a_perspective)
{
- LOG_FUNCTION_SCOPE_NORMAL_DD ;
+ LOG_FUNCTION_SCOPE_NORMAL_DD;
- THROW_IF_FAIL (m_priv) ;
- THROW_IF_FAIL (m_priv->toolbar_container) ;
- THROW_IF_FAIL (m_priv->bodies_container) ;
+ THROW_IF_FAIL (m_priv);
+ THROW_IF_FAIL (m_priv->toolbar_container);
+ THROW_IF_FAIL (m_priv->bodies_container);
- map<IPerspective*, int>::const_iterator iter, nil ;
- int toolbar_index=0, body_index=0 ;
+ map<IPerspective*, int>::const_iterator iter, nil;
+ int toolbar_index=0, body_index=0;
- nil = m_priv->toolbars_index_map.end () ;
- iter = m_priv->toolbars_index_map.find (a_perspective.get ()) ;
+ nil = m_priv->toolbars_index_map.end ();
+ iter = m_priv->toolbars_index_map.find (a_perspective.get ());
if (iter != nil) {
- toolbar_index = iter->second ;
+ toolbar_index = iter->second;
}
- nil = m_priv->bodies_index_map.end () ;
- iter = m_priv->bodies_index_map.find (a_perspective.get ()) ;
+ nil = m_priv->bodies_index_map.end ();
+ iter = m_priv->bodies_index_map.find (a_perspective.get ());
if (iter != nil) {
- body_index = iter->second ;
+ body_index = iter->second;
}
- m_priv->toolbar_container->set_current_page (toolbar_index) ;
+ m_priv->toolbar_container->set_current_page (toolbar_index);
- m_priv->bodies_container->set_current_page (body_index) ;
+ m_priv->bodies_container->set_current_page (body_index);
}
class WorkbenchModule : public DynamicModule {
@@ -895,19 +895,19 @@ public:
{
static Info s_info ("workbench",
"The workbench of Nemiver",
- "1.0") ;
- a_info = s_info ;
+ "1.0");
+ a_info = s_info;
}
bool lookup_interface (const std::string &a_iface_name,
DynModIfaceSafePtr &a_iface)
{
if (a_iface_name == "IWorkbench") {
- a_iface.reset (new Workbench (this)) ;
+ a_iface.reset (new Workbench (this));
} else {
- return false ;
+ return false;
}
- return true ;
+ return true;
}
};//end class WorkbenchModule
@@ -919,7 +919,7 @@ bool
NEMIVER_API nemiver_common_create_dynamic_module_instance (void **a_new_instance)
{
*a_new_instance = new nemiver::WorkbenchModule ();
- return (*a_new_instance != 0) ;
+ return (*a_new_instance != 0);
}
}//end extern C
diff --git a/tests/do-core.cc b/tests/do-core.cc
index d06ee5a..3738105 100644
--- a/tests/do-core.cc
+++ b/tests/do-core.cc
@@ -1,15 +1,15 @@
void foo (int a_in, char *a_str)
{
- int the_int = 0 ;
- the_int = *a_str ;
- the_int += a_in ;
+ int the_int = 0;
+ the_int = *a_str;
+ the_int += a_in;
}
int
main ()
{
char *null_str = 0;
- foo (1, null_str) ;//must core.
- return 0 ;
+ foo (1, null_str);//must core.
+ return 0;
}
diff --git a/tests/fooprog.cc b/tests/fooprog.cc
index f1be621..430af63 100644
--- a/tests/fooprog.cc
+++ b/tests/fooprog.cc
@@ -4,23 +4,23 @@
void
func1 ()
{
- int i = 0 ;
- ++i ;
+ int i = 0;
+ ++i;
}
void
func2 (int a_a, int a_b)
{
- int j = a_a ;
- ++j ;
- j = j + a_b ;
+ int j = a_a;
+ ++j;
+ j = j + a_b;
}
struct Person {
std::string m_first_name;
std::string m_family_name;
- unsigned m_age ;
+ unsigned m_age;
Person () :
m_age (0)
@@ -31,9 +31,9 @@ struct Person {
const std::string &a_family_name,
unsigned a_age)
{
- m_first_name = a_first_name ;
- m_family_name = a_family_name ;
- m_age = a_age ;
+ m_first_name = a_first_name;
+ m_family_name = a_family_name;
+ m_age = a_age;
}
const std::string& get_first_name () const {return m_first_name;}
@@ -48,29 +48,29 @@ struct Person {
void do_this ()
{
std::string foo = "something";
- foo += " good" ;
- std::string bar = " can" ;
+ foo += " good";
+ std::string bar = " can";
- foo += bar ;
+ foo += bar;
}
void overload ()
{
- int i = 0 ;
- ++i ;
+ int i = 0;
+ ++i;
}
void overload (int i)
{
- ++i ;
- i= 0 ;
+ ++i;
+ i= 0;
}
};//class Person
void
func3 (Person &a_param)
{
- a_param.do_this () ;
+ a_param.do_this ();
}
static int i,j;
@@ -88,21 +88,21 @@ int
main (int a_argc __attribute__((unused)),
char *a_argv[] __attribute__((unused)))
{
- Person person ("Bob", "Barton", 15) ;
- func1 () ;
+ Person person ("Bob", "Barton", 15);
+ func1 ();
- func2 (1, 2) ;
+ func2 (1, 2);
- person.set_first_name ("Ali") ;
- person.set_family_name ("BABA") ;
- person.do_this () ;
- person.overload () ;
- person.overload (0) ;
+ person.set_first_name ("Ali");
+ person.set_family_name ("BABA");
+ person.do_this ();
+ person.overload ();
+ person.overload (0);
- func3 (person) ;
+ func3 (person);
func4 (person);
- return 0 ;
+ return 0;
}
diff --git a/tests/inout.cc b/tests/inout.cc
index 50b6d78..27d8eec 100644
--- a/tests/inout.cc
+++ b/tests/inout.cc
@@ -5,15 +5,15 @@
int
main ()
{
- const char* tty_name = ttyname (0) ;
+ const char* tty_name = ttyname (0);
- std::cout << "tty name: " << tty_name << std::endl ;
- std::string input ;
+ std::cout << "tty name: " << tty_name << std::endl;
+ std::string input;
- std::cout << "enter a string please: " << std::flush ;
- std::cin >> input ;
- std::cout << "Got input " << input << std::endl ;
+ std::cout << "enter a string please: " << std::flush;
+ std::cin >> input;
+ std::cout << "Got input " << input << std::endl;
- return 0 ;
+ return 0;
}
diff --git a/tests/pointer-deref.cc b/tests/pointer-deref.cc
index eebd5ba..876c641 100644
--- a/tests/pointer-deref.cc
+++ b/tests/pointer-deref.cc
@@ -1,8 +1,8 @@
#include <iostream>
class baz {
- int m_a ;
- int m_b ;
+ int m_a;
+ int m_b;
public:
baz () : m_a (0), m_b(0)
@@ -30,69 +30,69 @@ public:
bar () : m_baz (0)
{
- m_baz = new baz ;
+ m_baz = new baz;
}
bar (const bar &a_bar)
{
if (this == &a_bar) {
- return ;
+ return;
}
if (!m_baz) {
- m_baz = new baz ;
+ m_baz = new baz;
}
if (!a_bar.get_baz ()) {
- return ;
+ return;
}
- *m_baz = *(a_bar.get_baz ()) ;
+ *m_baz = *(a_bar.get_baz ());
}
~bar ()
{
if (m_baz) {
delete m_baz;
- m_baz = 0 ;
+ m_baz = 0;
}
}
- baz* get_baz () const {return m_baz ;}
+ baz* get_baz () const {return m_baz;}
void set_baz (baz *a_baz)
{
if (m_baz) {
- delete m_baz ;
+ delete m_baz;
}
- m_baz = a_baz ;
+ m_baz = a_baz;
}
};//end bar
class foo {
- bar * m_bar ;
+ bar * m_bar;
public:
foo () : m_bar (0)
{
- m_bar = new bar ;
+ m_bar = new bar;
}
foo (const foo &a_foo)
{
if (this == &a_foo) {
- return ;
+ return;
}
if (!m_bar) {
- m_bar = new bar ;
+ m_bar = new bar;
}
if (!a_foo.get_bar ()) {
- return ;
+ return;
}
- *m_bar = *(a_foo.get_bar ()) ;
+ *m_bar = *(a_foo.get_bar ());
}
~foo ()
{
if (m_bar) {
- delete m_bar ;
- m_bar = 0 ;
+ delete m_bar;
+ m_bar = 0;
}
}
@@ -100,9 +100,9 @@ public:
void set_bar (bar *a_bar)
{
if (m_bar) {
- delete m_bar ;
+ delete m_bar;
}
- m_bar = a_bar ;
+ m_bar = a_bar;
}
};//end struct foo
@@ -111,8 +111,8 @@ void
change_baz (baz *a_baz)
{
if (a_baz) {
- a_baz->set_a (20) ;
- a_baz->set_b (21) ;
+ a_baz->set_a (20);
+ a_baz->set_b (21);
}
}
@@ -121,11 +121,11 @@ change_baz_ptr (baz **a_baz)
{
baz *my_baz = 0;
if (a_baz) {
- my_baz = *a_baz ;
+ my_baz = *a_baz;
}
if (my_baz) {
- my_baz->set_a (30) ;
- my_baz->set_b (31) ;
+ my_baz->set_a (30);
+ my_baz->set_b (31);
}
}
@@ -134,18 +134,18 @@ main ()
{
foo *foo_ptr = new foo;
bar *bar_ptr = new bar;
- baz *baz_ptr = new baz ;
+ baz *baz_ptr = new baz;
- baz_ptr->set_a (10) ;
- baz_ptr->set_b (11) ;
+ baz_ptr->set_a (10);
+ baz_ptr->set_b (11);
- bar_ptr->set_baz (baz_ptr) ;
- foo_ptr->set_bar (bar_ptr) ;
+ bar_ptr->set_baz (baz_ptr);
+ foo_ptr->set_bar (bar_ptr);
- change_baz (baz_ptr) ;
- change_baz_ptr (&baz_ptr) ;
+ change_baz (baz_ptr);
+ change_baz_ptr (&baz_ptr);
- delete foo_ptr ;
+ delete foo_ptr;
- return 0 ;
+ return 0;
}
diff --git a/tests/templated-var.cc b/tests/templated-var.cc
index f696b90..43e8251 100644
--- a/tests/templated-var.cc
+++ b/tests/templated-var.cc
@@ -14,11 +14,11 @@ class plot
LINE,
POINT,
BAR
- } plot_type ;
+ } plot_type;
typedef map<Tx, Ty> dataset_t;
private:
- plot_type m_type ;
+ plot_type m_type;
vector<dataset_t> m_datasets;
public:
@@ -36,24 +36,24 @@ operator<< (std::ostream &a_out, const plot<int, int> &a_plot)
{
switch (a_plot.type ()) {
case plot<int, int>::LINE :
- a_out << "plot::LINE" ;
+ a_out << "plot::LINE";
break;
case plot<int, int>::POINT :
- a_out << "plot::POINT" ;
- break ;
+ a_out << "plot::POINT";
+ break;
case plot<int, int>::BAR :
- a_out << "plot::BAR" ;
- break ;
+ a_out << "plot::BAR";
+ break;
}
- return a_out ;
+ return a_out;
}
int
main ()
{
- plot<int, int> p ;
- p.type (plot<int, int>::BAR) ;
- std::cout << p << std::endl ;
+ plot<int, int> p;
+ p.type (plot<int, int>::BAR);
+ std::cout << p << std::endl;
map<int, int> set1;
set1[0] = 0;
set1[1] = 1;
@@ -62,6 +62,6 @@ main ()
set1[4] = 4;
set1[5] = 5;
p.add_dataset(set1);
- return 0 ;
+ return 0;
}
diff --git a/tests/test-breakpoint.cc b/tests/test-breakpoint.cc
index 106c7b2..bb51b49 100644
--- a/tests/test-breakpoint.cc
+++ b/tests/test-breakpoint.cc
@@ -7,29 +7,29 @@
#include "nmv-i-debugger.h"
using namespace nemiver;
-using namespace nemiver::common ;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
-static unsigned int nb_bp = 0 ;
-static unsigned int nb_stops = 0 ;
+static unsigned int nb_bp = 0;
+static unsigned int nb_stops = 0;
void
on_engine_died_signal ()
{
- MESSAGE ("engine died") ;
- loop->quit () ;
+ MESSAGE ("engine died");
+ loop->quit ();
}
void
on_program_finished_signal ()
{
- MESSAGE ("program finished") ;
+ MESSAGE ("program finished");
MESSAGE ("nb of breakpoint hit: " << (int)nb_bp);
- BOOST_REQUIRE(nb_bp == 5) ;
- BOOST_REQUIRE(nb_stops > 5) ;
- loop->quit () ;
+ BOOST_REQUIRE(nb_bp == 5);
+ BOOST_REQUIRE(nb_stops > 5);
+ loop->quit ();
}
void
@@ -39,7 +39,7 @@ on_command_done_signal (const UString &a_command,
MESSAGE ("command done: '"
<< a_command
<< "', cookie: '"
- << a_cookie) ;
+ << a_cookie);
}
void
@@ -48,9 +48,9 @@ on_breakpoints_set_signal (const std::map<int, IDebugger::BreakPoint> &a_breaks,
{
if (a_cookie.empty ()) {}
- MESSAGE ("breakpoints set:") ;
- std::map<int, IDebugger::BreakPoint>::const_iterator it ;
- for (it = a_breaks.begin () ; it != a_breaks.end () ; ++it) {
+ MESSAGE ("breakpoints set:");
+ std::map<int, IDebugger::BreakPoint>::const_iterator it;
+ for (it = a_breaks.begin (); it != a_breaks.end () ; ++it) {
MESSAGE ("<break><num>" << it->first <<"</num><line>"
<< it->second.file_name () << ":" << it->second.line ()
<< "</line></break>");
@@ -60,14 +60,14 @@ on_breakpoints_set_signal (const std::map<int, IDebugger::BreakPoint> &a_breaks,
void
on_running_signal ()
{
- MESSAGE ("debugger running ...") ;
+ MESSAGE ("debugger running ...");
}
void
on_got_proc_info_signal (int a_pid, const UString &a_exe_path)
{
MESSAGE ("debugging program '"<< a_exe_path
- << "' of pid: '" << a_pid << "'") ;
+ << "' of pid: '" << a_pid << "'");
}
//this breakpoint condition is good because it must be satisfied
@@ -84,30 +84,30 @@ on_stopped_signal (IDebugger::StopReason a_reason,
const UString &/*a_cookie*/,
IDebuggerSafePtr &a_debugger)
{
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_debugger);
- ++nb_stops ;
+ ++nb_stops;
- MESSAGE ("stopped, reason is '" << a_reason << "'") ;
- MESSAGE ("thread-id is '" << a_thread_id) ;
+ MESSAGE ("stopped, reason is '" << a_reason << "'");
+ MESSAGE ("thread-id is '" << a_thread_id);
if (a_reason == IDebugger::BREAKPOINT_HIT) {
- ++nb_bp ;
+ ++nb_bp;
}
if (a_has_frame) {
- MESSAGE ("in frame: " << a_frame.function_name ()) ;
+ MESSAGE ("in frame: " << a_frame.function_name ());
if (a_frame.function_name () == "main") {
- a_debugger->list_threads () ;
- a_debugger->select_thread (1) ;
- MESSAGE ("continue from main") ;
- a_debugger->do_continue () ;
+ a_debugger->list_threads ();
+ a_debugger->select_thread (1);
+ MESSAGE ("continue from main");
+ a_debugger->do_continue ();
} else if (a_frame.function_name () == "func1") {
- MESSAGE ("stepping from func1") ;
- a_debugger->step_over () ;
+ MESSAGE ("stepping from func1");
+ a_debugger->step_over ();
} else if (a_frame.function_name () == "func2") {
- MESSAGE ("stepping from func2") ;
- a_debugger->step_over () ;
+ MESSAGE ("stepping from func2");
+ a_debugger->step_over ();
} else if (a_frame.function_name () == "func4") {
if (!cond_breakpoint_set) {
MESSAGE ("set conditional breakpoint with cond: "
@@ -137,7 +137,7 @@ on_stopped_signal (IDebugger::StopReason a_reason,
}
a_debugger->do_continue ();
} else {
- BOOST_FAIL ("Stopped, for an unknown reason") ;
+ BOOST_FAIL ("Stopped, for an unknown reason");
}
}
}
@@ -150,7 +150,7 @@ on_variable_type_signal (const UString &a_variable_name,
if (a_cookie.empty ()) {}
MESSAGE ("type of variable '" << a_variable_name
- << "' is '" << a_variable_type) ;
+ << "' is '" << a_variable_type);
}
void
@@ -161,9 +161,9 @@ on_threads_listed_signal (const std::list<int> &a_thread_ids,
if (a_cookie.empty ()) {}
MESSAGE ("number of threads: '" << (int)a_thread_ids.size ());
- std::list<int>::const_iterator it ;
- for (it = a_thread_ids.begin () ; it != a_thread_ids.end () ; ++it) {
- MESSAGE ("thread-id: '" << *it) ;
+ std::list<int>::const_iterator it;
+ for (it = a_thread_ids.begin (); it != a_thread_ids.end () ; ++it) {
+ MESSAGE ("thread-id: '" << *it);
}
}
@@ -174,10 +174,10 @@ on_thread_selected_signal (int a_thread_id,
{
if (a_cookie.empty ()) {}
- MESSAGE ("thread selected: '" << a_thread_id) ;
+ MESSAGE ("thread selected: '" << a_thread_id) ;
if (a_frame) {
- MESSAGE ("frame in thread : '" << a_frame->level ()) ;
- MESSAGE ("frame.function: '" << a_frame->function_name ()) ;
+ MESSAGE ("frame in thread : '" << a_frame->level ()) ;
+ MESSAGE ("frame.function: '" << a_frame->function_name ());
} else {
MESSAGE ("no frame provided");
}
@@ -186,7 +186,7 @@ on_thread_selected_signal (int a_thread_id,
void
display_help ()
{
- MESSAGE ("test-basic <prog-to-debug>\n") ;
+ MESSAGE ("test-basic <prog-to-debug>\n");
}
NEMIVER_API int
@@ -196,60 +196,60 @@ test_main (int argc, char *argv[])
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- THROW_IF_FAIL (loop) ;
+ THROW_IF_FAIL (loop);
- DynamicModuleManager module_manager ;
+ DynamicModuleManager module_manager;
IDebuggerSafePtr debugger =
module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
- debugger->set_event_loop_context (loop->get_context ()) ;
+ debugger->set_event_loop_context (loop->get_context ());
//*****************************
//<connect to IDebugger events>
//*****************************
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect
- (&on_program_finished_signal) ;
+ (&on_program_finished_signal);
- debugger->command_done_signal ().connect (&on_command_done_signal) ;
+ debugger->command_done_signal ().connect (&on_command_done_signal);
debugger->breakpoints_set_signal ().connect
- (&on_breakpoints_set_signal) ;
+ (&on_breakpoints_set_signal);
debugger->running_signal ().connect (&on_running_signal);
- debugger->got_target_info_signal ().connect (&on_got_proc_info_signal) ;
+ debugger->got_target_info_signal ().connect (&on_got_proc_info_signal);
debugger->stopped_signal ().connect
- (sigc::bind (&on_stopped_signal, debugger)) ;
+ (sigc::bind (&on_stopped_signal, debugger));
debugger->variable_type_signal ().connect
- (&on_variable_type_signal) ;
+ (&on_variable_type_signal);
debugger->threads_listed_signal ().connect
- (&on_threads_listed_signal) ;
+ (&on_threads_listed_signal);
debugger->thread_selected_signal ().connect
- (&on_thread_selected_signal) ;
+ (&on_thread_selected_signal);
//*****************************
//</connect to IDebugger events>
//*****************************
- std::vector<UString> args, source_search_dir ;
- source_search_dir.push_back (".") ;
+ std::vector<UString> args, source_search_dir;
+ source_search_dir.push_back (".");
debugger->load_program ("fooprog", args, ".", source_search_dir);
- debugger->set_breakpoint ("main") ;
- debugger->set_breakpoint ("func1") ;
- debugger->set_breakpoint ("func2") ;
- debugger->set_breakpoint ("func4") ;
- debugger->run () ;
- loop->run () ;
+ debugger->set_breakpoint ("main");
+ debugger->set_breakpoint ("func1");
+ debugger->set_breakpoint ("func2");
+ debugger->set_breakpoint ("func4");
+ debugger->run ();
+ loop->run ();
NEMIVER_CATCH_NOX
- return 0 ;
+ return 0;
}
diff --git a/tests/test-core.cc b/tests/test-core.cc
index 30e7b61..f391520 100644
--- a/tests/test-core.cc
+++ b/tests/test-core.cc
@@ -6,23 +6,23 @@
#include "nmv-i-debugger.h"
using namespace nemiver;
-using namespace nemiver::common ;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
-static int gv_cur_frame=-1 ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
+static int gv_cur_frame=-1;
void
display_help ()
{
- std::cout << "runtestcore <prog-file> <core-file>\n" ;
+ std::cout << "runtestcore <prog-file> <core-file>\n";
}
void
on_engine_died_signal ()
{
- std::cout << "engine died\n" ;
- loop->quit () ;
+ std::cout << "engine died\n";
+ loop->quit ();
}
void
@@ -33,11 +33,11 @@ on_stopped_signal (IDebugger::StopReason a_reason,
int /*bp num*/,
const UString &/*a_cookie*/)
{
- std::cout << "stopped, reason: " << (int)a_reason << " " ;
+ std::cout << "stopped, reason: " << (int)a_reason << " ";
if (a_has_frame) {
- std::cout << "in frame: " << a_frame.function_name () ;
+ std::cout << "in frame: " << a_frame.function_name ();
}
- std::cout << "thread-id: '" << a_thread_id << "'\n" ;
+ std::cout << "thread-id: '" << a_thread_id << "'\n";
}
void
on_current_frame_signal (const IDebugger::Frame &a_frame, const UString &a_cookie)
@@ -53,18 +53,18 @@ on_frames_listed_signal (const std::vector<IDebugger::Frame> &a_frames,
{
if (a_cookie.empty ()) {}
- std::cout << "frame stack list: \n" ;
- vector<IDebugger::Frame>::size_type i = 0 ;
- for (i = 0 ; i < a_frames.size () ; ++i) {
+ std::cout << "frame stack list: \n";
+ vector<IDebugger::Frame>::size_type i = 0;
+ for (i = 0; i < a_frames.size () ; ++i) {
std::cout << a_frames[i].function_name () << "() ";
if ((int) i == gv_cur_frame) {
- std::cout << "<---" ;
+ std::cout << "<---";
}
- std::cout << "\n" ;
+ std::cout << "\n";
}
- gv_cur_frame = -1 ;
- std::cout << "end of frame stack list\n" ;
- loop->quit () ;
+ gv_cur_frame = -1;
+ std::cout << "end of frame stack list\n";
+ loop->quit ();
}
@@ -79,8 +79,8 @@ on_frames_params_listed_signal
void
on_program_finished_signal ()
{
- std::cout << "program finished" ;
- loop->quit () ;
+ std::cout << "program finished";
+ loop->quit ();
}
void
@@ -99,57 +99,57 @@ int
main (int a_argc, char *a_argv[])
{
if (a_argc < 3) {
- display_help () ;
- return -1 ;
+ display_help ();
+ return -1;
}
try {
- Initializer::do_init () ;
+ Initializer::do_init ();
- THROW_IF_FAIL (loop) ;
+ THROW_IF_FAIL (loop);
- DynamicModuleManager module_manager ;
+ DynamicModuleManager module_manager;
IDebuggerSafePtr debugger =
- module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger") ;
+ module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
- debugger->set_event_loop_context (loop->get_context ()) ;
+ debugger->set_event_loop_context (loop->get_context ());
//*********************************************
//<connect to the events emited by the debugger>
//*********************************************
debugger->engine_died_signal ().connect
- (sigc::ptr_fun (&on_engine_died_signal)) ;
+ (sigc::ptr_fun (&on_engine_died_signal));
debugger->program_finished_signal ().connect
- (sigc::ptr_fun (&on_program_finished_signal)) ;
+ (sigc::ptr_fun (&on_program_finished_signal));
- debugger->stopped_signal ().connect (&on_stopped_signal) ;
+ debugger->stopped_signal ().connect (&on_stopped_signal);
- debugger->current_frame_signal ().connect (&on_current_frame_signal) ;
+ debugger->current_frame_signal ().connect (&on_current_frame_signal);
- debugger->frames_listed_signal ().connect (&on_frames_listed_signal) ;
+ debugger->frames_listed_signal ().connect (&on_frames_listed_signal);
debugger->frames_arguments_listed_signal ().connect
- (&on_frames_params_listed_signal) ;
+ (&on_frames_params_listed_signal);
debugger->console_message_signal ().connect (&on_console_message_signal);
- debugger->log_message_signal ().connect (&on_error_message_signal) ;
+ debugger->log_message_signal ().connect (&on_error_message_signal);
//*********************************************
//</connect to the events emited by the debugger>
//*********************************************
- debugger->load_core_file (a_argv[1], a_argv[2]) ;
- debugger->list_frames () ;
- loop->run () ;
+ debugger->load_core_file (a_argv[1], a_argv[2]);
+ debugger->list_frames ();
+ loop->run ();
} catch (Glib::Exception &e) {
- LOG_ERROR ("Got error: " << e.what ()) ;
- return -1 ;
+ LOG_ERROR ("Got error: " << e.what ());
+ return -1;
} catch (exception &e) {
- LOG_ERROR ("got error: " << e.what ()) ;
- return -1 ;
+ LOG_ERROR ("got error: " << e.what ());
+ return -1;
} catch (...) {
- LOG_ERROR ("got an unkown error\n") ;
+ LOG_ERROR ("got an unkown error\n");
}
- return 0 ;
+ return 0;
}
diff --git a/tests/test-cpp-lexer.cc b/tests/test-cpp-lexer.cc
index 5bdb097..e34397d 100644
--- a/tests/test-cpp-lexer.cc
+++ b/tests/test-cpp-lexer.cc
@@ -8,25 +8,25 @@
#include "langs/nmv-cpp-lexer.h"
#include "langs/nmv-cpp-lexer-utils.h"
-const char *prog = "if (foo ()) {printf (\"bar\");}" ;
-const char *prog2 = "std::list<int> > toto;" ;
+const char *prog = "if (foo ()) {printf (\"bar\");}";
+const char *prog2 = "std::list<int> > toto;";
using nemiver::cpp::Lexer;
using nemiver::cpp::Token;
-using nemiver::common::Initializer ;
+using nemiver::common::Initializer;
namespace cpp=nemiver::cpp;
void
test_lexer ()
{
- Lexer lexer (prog) ;
- Token token ;
+ Lexer lexer (prog);
+ Token token;
int i=0;
- std::cout << "going to tokenize string: \"" << prog << "\""<< std::endl ;
+ std::cout << "going to tokenize string: \"" << prog << "\""<< std::endl;
while (lexer.consume_next_token (token)) {
- ++i ;
- std::cout << "got token : " << i << ":" << token << std::endl ;
- token.clear () ;
+ ++i;
+ std::cout << "got token : " << i << ":" << token << std::endl;
+ token.clear ();
}
BOOST_REQUIRE_MESSAGE (i == 12, "got " << i << " number of tokens");
std::cout << "tokenization done okay" << std::endl;
@@ -35,20 +35,20 @@ test_lexer ()
void
test_lexer2 ()
{
- Lexer lexer (prog2) ;
- Token token ;
+ Lexer lexer (prog2);
+ Token token;
int i=0;
- std::cout << "going to tokenize string: \"" << prog2 << "\""<< std::endl ;
+ std::cout << "going to tokenize string: \"" << prog2 << "\""<< std::endl;
while (lexer.consume_next_token (token)) {
- ++i ;
- std::cout << "got token : " << i << ":" << token << std::endl ;
- token.clear () ;
+ ++i;
+ std::cout << "got token : " << i << ":" << token << std::endl;
+ token.clear ();
}
BOOST_REQUIRE_MESSAGE (i == 9, "got " << i << " number of tokens");
std::cout << "tokenization done okay" << std::endl;
}
-using boost::unit_test::test_suite ;
+using boost::unit_test::test_suite;
test_suite*
init_unit_test_suite (int argc, char** argv)
@@ -57,11 +57,11 @@ init_unit_test_suite (int argc, char** argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- test_suite *suite = BOOST_TEST_SUITE ("c++ lexer tests") ;
- suite->add (BOOST_TEST_CASE (&test_lexer)) ;
- suite->add (BOOST_TEST_CASE (&test_lexer2)) ;
+ test_suite *suite = BOOST_TEST_SUITE ("c++ lexer tests");
+ suite->add (BOOST_TEST_CASE (&test_lexer));
+ suite->add (BOOST_TEST_CASE (&test_lexer2));
return suite;
NEMIVER_CATCH_NOX
diff --git a/tests/test-cpp-parser.cc b/tests/test-cpp-parser.cc
index 6b643c9..1d3dca5 100644
--- a/tests/test-cpp-parser.cc
+++ b/tests/test-cpp-parser.cc
@@ -9,10 +9,10 @@
#include "langs/nmv-cpp-ast-utils.h"
#define TAB_LEN(tab) (sizeof (tab)/sizeof (tab[0]))
-const char *prog0 = "foo bar" ;
-const char *prog1 = "foo *bar" ;
-const char *prog1_1 = "foo bar[10]" ;
-const char *prog2 = "const foo *bar" ;
+const char *prog0 = "foo bar";
+const char *prog1 = "foo *bar";
+const char *prog1_1 = "foo bar[10]";
+const char *prog2 = "const foo *bar";
const char* test3_inputs[] = {
"const char *std::__num_base::_S_atoms_in",
@@ -103,7 +103,7 @@ using nemiver::cpp::LogOrExprPtr;
using nemiver::cpp::CondExprPtr;
using nemiver::cpp::ExprPtr;
using nemiver::cpp::TemplateIDPtr;
-using nemiver::common::Initializer ;
+using nemiver::common::Initializer;
namespace cpp=nemiver::cpp;
void
@@ -315,7 +315,7 @@ test_parser7 ()
}
}
-using boost::unit_test::test_suite ;
+using boost::unit_test::test_suite;
test_suite*
init_unit_test_suite (int argc, char** argv)
@@ -324,17 +324,17 @@ init_unit_test_suite (int argc, char** argv)
NEMIVER_TRY
- Initializer::do_init () ;
-
- test_suite *suite = BOOST_TEST_SUITE ("c++ lexer tests") ;
- suite->add (BOOST_TEST_CASE (&test_parser0)) ;
- suite->add (BOOST_TEST_CASE (&test_parser1)) ;
- suite->add (BOOST_TEST_CASE (&test_parser2)) ;
- suite->add (BOOST_TEST_CASE (&test_parser3)) ;
- suite->add (BOOST_TEST_CASE (&test_parser4)) ;
- suite->add (BOOST_TEST_CASE (&test_parser5)) ;
- suite->add (BOOST_TEST_CASE (&test_parser6)) ;
- suite->add (BOOST_TEST_CASE (&test_parser7)) ;
+ Initializer::do_init ();
+
+ test_suite *suite = BOOST_TEST_SUITE ("c++ lexer tests");
+ suite->add (BOOST_TEST_CASE (&test_parser0));
+ suite->add (BOOST_TEST_CASE (&test_parser1));
+ suite->add (BOOST_TEST_CASE (&test_parser2));
+ suite->add (BOOST_TEST_CASE (&test_parser3));
+ suite->add (BOOST_TEST_CASE (&test_parser4));
+ suite->add (BOOST_TEST_CASE (&test_parser5));
+ suite->add (BOOST_TEST_CASE (&test_parser6));
+ suite->add (BOOST_TEST_CASE (&test_parser7));
return suite;
NEMIVER_CATCH_NOX
diff --git a/tests/test-cpptrait.cc b/tests/test-cpptrait.cc
index 083727d..511342a 100644
--- a/tests/test-cpptrait.cc
+++ b/tests/test-cpptrait.cc
@@ -4,10 +4,10 @@
#include "nmv-i-lang-trait.h"
#include "nmv-i-debugger.h"
-using namespace std ;
+using namespace std;
using nemiver::common::Initializer;
-using nemiver::common::DynamicModuleManager ;
-using nemiver::ILangTraitSafePtr ;
+using nemiver::common::DynamicModuleManager;
+using nemiver::ILangTraitSafePtr;
using nemiver::ILangTrait;
void test_load_dynmod ()
@@ -16,7 +16,7 @@ void test_load_dynmod ()
DynamicModuleManager::load_iface_with_default_manager<ILangTrait>
("cpptrait",
"ILangTrait");
- //BOOST_REQUIRE (trait) ;
+ //BOOST_REQUIRE (trait);
}
void test_name ()
@@ -25,7 +25,7 @@ void test_name ()
DynamicModuleManager::load_iface_with_default_manager<ILangTrait>
("cpptrait",
"ILangTrait");
- BOOST_REQUIRE (trait->get_name () == "cpptrait") ;
+ BOOST_REQUIRE (trait->get_name () == "cpptrait");
}
void test_is_pointer ()
@@ -34,41 +34,41 @@ void test_is_pointer ()
DynamicModuleManager::load_iface_with_default_manager<ILangTrait>
("cpptrait",
"ILangTrait");
- BOOST_REQUIRE (trait->has_pointers () == true) ;
+ BOOST_REQUIRE (trait->has_pointers () == true);
- BOOST_REQUIRE (trait->is_type_a_pointer ("char *")) ;
- BOOST_REQUIRE (trait->is_type_a_pointer ("AType * const")) ;
+ BOOST_REQUIRE (trait->is_type_a_pointer ("char *"));
+ BOOST_REQUIRE (trait->is_type_a_pointer ("AType * const"));
}
void test_debugger ()
{
- using nemiver::IDebugger ;
- using nemiver::IDebuggerSafePtr ;
+ using nemiver::IDebugger;
+ using nemiver::IDebuggerSafePtr;
IDebuggerSafePtr debugger =
DynamicModuleManager::load_iface_with_default_manager<IDebugger>
- ("gdbengine", "IDebugger") ;
- BOOST_REQUIRE (debugger) ;
- ILangTrait &trait = debugger->get_language_trait () ;
- BOOST_REQUIRE (trait.get_name () == "cpptrait") ;
+ ("gdbengine", "IDebugger");
+ BOOST_REQUIRE (debugger);
+ ILangTrait &trait = debugger->get_language_trait ();
+ BOOST_REQUIRE (trait.get_name () == "cpptrait");
}
-using boost::unit_test::test_suite ;
+using boost::unit_test::test_suite;
NEMIVER_API test_suite*
init_unit_test_suite (int, char **)
{
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- test_suite *suite = BOOST_TEST_SUITE ("cpp language trait tests") ;
- suite->add (BOOST_TEST_CASE (&test_load_dynmod)) ;
- suite->add (BOOST_TEST_CASE (&test_name)) ;
- suite->add (BOOST_TEST_CASE (&test_is_pointer)) ;
- suite->add (BOOST_TEST_CASE (&test_debugger)) ;
- return suite ;
+ test_suite *suite = BOOST_TEST_SUITE ("cpp language trait tests");
+ suite->add (BOOST_TEST_CASE (&test_load_dynmod));
+ suite->add (BOOST_TEST_CASE (&test_name));
+ suite->add (BOOST_TEST_CASE (&test_is_pointer));
+ suite->add (BOOST_TEST_CASE (&test_debugger));
+ return suite;
NEMIVER_CATCH_NOX
- return 0 ;
+ return 0;
}
diff --git a/tests/test-deref.cc b/tests/test-deref.cc
index 5901867..bb4787d 100644
--- a/tests/test-deref.cc
+++ b/tests/test-deref.cc
@@ -5,16 +5,16 @@
#include "nmv-i-lang-trait.h"
#include "common/nmv-initializer.h"
-using namespace nemiver ;
-using namespace nemiver::common ;
-using namespace sigc ;
+using namespace nemiver;
+using namespace nemiver::common;
+using namespace sigc;
static Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
-static int nb_stops = 0 ;
-static int nb_derefed = 0 ;
-static int nb_type_set = 0 ;
+static int nb_stops = 0;
+static int nb_derefed = 0;
+static int nb_type_set = 0;
void
on_variable_derefed_signal (const IDebugger::VariableSafePtr &a_var,
@@ -22,24 +22,24 @@ on_variable_derefed_signal (const IDebugger::VariableSafePtr &a_var,
IDebuggerSafePtr a_debugger)
{
if (a_cookie.empty ()) {/*keep compiler happy*/}
- BOOST_REQUIRE (a_var) ;
+ BOOST_REQUIRE (a_var);
- BOOST_REQUIRE (a_var->is_dereferenced ()) ;
+ BOOST_REQUIRE (a_var->is_dereferenced ());
MESSAGE ("derefed '" << a_var->name () << "', got '"
<< a_var->get_dereferenced ()->name ()
- << "'") ;
- ++nb_derefed ;
+ << "'");
+ ++nb_derefed;
if (a_var->name () == "foo_ptr") {
- BOOST_REQUIRE (a_var->get_dereferenced ()->members ().size () == 1) ;
+ BOOST_REQUIRE (a_var->get_dereferenced ()->members ().size () == 1);
} else if (a_var->name () == "bar_ptr") {
BOOST_REQUIRE
- (a_var->get_dereferenced ()->members ().size () == 1) ;
+ (a_var->get_dereferenced ()->members ().size () == 1);
} else if (a_var->name () == "baz_ptr") {
BOOST_REQUIRE
- (a_var->get_dereferenced ()->members ().size () == 2) ;
+ (a_var->get_dereferenced ()->members ().size () == 2);
}
- a_debugger->step_over () ;
+ a_debugger->step_over ();
}
void
@@ -49,18 +49,18 @@ on_variable_value_signal (const UString &a_var_name,
const IDebuggerSafePtr &a_debugger)
{
if (a_cookie.empty () || a_var_name.empty ()) {/*keep compiler happy*/}
- BOOST_REQUIRE (a_debugger && a_var) ;
- BOOST_REQUIRE (a_var->name () == a_var_name) ;
+ BOOST_REQUIRE (a_debugger && a_var);
+ BOOST_REQUIRE (a_var->name () == a_var_name);
- MESSAGE ("got variable '" << a_var->name () << "'") ;
+ MESSAGE ("got variable '" << a_var->name () << "'");
if (a_var_name == "foo_ptr" ||
a_var_name == "bar_ptr" ||
a_var_name == "baz_ptr") {
- a_debugger->get_variable_type (a_var) ;
+ a_debugger->get_variable_type (a_var);
} else {
UString msg = "Got variable name " + a_var_name;
- BOOST_FAIL (msg.c_str ()) ;
+ BOOST_FAIL (msg.c_str ());
}
}
@@ -71,25 +71,25 @@ on_variable_type_set_signal (const IDebugger::VariableSafePtr &a_var,
{
if (!a_cookie.empty ()) {}
- BOOST_REQUIRE (a_var) ;
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_var);
+ BOOST_REQUIRE (a_debugger);
- ++nb_type_set ;
+ ++nb_type_set;
MESSAGE ("got type of var set '" << a_var->name () << "':'"
- << a_var->type () << ":") ;
+ << a_var->type () << ":");
if (a_var->name () == "foo_ptr" ||
a_var->name () == "bar_ptr" ||
a_var->name () == "baz_ptr") {
- ILangTrait &lang_trait = a_debugger->get_language_trait () ;
- BOOST_REQUIRE (lang_trait.get_name () == "cpptrait") ;
- BOOST_REQUIRE (lang_trait.has_pointers ()) ;
- BOOST_REQUIRE (lang_trait.is_type_a_pointer (a_var->type ())) ;
- a_debugger->dereference_variable (a_var) ;
+ ILangTrait &lang_trait = a_debugger->get_language_trait ();
+ BOOST_REQUIRE (lang_trait.get_name () == "cpptrait");
+ BOOST_REQUIRE (lang_trait.has_pointers ());
+ BOOST_REQUIRE (lang_trait.is_type_a_pointer (a_var->type ()));
+ a_debugger->dereference_variable (a_var);
} else {
UString msg = "Got variable name: "+ a_var->name ();
- BOOST_FAIL (msg.c_str ()) ;
+ BOOST_FAIL (msg.c_str ());
}
}
void
@@ -101,25 +101,25 @@ on_stopped_signal (IDebugger::StopReason a_reason,
const UString &/*a_cookie*/,
IDebuggerSafePtr &a_debugger)
{
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_debugger);
if (a_reason == IDebugger::EXITED_NORMALLY) {
loop->quit ();
- BOOST_REQUIRE (nb_derefed == 3) ;
- BOOST_REQUIRE (nb_type_set == 3) ;
+ BOOST_REQUIRE (nb_derefed == 3);
+ BOOST_REQUIRE (nb_type_set == 3);
return;
}
++nb_stops;
if (a_has_frame && a_frame.function_name () == "main" && nb_stops == 4) {
- a_debugger->print_variable_value ("foo_ptr") ;
- a_debugger->print_variable_value ("bar_ptr") ;
- a_debugger->print_variable_value ("baz_ptr") ;
+ a_debugger->print_variable_value ("foo_ptr");
+ a_debugger->print_variable_value ("bar_ptr");
+ a_debugger->print_variable_value ("baz_ptr");
} else if (a_frame.function_name () == "main") {
if (nb_stops < 8) {
- a_debugger->step_over () ;
+ a_debugger->step_over ();
} else {
- a_debugger->do_continue () ;
+ a_debugger->do_continue ();
}
}
}
@@ -131,35 +131,35 @@ test_main (int argc, char **argv)
NEMIVER_TRY
- Initializer::do_init () ;
- BOOST_REQUIRE (loop) ;
+ Initializer::do_init ();
+ BOOST_REQUIRE (loop);
IDebuggerSafePtr debugger =
DynamicModuleManager::load_iface_with_default_manager<IDebugger>
("gdbengine",
- "IDebugger") ;
+ "IDebugger");
//setup the debugger with the glib mainloop
- debugger->set_event_loop_context (Glib::MainContext::get_default ()) ;
+ debugger->set_event_loop_context (Glib::MainContext::get_default ());
debugger->stopped_signal ().connect (sigc::bind
- (&on_stopped_signal, debugger)) ;
+ (&on_stopped_signal, debugger));
debugger->variable_value_signal ().connect (sigc::bind
- (&on_variable_value_signal, debugger)) ;
+ (&on_variable_value_signal, debugger));
debugger->variable_type_set_signal ().connect (sigc::bind
- (&on_variable_type_set_signal, debugger)) ;
+ (&on_variable_type_set_signal, debugger));
debugger->variable_dereferenced_signal ().connect
(sigc::bind (&on_variable_derefed_signal,
- debugger)) ;
+ debugger));
vector<UString> args;
- debugger->load_program (".libs/pointerderef", args, ".") ;
- debugger->set_breakpoint ("main") ;
- debugger->run () ;
+ debugger->load_program (".libs/pointerderef", args, ".");
+ debugger->set_breakpoint ("main");
+ debugger->run ();
- loop->run () ;
+ loop->run ();
NEMIVER_CATCH_AND_RETURN_NOX(-1)
- return 0 ;
+ return 0;
}
diff --git a/tests/test-env.cc b/tests/test-env.cc
index 461f235..c16e4cf 100644
--- a/tests/test-env.cc
+++ b/tests/test-env.cc
@@ -28,10 +28,10 @@ init_unit_test_suite (int argc, char** argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- test_suite *suite = BOOST_TEST_SUITE ("nemiver env tests") ;
- suite->add (BOOST_TEST_CASE (&test_build_path_to_help_file)) ;
+ test_suite *suite = BOOST_TEST_SUITE ("nemiver env tests");
+ suite->add (BOOST_TEST_CASE (&test_build_path_to_help_file));
return suite;
NEMIVER_CATCH_NOX
diff --git a/tests/test-gdbmi.cc b/tests/test-gdbmi.cc
index f2333ce..f81996b 100644
--- a/tests/test-gdbmi.cc
+++ b/tests/test-gdbmi.cc
@@ -5,18 +5,18 @@
#include "common/nmv-exception.h"
#include "common/nmv-initializer.h"
-using namespace std ;
-using namespace nemiver ;
+using namespace std;
+using namespace nemiver;
-static const char* gv_str0 = "\"abracadabra\"" ;
-static const char* gv_str1 = "\"/home/dodji/misc/no\\303\\253l-\\303\\251-\\303\\240/test.c\"" ;
-static const char* gv_str2 = "\"No symbol \\\"events_ecal\\\" in current context.\\n\"" ;
+static const char* gv_str0 = "\"abracadabra\"";
+static const char* gv_str1 = "\"/home/dodji/misc/no\\303\\253l-\\303\\251-\\303\\240/test.c\"";
+static const char* gv_str2 = "\"No symbol \\\"events_ecal\\\" in current context.\\n\"";
-static const char* gv_attrs0 = "msg=\"No symbol \\\"g_return_if_fail\\\" in current context.\"" ;
-static const char* gv_attrs1 = "script=[\"silent\",\"return\"]" ;
+static const char* gv_attrs0 = "msg=\"No symbol \\\"g_return_if_fail\\\" in current context.\"";
+static const char* gv_attrs1 = "script=[\"silent\",\"return\"]";
static const char* gv_stopped_async_output0 =
-"*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"1\",frame={addr=\"0x0804afb0\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value=\"0xbfc79ed4\"}],file=\"today-main.c\",fullname=\"/home/dodji/devel/gitstore/omoko.git/applications/openmoko-today/src/today-main.c\",line=\"285\"}\n" ;
+"*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"1\",frame={addr=\"0x0804afb0\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value=\"0xbfc79ed4\"}],file=\"today-main.c\",fullname=\"/home/dodji/devel/gitstore/omoko.git/applications/openmoko-today/src/today-main.c\",line=\"285\"}\n";
static const char* gv_stopped_async_output1 =
"*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"1\",frame={addr=\"0x08048d38\",func=\"main\",args=[],file=\"fooprog.cc\",fullname=\"/opt/dodji/git/nemiver.git/tests/fooprog.cc\",line=\"80\"}\n";
@@ -67,7 +67,7 @@ static const char *gv_stack0 =
// the partial result of a gdbmi command: -stack-list-argument 1 command
// this command is used to implement IDebugger::list_frames_arguments()
static const char* gv_stack_arguments0 =
-"stack-args=[frame={level=\"0\",args=[{name=\"a_param\",value=\"(Person &) @0xbf88fad4: {m_first_name = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x804b144 \\\"Ali\\\"}}, m_family_name = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x804b12c \\\"BABA\\\"}}, m_age = 15}\"}]},frame={level=\"1\",args=[]}]" ;
+"stack-args=[frame={level=\"0\",args=[{name=\"a_param\",value=\"(Person &) @0xbf88fad4: {m_first_name = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x804b144 \\\"Ali\\\"}}, m_family_name = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x804b12c \\\"BABA\\\"}}, m_age = 15}\"}]},frame={level=\"1\",args=[]}]";
static const char* gv_local_vars =
"locals=[{name=\"person\",type=\"Person\"}]";
@@ -77,12 +77,12 @@ static const char* gv_emb_str =
;
static const char* gv_member_var =
-"{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8048ce1 \"\\311\\303\\220U\\211\\345S\\203\\354\\024\\213E\\b\\211\\004$\\350\\202\\373\\377\\377\\213E\\b\\203\\300\\004\\211\\004$\\350t\\373\\377\\377\\213U\\b\\213E\\f\\211D$\\004\\211\\024$\\350\\002\\373\\377\\377\\213U\\b\\203\\302\\004\\213E\\020\\211D$\\004\\211\\024$\\350\\355\\372\\377\\377\\213U\\b\\213E\\024\\211B\\b\\3538\\211E\\370\\213]\\370\\213E\\b\\203\\300\\004\\211\\004$\\350\\276\\372\\377\\377\\211]\\370\\353\\003\\211E\\370\\213]\\370\\213E\\b\\211\\004$\\350\\250\\372\\377\\377\\211]\\370\\213E\\370\\211\\004$\\350\\032\\373\\377\\377\\203\\304\\024[]\\303U\\211\\345S\\203\\354$\\215E\\372\\211\\004$\\350\\\"\\373\\377\\377\\215E\\372\\211D$\\b\\307D$\\004\\370\\217\\004\\b\\215E\\364\\211\\004$\\350\\230\\372\\377\\377\\215E\\372\\211\\004$\\350}\\372\"...}}" ;
+"{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8048ce1 \"\\311\\303\\220U\\211\\345S\\203\\354\\024\\213E\\b\\211\\004$\\350\\202\\373\\377\\377\\213E\\b\\203\\300\\004\\211\\004$\\350t\\373\\377\\377\\213U\\b\\213E\\f\\211D$\\004\\211\\024$\\350\\002\\373\\377\\377\\213U\\b\\203\\302\\004\\213E\\020\\211D$\\004\\211\\024$\\350\\355\\372\\377\\377\\213U\\b\\213E\\024\\211B\\b\\3538\\211E\\370\\213]\\370\\213E\\b\\203\\300\\004\\211\\004$\\350\\276\\372\\377\\377\\211]\\370\\353\\003\\211E\\370\\213]\\370\\213E\\b\\211\\004$\\350\\250\\372\\377\\377\\211]\\370\\213E\\370\\211\\004$\\350\\032\\373\\377\\377\\203\\304\\024[]\\303U\\211\\345S\\203\\354$\\215E\\372\\211\\004$\\350\\\"\\373\\377\\377\\215E\\372\\211D$\\b\\307D$\\004\\370\\217\\004\\b\\215E\\364\\211\\004$\\350\\230\\372\\377\\377\\215E\\372\\211\\004$\\350}\\372\"...}}";
-static const char* gv_member_var2 = "{<com::sun::star::uno::BaseReference> = {_pInterface = 0x86a4834}, <No data fields>}" ;
+static const char* gv_member_var2 = "{<com::sun::star::uno::BaseReference> = {_pInterface = 0x86a4834}, <No data fields>}";
-static const char* gv_var_with_member = "value=\"{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8048ce1 \"\\311\\303\\220U\\211\\345S\\203\\354\\024\\213E\\b\\211\\004$\\350\\202\\373\\377\\377\\213E\\b\\203\\300\\004\\211\\004$\\350t\\373\\377\\377\\213U\\b\\213E\\f\\211D$\\004\\211\\024$\\350\\002\\373\\377\\377\\213U\\b\\203\\302\\004\\213E\\020\\211D$\\004\\211\\024$\\350\\355\\372\\377\\377\\213U\\b\\213E\\024\\211B\\b\\3538\\211E\\370\\213]\\370\\213E\\b\\203\\300\\004\\211\\004$\\350\\276\\372\\377\\377\\211]\\370\\353\\003\\211E\\370\\213]\\370\\213E\\b\\211\\004$\\350\\250\\372\\377\\377\\211]\\370\\213E\\370\\211\\004$\\350\\032\\373\\377\\377\\203\\304\\024[]\\303U\\211\\345S\\203\\354$\\215E\\372\\211\\004$\\350\\\"\\373\\377\\377\\215E\\372\\211D$\\b\\307D$\\004\\370\\217\\004\\b\\215E\\364\\211\\004$\\350\\230\\372\\377\\377\\215E\\372\\211\\004$\\350}\\372\"
...}}\"" ;
+static const char* gv_var_with_member = "value=\"{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8048ce1 \"\\311\\303\\220U\\211\\345S\\203\\354\\024\\213E\\b\\211\\004$\\350\\202\\373\\377\\377\\213E\\b\\203\\300\\004\\211\\004$\\350t\\373\\377\\377\\213U\\b\\213E\\f\\211D$\\004\\211\\024$\\350\\002\\373\\377\\377\\213U\\b\\203\\302\\004\\213E\\020\\211D$\\004\\211\\024$\\350\\355\\372\\377\\377\\213U\\b\\213E\\024\\211B\\b\\3538\\211E\\370\\213]\\370\\213E\\b\\203\\300\\004\\211\\004$\\350\\276\\372\\377\\377\\211]\\370\\353\\003\\211E\\370\\213]\\370\\213E\\b\\211\\004$\\350\\250\\372\\377\\377\\211]\\370\\213E\\370\\211\\004$\\350\\032\\373\\377\\377\\203\\304\\024[]\\303U\\211\\345S\\203\\354$\\215E\\372\\211\\004$\\350\\\"\\373\\377\\377\\215E\\372\\211D$\\b\\307D$\\004\\370\\217\\004\\b\\215E\\364\\211\\004$\\350\\230\\372\\377\\377\\215E\\372\\211\\004$\\350}\\372\"
...}}\"";
static const char *gv_var_with_member2 = "value=\"{filePos = 393216, ptr = 0xbf83c3f4 \\\"q\\\\354p1i\\\\233w\\\\310\\\\270R\\\\376\\\\325-\\\\266\\\\235$Qy\\\\212\\\\371\\\\373;|\\\\271\\\\031\\\\311\\\\355\\\\223]K\\\\031x4\\\\374\\\\217z\\\\272\\\\366t\\\\037\\\\2237'\\\\324S\\\\354\\\\321\\\\306\\\\020\\\\233\\\\202>y\\\\024\\\\365\\\\250\\\\\\\"\\\\271\\\\275(D\\\\267\\\\022\\\\205\\\\330B\\\\200\\\\371\\\\371k/\\\\252S\\\\204[\\\\265\\\\373\\\\036\\\\025\\\\fC\\\\251Y\\\\312\\\\333\\\\225\\\\231\\\\247$\\\\024-\\\\273\\\\035KsZV\\\\217r\\\\320I\\\\031gb\\\\347\\\\0371\\\\347\\\\374\\\\361I\\\\323\\\\204\\\\254\\\\337A\\\\271\\\\250\\\\302O\\\\271c)\\\\004\\\\211\\\\r\\\\303\\\\252\\\\273\\\\377\\\", limit = 0xbf85c3f4 \\\"\\\\310\\\\243\\\\020\\\\b\\\\330\\\\274\\\\021\\\\b\\\\f9\\\\020\\\\b\\\\f9\\\\020\\\\b\\\\344\\\\274\\\\022\\\\b\\\\377\\\\355\\\", len = 131072, data = {113 'q', 236 '\\\\354', 112 'p', 49 '1', 105 'i', 155 '\\\\233', 119 'w', 200 '\\\\310', 184 '\
\\\270', 82 'R', 254 '\\\\376', 213 '\\\\325', 45 '-', 182 '\\\\266', 157 '\\\\235', 36 '$', 81 'Q', 121 'y', 138 '\\\\212', 249 '\\\\371', 251 '\\\\373', 59 ';', 124 '|', 185 '\\\\271', 25 '\\\\031', 201 '\\\\311', 237 '\\\\355', 147 '\\\\223', 93 ']', 75 'K', 25 '\\\\031', 120 'x', 52 '4', 252 '\\\\374', 143 '\\\\217', 122 'z', 186 '\\\\272', 246 '\\\\366', 116 't', 31 '\\\\037', 147 '\\\\223', 55 '7', 39 '\\\\'', 212 '\\\\324', 83 'S', 236 '\\\\354', 209 '\\\\321', 198 '\\\\306', 16 '\\\\020', 155 '\\\\233', 130 '\\\\202', 62 '>', 121 'y', 20 '\\\\024', 245 '\\\\365', 168 '\\\\250', 34 '\\\"', 185 '\\\\271', 189 '\\\\275', 40 '(', 68 'D', 183 '\\\\267', 18 '\\\\022', 133 '\\\\205', 216 '\\\\330', 66 'B', 128 '\\\\200', 249 '\\\\371', 249 '\\\\371', 107 'k', 47 '/', 170 '\\\\252', 83 'S', 132 '\\\\204', 91 '[', 181 '\\\\265', 251 '\\\\373', 30 '\\\\036', 21 '\\\\025', 12 '\\\\f', 67 'C', 169 '\\\\251', 89 'Y', 202 '\\\\312', 219 '\\\\333', 149 '\\\\225', 153 '\\\\231', 167
'\\\\247', 36 '$', 20 '\\\\024', 45 '-', 187 '\\\\273', 29 '\\\\035', 75 'K', 115 's', 90 'Z', 86 'V', 143 '\\\\217', 114 'r', 208 '\\\\320', 73 'I', 25 '\\\\031', 103 'g', 98 'b', 231 '\\\\347', 31 '\\\\037', 49 '1', 231 '\\\\347', 252 '\\\\374', 241 '\\\\361', 73 'I', 211 '\\\\323', 132 '\\\\204', 172 '\\\\254', 223 '\\\\337', 65 'A', 185 '\\\\271', 168 '\\\\250', 194 '\\\\302', 79 'O', 185 '\\\\271', 99 'c', 41 ')', 4 '\\\\004', 137 '\\\\211', 13 '\\\\r', 195 '\\\\303', 170 '\\\\252', 187 '\\\\273', 255 '\\\\377', 0 '\\\\0', 171 '\\\\253', 76 'L', 245 '\\\\365', 197 '\\\\305', 75 'K', 102 'f', 52 '4', 219 '\\\\333', 125 '}', 70 'F', 1 '\\\\001', 168 '\\\\250', 151 '\\\\227', 88 'X', 94 '^', 64 '@', 120 'x', 78 'N', 74 'J', 247 '\\\\367', 192 '\\\\300', 239 '\\\\357', 87 'W', 90 'Z', 85 'U', 35 '#', 23 '\\\\027', 202 '\\\\312', 190 '\\\\276', 37 '%', 160 '\\\\240', 158 '\\\\236', 95 '_', 81 'Q', 197 '\\\\305', 74 'J', 221 '\\\\335', 207 '\\\\317', 219 '\\\\333', 191 '\\\\
277', 216 '\\\\330', 145 '\\\\221', 188 '\\\\274', 59 ';', 15 '\\\\017', 193 '\\\\301', 223 '\\\\337', 22 '\\\\026', 92 '\\\\\\\\', 248 '\\\\370', 83 'S', 69 'E', 254 '\\\\376', 215 '\\\\327', 191 '\\\\277', 215 '\\\\327', 53 '5', 47 '/', 179 '\\\\263', 177 '\\\\261', 212 '\\\\324', 192 '\\\\300', 138 '\\\\212', 37 '%', 85 'U', 81 'Q', 176 '\\\\260', 243 '\\\\363', 193 '\\\\301'...}}\"";
static const char *gv_var_with_member3 = "value=\"{<Gtk::Window> = {<Gtk::Bin> = {<Gtk::Container> = {<Gtk::Widget> = {<Gtk::Object> = {<Glib::Object> = {<Glib::ObjectBase> = {<sigc::trackable> = {callback_list_ = 0xb73e1ff4}, _vptr.ObjectBase = 0xb73e1ff4, gobject_ = 0x8051643, custom_type_name_ = 0x8050ef0 \\\"U\\\\211\\\\345WVS\\\\350O\\\", cpp_destruction_in_progress_ = 200}, _vptr.Object = 0xb73e1ff4, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, referenced_ = 67, gobject_disposed_ = 22}, <Atk::Implementor> = {<Glib::Interface> = {_vptr.Interface = 0x8050ef0}, static implementor_class_ = {<Glib::Interface_Class> = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, <No data fields>}}, static widget_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static container_class_ = {<G
lib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static bin_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static window_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, accel_group_ = {pCppObject_ = 0xbfd83fc8}}, m_VBox = {<Gtk::Box> = {<Gtk::Container> = {<Gtk::Widget> = {<Gtk::Object> = {<Glib::Object> = {<Glib::ObjectBase> = <invalid address>, _vptr.Object = 0xb7390906, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, referenced_ = 67, gobject_disposed_ = 22}, <Atk::Implementor> = {<Glib::Interface> = {_vptr.Interface = 0x805164b}, static implementor_class_ = {<Glib::Interface_Class> = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, <No data fields>}}, static widget_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_
= 0}, <No data fields>}}, static container_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static box_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, children_proxy_ = {<Glib::HelperList<Gtk::Box_Helpers::Child,const Gtk::Box_Helpers::Element,Glib::List_Iterator<Gtk::Box_Helpers::Child> >> = {_vptr.HelperList = 0xbfd83fff, gparent_ = 0xb73e1f00}, <No data fields>}}, static vbox_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, m_MyWidget = {<Gtk::Widget> = {<Gtk::Object> = {<Glib::Object> = {<Glib::ObjectBase> = <invalid address>, _vptr.Object = 0xb71aaf55, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, referenced_ = 172, gobject_disposed_ = 54}, <Atk::Implementor> = {<Glib::Interface> = {_vptr.Interface = 0x8056200}, static implementor
_class_ = {<Glib::Interface_Class> = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, <No data fields>}}, static widget_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, m_refGdkWindow = {pCppObject_ = 0xb7b3ed64}, m_scale = -1209413632}, m_ButtonBox = {<Gtk::ButtonBox> = {<Gtk::Box> = {<Gtk::Container> = {<Gtk::Widget> = {<Gtk::Object> = {<Glib::Object> = {<Glib::ObjectBase> = <invalid address>, _vptr.Object = 0xb71ab0d0, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static object_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, referenced_ = 20, gobject_disposed_ = 65}, <Atk::Implementor> = {<Glib::Interface> = {_vptr.Interface = 0xb7fdace0}, static implementor_class_ = {<Glib::Interface_Class> = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, <No data fields>}}, static widget_class_ = {<Glib::Class> = {gtype_ = 0,
class_init_func_ = 0}, <No data fields>}}, static container_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static box_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}, children_proxy_ = {<Glib::HelperList<Gtk::Box_Helpers::Child,const Gtk::Box_Helpers::Element,Glib::List_Iterator<Gtk::Box_Helpers::Child> >> = {_vptr.HelperList = 0xbfd84028, gparent_ = 0x804da59}, <No data fields>}}, static buttonbox_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, static hbuttonbox_class_ = {<Glib::Class> = {gtype_ = 0, class_init_func_ = 0}, <No data fields>}}, m_Button_Quit = {<Gtk::Bin> = {<Gtk::Container> = {<Gtk::Widget> = {<Gtk::Object> = {<Glib::Object> = {<error reading variable>}\"";
@@ -101,7 +101,7 @@ static const char *gv_var_with_member8 = "value=\"{member = 0x40085e <my_func(vo
static const char *gv_var_with_comma = "value=\"0x40085e <my_func(void*, void*)>\"";
static const char* gv_stack_arguments1 =
-"stack-args=[frame={level=\"0\",args=[{name=\"a_comp\",value=\"(icalcomponent *) 0x80596f8\"},{name=\"a_entry\",value=\"(MokoJEntry **) 0xbfe02178\"}]},frame={level=\"1\",args=[{name=\"a_view\",value=\"(ECalView *) 0x804ba60\"},{name=\"a_entries\",value=\"(GList *) 0x8054930\"},{name=\"a_journal\",value=\"(MokoJournal *) 0x8050580\"}]},frame={level=\"2\",args=[{name=\"closure\",value=\"(GClosure *) 0x805a010\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe023cc\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe022dc\"},{name=\"marshal_data\",value=\"(gpointer) 0xb7f9a146\"}]},frame={level=\"3\",args=[{name=\"closure\",value=\"(GClosure *) 0x805a010\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe023cc\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe022dc\"}]},frame={level=\"4\",ar
gs=[{name=\"node\",value=\"(SignalNode *) 0x80599c8\"},{name=\"detail\",value=\"0\"},{name=\"instance\",value=\"(gpointer) 0x804ba60\"},{name=\"emission_return\",value=\"(GValue *) 0x0\"},{name=\"instance_and_params\",value=\"(const GValue *) 0xbfe023cc\"}]},frame={level=\"5\",args=[{name=\"instance\",value=\"(gpointer) 0x804ba60\"},{name=\"signal_id\",value=\"18\"},{name=\"detail\",value=\"0\"},{name=\"var_args\",value=\"0xbfe02610 \\\"\\\\300\\\\365\\\\004\\\\b\\\\020,\\\\340\\\\277\\\\370\\\\024[\\\\001\\\\360\\\\226i\\\\267\\\\320`\\\\234\\\\267\\\\200\\\\237\\\\005\\\\bX&\\\\340\\\\277\\\\333cg\\\\267\\\\200{\\\\005\\\\b0I\\\\005\\\\b`\\\\272\\\\004\\\\b\\\\002\\\"\"}]},frame={level=\"6\",args=[{name=\"instance\",value=\"(gpointer) 0x804ba60\"},{name=\"signal_id\",value=\"18\"},{name=\"detail\",value=\"0\"}]},frame={level=\"7\",args=[{name=\"listener\",value=\"(ECalViewListener *) 0x8057b80\"},{name=\"objects\",value=\"(GList *) 0x8054930\"},{name=\"data\",value=\"(gpoi
nter) 0x804ba60\"}]},frame={level=\"8\",args=[{name=\"closure\",value=\"(GClosure *) 0x8059f80\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe0286c\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe0277c\"},{name=\"marshal_data\",value=\"(gpointer) 0xb79c60d0\"}]},frame={level=\"9\",args=[{name=\"closure\",value=\"(GClosure *) 0x8059f80\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe0286c\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe0277c\"}]},frame={level=\"10\",args=[{name=\"node\",value=\"(SignalNode *) 0x8057a08\"},{name=\"detail\",value=\"0\"},{name=\"instance\",value=\"(gpointer) 0x8057b80\"},{name=\"emission_return\",value=\"(GValue *) 0x0\"},{name=\"instance_and_params\",value=\"(const GValue *) 0xbfe0286c\"}]},frame={level=\"11\",args=[{name=\"instance\",value=\"(gpo
inter) 0x8057b80\"},{name=\"signal_id\",value=\"12\"},{name=\"detail\",value=\"0\"},{name=\"var_args\",value=\"0xbfe02ab0 \\\"\\\\314,\\\\340\\\\277\\\\300m\\\\006\\\\b\\\\233d\\\\234\\\\267\\\\020\\\\347\\\\240\\\\267\\\\220d\\\\234\\\\267\\\\230m\\\\006\\\\b\\\\370*\\\\340\\\\277\\\\317i\\\\234\\\\267\\\\200{\\\\005\\\\b n\\\\006\\\\b\\\\200*\\\\005\\\\b\\\"\"}]},frame={level=\"12\",args=[{name=\"instance\",value=\"(gpointer) 0x8057b80\"},{name=\"signal_id\",value=\"12\"},{name=\"detail\",value=\"0\"}]},frame={level=\"13\",args=[{name=\"ql\",value=\"(ECalViewListener *) 0x8057b80\"},{name=\"objects\",value=\"(char **) 0x8066e40\"},{name=\"context\",value=\"(DBusGMethodInvocation *) 0x8052a80\"}]},frame={level=\"14\",args=[{name=\"closure\",value=\"(GClosure *) 0xbfe02d1c\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"3\"},{name=\"param_values\",value=\"(const GValue *) 0x8066d98\"},{name=\"invocation_hint\",value=\"(gpointer) 0x0\"},{n
ame=\"marshal_data\",value=\"(gpointer) 0xb79c6490\"}]},frame={level=\"15\",args=[]},frame={level=\"16\",args=[]},frame={level=\"17\",args=[]}]" ;
+"stack-args=[frame={level=\"0\",args=[{name=\"a_comp\",value=\"(icalcomponent *) 0x80596f8\"},{name=\"a_entry\",value=\"(MokoJEntry **) 0xbfe02178\"}]},frame={level=\"1\",args=[{name=\"a_view\",value=\"(ECalView *) 0x804ba60\"},{name=\"a_entries\",value=\"(GList *) 0x8054930\"},{name=\"a_journal\",value=\"(MokoJournal *) 0x8050580\"}]},frame={level=\"2\",args=[{name=\"closure\",value=\"(GClosure *) 0x805a010\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe023cc\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe022dc\"},{name=\"marshal_data\",value=\"(gpointer) 0xb7f9a146\"}]},frame={level=\"3\",args=[{name=\"closure\",value=\"(GClosure *) 0x805a010\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe023cc\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe022dc\"}]},frame={level=\"4\",ar
gs=[{name=\"node\",value=\"(SignalNode *) 0x80599c8\"},{name=\"detail\",value=\"0\"},{name=\"instance\",value=\"(gpointer) 0x804ba60\"},{name=\"emission_return\",value=\"(GValue *) 0x0\"},{name=\"instance_and_params\",value=\"(const GValue *) 0xbfe023cc\"}]},frame={level=\"5\",args=[{name=\"instance\",value=\"(gpointer) 0x804ba60\"},{name=\"signal_id\",value=\"18\"},{name=\"detail\",value=\"0\"},{name=\"var_args\",value=\"0xbfe02610 \\\"\\\\300\\\\365\\\\004\\\\b\\\\020,\\\\340\\\\277\\\\370\\\\024[\\\\001\\\\360\\\\226i\\\\267\\\\320`\\\\234\\\\267\\\\200\\\\237\\\\005\\\\bX&\\\\340\\\\277\\\\333cg\\\\267\\\\200{\\\\005\\\\b0I\\\\005\\\\b`\\\\272\\\\004\\\\b\\\\002\\\"\"}]},frame={level=\"6\",args=[{name=\"instance\",value=\"(gpointer) 0x804ba60\"},{name=\"signal_id\",value=\"18\"},{name=\"detail\",value=\"0\"}]},frame={level=\"7\",args=[{name=\"listener\",value=\"(ECalViewListener *) 0x8057b80\"},{name=\"objects\",value=\"(GList *) 0x8054930\"},{name=\"data\",value=\"(gpoi
nter) 0x804ba60\"}]},frame={level=\"8\",args=[{name=\"closure\",value=\"(GClosure *) 0x8059f80\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe0286c\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe0277c\"},{name=\"marshal_data\",value=\"(gpointer) 0xb79c60d0\"}]},frame={level=\"9\",args=[{name=\"closure\",value=\"(GClosure *) 0x8059f80\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"2\"},{name=\"param_values\",value=\"(const GValue *) 0xbfe0286c\"},{name=\"invocation_hint\",value=\"(gpointer) 0xbfe0277c\"}]},frame={level=\"10\",args=[{name=\"node\",value=\"(SignalNode *) 0x8057a08\"},{name=\"detail\",value=\"0\"},{name=\"instance\",value=\"(gpointer) 0x8057b80\"},{name=\"emission_return\",value=\"(GValue *) 0x0\"},{name=\"instance_and_params\",value=\"(const GValue *) 0xbfe0286c\"}]},frame={level=\"11\",args=[{name=\"instance\",value=\"(gpo
inter) 0x8057b80\"},{name=\"signal_id\",value=\"12\"},{name=\"detail\",value=\"0\"},{name=\"var_args\",value=\"0xbfe02ab0 \\\"\\\\314,\\\\340\\\\277\\\\300m\\\\006\\\\b\\\\233d\\\\234\\\\267\\\\020\\\\347\\\\240\\\\267\\\\220d\\\\234\\\\267\\\\230m\\\\006\\\\b\\\\370*\\\\340\\\\277\\\\317i\\\\234\\\\267\\\\200{\\\\005\\\\b n\\\\006\\\\b\\\\200*\\\\005\\\\b\\\"\"}]},frame={level=\"12\",args=[{name=\"instance\",value=\"(gpointer) 0x8057b80\"},{name=\"signal_id\",value=\"12\"},{name=\"detail\",value=\"0\"}]},frame={level=\"13\",args=[{name=\"ql\",value=\"(ECalViewListener *) 0x8057b80\"},{name=\"objects\",value=\"(char **) 0x8066e40\"},{name=\"context\",value=\"(DBusGMethodInvocation *) 0x8052a80\"}]},frame={level=\"14\",args=[{name=\"closure\",value=\"(GClosure *) 0xbfe02d1c\"},{name=\"return_value\",value=\"(GValue *) 0x0\"},{name=\"n_param_values\",value=\"3\"},{name=\"param_values\",value=\"(const GValue *) 0x8066d98\"},{name=\"invocation_hint\",value=\"(gpointer) 0x0\"},{n
ame=\"marshal_data\",value=\"(gpointer) 0xb79c6490\"}]},frame={level=\"15\",args=[]},frame={level=\"16\",args=[]},frame={level=\"17\",args=[]}]";
static const char* gv_overloads_prompt0=
@@ -158,90 +158,90 @@ static const char* gv_file_list1 =
void
test_str0 ()
{
- bool is_ok =false ;
+ bool is_ok =false;
- UString res ;
- UString::size_type to=0 ;
+ UString res;
+ UString::size_type to=0;
GDBMIParser parser (gv_str0);
is_ok = parser.parse_c_string (0, to, res);
- BOOST_REQUIRE (is_ok) ;
- BOOST_REQUIRE (res == "abracadabra") ;
+ BOOST_REQUIRE (is_ok);
+ BOOST_REQUIRE (res == "abracadabra");
}
void
test_str1 ()
{
- bool is_ok =false ;
+ bool is_ok =false;
- UString res ;
- UString::size_type to=0 ;
+ UString res;
+ UString::size_type to=0;
GDBMIParser parser (gv_str1);
is_ok = parser.parse_c_string (0, to, res);
- BOOST_REQUIRE (is_ok) ;
- MESSAGE ("got string: '" << Glib::locale_from_utf8 (res) << "'") ;
+ BOOST_REQUIRE (is_ok);
+ MESSAGE ("got string: '" << Glib::locale_from_utf8 (res) << "'");
BOOST_REQUIRE_MESSAGE (res.size () == 32, "res size was: " << res.size ());
}
void
test_str2 ()
{
- bool is_ok =false ;
+ bool is_ok =false;
- UString res ;
- UString::size_type to=0 ;
+ UString res;
+ UString::size_type to=0;
GDBMIParser parser (gv_str2);
is_ok = parser.parse_c_string (0, to, res);
- BOOST_REQUIRE (is_ok) ;
- MESSAGE ("got string: '" << Glib::locale_from_utf8 (res) << "'") ;
+ BOOST_REQUIRE (is_ok);
+ MESSAGE ("got string: '" << Glib::locale_from_utf8 (res) << "'");
BOOST_REQUIRE_MESSAGE (res.size (), "res size was: " << res.size ());
}
void
test_attr0 ()
{
- bool is_ok =false ;
+ bool is_ok =false;
- UString name,value ;
- UString::size_type to=0 ;
+ UString name,value;
+ UString::size_type to=0;
GDBMIParser parser (gv_attrs0);
name.clear (), value.clear ();
- is_ok = parser.parse_attribute (0, to, name, value) ;
- BOOST_REQUIRE (is_ok) ;
- BOOST_REQUIRE_MESSAGE (name == "msg", "got name: " << name) ;
- BOOST_REQUIRE_MESSAGE (value.size(), "got empty value") ;
+ is_ok = parser.parse_attribute (0, to, name, value);
+ BOOST_REQUIRE (is_ok);
+ BOOST_REQUIRE_MESSAGE (name == "msg", "got name: " << name);
+ BOOST_REQUIRE_MESSAGE (value.size(), "got empty value");
name.clear (), value.clear ();
parser.push_input (gv_attrs1);
- is_ok = parser.parse_attribute (0, to, name, value) ;
- BOOST_REQUIRE (is_ok) ;
- BOOST_REQUIRE_MESSAGE (name == "script", "got name: " << name) ;
- BOOST_REQUIRE_MESSAGE (value == "[silent,return]", "got empty value") ;
+ is_ok = parser.parse_attribute (0, to, name, value);
+ BOOST_REQUIRE (is_ok);
+ BOOST_REQUIRE_MESSAGE (name == "script", "got name: " << name);
+ BOOST_REQUIRE_MESSAGE (value == "[silent,return]", "got empty value");
}
void
test_stoppped_async_output ()
{
- bool is_ok=false, got_frame=false ;
- UString::size_type to=0 ;
- IDebugger::Frame frame ;
- map<UString, UString> attrs ;
+ bool is_ok=false, got_frame=false;
+ UString::size_type to=0;
+ IDebugger::Frame frame;
+ map<UString, UString> attrs;
GDBMIParser parser (gv_stopped_async_output0);
is_ok = parser.parse_stopped_async_output (0, to,
got_frame,
frame, attrs);
- BOOST_REQUIRE (is_ok) ;
- BOOST_REQUIRE (got_frame) ;
- BOOST_REQUIRE (attrs.size ()) ;
+ BOOST_REQUIRE (is_ok);
+ BOOST_REQUIRE (got_frame);
+ BOOST_REQUIRE (attrs.size ());
to=0;
parser.push_input (gv_stopped_async_output1);
@@ -255,7 +255,7 @@ void
test_running_async_output ()
{
bool is_ok=false;
- UString::size_type to=0 ;
+ UString::size_type to=0;
int thread_id=0;
GDBMIParser parser (gv_running_async_output0);
@@ -279,7 +279,7 @@ test_var_list_children ()
GDBMIParser parser (gv_var_list_children0);
bool is_ok=false;
- UString::size_type to=0 ;
+ UString::size_type to=0;
std::vector<IDebugger::VariableSafePtr> vars;
is_ok = parser.parse_var_list_children (0, to, vars);
BOOST_REQUIRE (is_ok);
@@ -295,19 +295,19 @@ test_output_record ()
GDBMIParser parser (gv_output_record0);
is_ok = parser.parse_output_record (0, to, output);
- BOOST_REQUIRE (is_ok) ;
+ BOOST_REQUIRE (is_ok);
parser.push_input (gv_output_record1);
is_ok = parser.parse_output_record (0, to, output);
- BOOST_REQUIRE (is_ok) ;
+ BOOST_REQUIRE (is_ok);
parser.push_input (gv_output_record2);
is_ok = parser.parse_output_record (0, to, output);
- BOOST_REQUIRE (is_ok) ;
+ BOOST_REQUIRE (is_ok);
parser.push_input (gv_output_record3);
is_ok = parser.parse_output_record (0, to, output);
- BOOST_REQUIRE (is_ok) ;
+ BOOST_REQUIRE (is_ok);
// gv_output_record4 should result in a variable.
parser.push_input (gv_output_record4);
@@ -387,59 +387,59 @@ test_stack0 ()
void
test_stack_arguments0 ()
{
- bool is_ok=false ;
- UString::size_type to ;
- map<int, list<IDebugger::VariableSafePtr> >params ;
+ bool is_ok=false;
+ UString::size_type to;
+ map<int, list<IDebugger::VariableSafePtr> >params;
GDBMIParser parser (gv_stack_arguments0);
- is_ok = parser.parse_stack_arguments (0, to, params) ;
- BOOST_REQUIRE (is_ok) ;
- BOOST_REQUIRE (params.size () == 2) ;
- map<int, list<IDebugger::VariableSafePtr> >::iterator param_iter ;
- param_iter = params.find (0) ;
- BOOST_REQUIRE (param_iter != params.end ()) ;
- IDebugger::VariableSafePtr variable = *(param_iter->second.begin ()) ;
- BOOST_REQUIRE (variable) ;
- BOOST_REQUIRE (variable->name () == "a_param") ;
- BOOST_REQUIRE (!variable->members ().empty ()) ;
+ is_ok = parser.parse_stack_arguments (0, to, params);
+ BOOST_REQUIRE (is_ok);
+ BOOST_REQUIRE (params.size () == 2);
+ map<int, list<IDebugger::VariableSafePtr> >::iterator param_iter;
+ param_iter = params.find (0);
+ BOOST_REQUIRE (param_iter != params.end ());
+ IDebugger::VariableSafePtr variable = *(param_iter->second.begin ());
+ BOOST_REQUIRE (variable);
+ BOOST_REQUIRE (variable->name () == "a_param");
+ BOOST_REQUIRE (!variable->members ().empty ());
}
void
test_stack_arguments1 ()
{
- bool is_ok=false ;
- UString::size_type to ;
- map<int, list<IDebugger::VariableSafePtr> >params ;
+ bool is_ok=false;
+ UString::size_type to;
+ map<int, list<IDebugger::VariableSafePtr> >params;
GDBMIParser parser (gv_stack_arguments1);
- is_ok = parser.parse_stack_arguments (0, to, params) ;
- BOOST_REQUIRE (is_ok) ;
+ is_ok = parser.parse_stack_arguments (0, to, params);
+ BOOST_REQUIRE (is_ok);
BOOST_REQUIRE_MESSAGE (params.size () == 18, "got nb params "
- << params.size ()) ;
- map<int, list<IDebugger::VariableSafePtr> >::iterator param_iter ;
- param_iter = params.find (0) ;
- BOOST_REQUIRE (param_iter != params.end ()) ;
- IDebugger::VariableSafePtr variable = *(param_iter->second.begin ()) ;
- BOOST_REQUIRE (variable) ;
- BOOST_REQUIRE (variable->name () == "a_comp") ;
- BOOST_REQUIRE (variable->members ().empty ()) ;
+ << params.size ());
+ map<int, list<IDebugger::VariableSafePtr> >::iterator param_iter;
+ param_iter = params.find (0);
+ BOOST_REQUIRE (param_iter != params.end ());
+ IDebugger::VariableSafePtr variable = *(param_iter->second.begin ());
+ BOOST_REQUIRE (variable);
+ BOOST_REQUIRE (variable->name () == "a_comp");
+ BOOST_REQUIRE (variable->members ().empty ());
}
void
test_local_vars ()
{
- bool is_ok=false ;
- UString::size_type to=0 ;
- list<IDebugger::VariableSafePtr> vars ;
+ bool is_ok=false;
+ UString::size_type to=0;
+ list<IDebugger::VariableSafePtr> vars;
GDBMIParser parser (gv_local_vars);
- is_ok = parser.parse_local_var_list (0, to, vars) ;
- BOOST_REQUIRE (is_ok) ;
- BOOST_REQUIRE (vars.size () == 1) ;
- IDebugger::VariableSafePtr var = *(vars.begin ()) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (var->name () == "person") ;
- BOOST_REQUIRE (var->type () == "Person") ;
+ is_ok = parser.parse_local_var_list (0, to, vars);
+ BOOST_REQUIRE (is_ok);
+ BOOST_REQUIRE (vars.size () == 1);
+ IDebugger::VariableSafePtr var = *(vars.begin ());
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (var->name () == "person");
+ BOOST_REQUIRE (var->type () == "Person");
}
void
@@ -447,22 +447,22 @@ test_member_variable ()
{
{
UString::size_type to = 0;
- IDebugger::VariableSafePtr var (new IDebugger::Variable) ;
+ IDebugger::VariableSafePtr var (new IDebugger::Variable);
GDBMIParser parser (gv_member_var);
- BOOST_REQUIRE (parser.parse_member_variable (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_member_variable (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
}
{
UString::size_type to = 0;
- IDebugger::VariableSafePtr var (new IDebugger::Variable) ;
+ IDebugger::VariableSafePtr var (new IDebugger::Variable);
GDBMIParser parser (gv_member_var2);
- BOOST_REQUIRE (parser.parse_member_variable (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_member_variable (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
}
}
@@ -470,54 +470,54 @@ void
test_var_with_member_variable ()
{
UString::size_type to = 0;
- IDebugger::VariableSafePtr var (new IDebugger::Variable) ;
+ IDebugger::VariableSafePtr var (new IDebugger::Variable);
GDBMIParser parser (gv_var_with_member);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_member2);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_member3);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_member4);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_member5);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_member6);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_member7);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (!var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (!var->members ().empty ());
}
void
@@ -532,50 +532,50 @@ test_var_with_comma ()
// {A = 0x1234 <void foo(int, int)>} is a single member variable
UString::size_type to = 0;
- IDebugger::VariableSafePtr var (new IDebugger::Variable) ;
+ IDebugger::VariableSafePtr var (new IDebugger::Variable);
GDBMIParser parser (gv_var_with_member8);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (1 == var->members ().size ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (1 == var->members ().size ());
BOOST_REQUIRE_EQUAL("0x40085e <my_func(void*, void*)>", (*var->members ().begin ())->value ());
to = 0;
var.reset (new IDebugger::Variable);
parser.push_input (gv_var_with_comma);
- BOOST_REQUIRE (parser.parse_variable_value (0, to, var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (var->members ().empty ()) ;
+ BOOST_REQUIRE (parser.parse_variable_value (0, to, var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (var->members ().empty ());
BOOST_REQUIRE_EQUAL("0x40085e <my_func(void*, void*)>", var->value ());
}
void
test_embedded_string ()
{
- UString::size_type to = 0 ;
- UString str ;
+ UString::size_type to = 0;
+ UString str;
GDBMIParser parser (gv_emb_str);
- BOOST_REQUIRE (parser.parse_embedded_c_string (0, to, str)) ;
+ BOOST_REQUIRE (parser.parse_embedded_c_string (0, to, str));
}
void
test_overloads_prompt ()
{
- vector<IDebugger::OverloadsChoiceEntry> prompts ;
- UString::size_type cur = 0 ;
+ vector<IDebugger::OverloadsChoiceEntry> prompts;
+ UString::size_type cur = 0;
GDBMIParser parser (gv_overloads_prompt0);
- BOOST_REQUIRE (parser.parse_overloads_choice_prompt (cur, cur, prompts)) ;
+ BOOST_REQUIRE (parser.parse_overloads_choice_prompt (cur, cur, prompts));
BOOST_REQUIRE_MESSAGE (prompts.size () == 4,
- "actually got " << prompts.size ()) ;
+ "actually got " << prompts.size ());
- cur=0 ;
- prompts.clear () ;
+ cur=0;
+ prompts.clear ();
parser.push_input (gv_overloads_prompt1);
- BOOST_REQUIRE (parser.parse_overloads_choice_prompt (cur, cur, prompts)) ;
+ BOOST_REQUIRE (parser.parse_overloads_choice_prompt (cur, cur, prompts));
BOOST_REQUIRE_MESSAGE (prompts.size () == 4,
- "actually got " << prompts.size ()) ;
+ "actually got " << prompts.size ());
}
void
@@ -586,7 +586,7 @@ test_register_names ()
GDBMIParser parser (gv_register_names);
- BOOST_REQUIRE (parser.parse_register_names (cur, cur, regs)) ;
+ BOOST_REQUIRE (parser.parse_register_names (cur, cur, regs));
BOOST_REQUIRE_EQUAL (regs.size (), 50u);
BOOST_REQUIRE_EQUAL (regs[0], "eax");
BOOST_REQUIRE_EQUAL (regs[1], "ecx");
@@ -647,7 +647,7 @@ test_changed_registers ()
UString::size_type cur = 0;
GDBMIParser parser (gv_changed_registers);
- BOOST_REQUIRE (parser.parse_changed_registers (cur, cur, regs)) ;
+ BOOST_REQUIRE (parser.parse_changed_registers (cur, cur, regs));
BOOST_REQUIRE_EQUAL (regs.size (), 18u);
std::list<IDebugger::register_id_t>::const_iterator reg_iter = regs.begin ();
BOOST_REQUIRE_EQUAL (*reg_iter++, 0u);
@@ -771,7 +771,7 @@ test_breakpoint_table ()
UString::size_type cur = 0;
GDBMIParser parser (gv_breakpoint_table0);
- BOOST_REQUIRE (parser.parse_breakpoint_table (cur, cur, breakpoints)) ;
+ BOOST_REQUIRE (parser.parse_breakpoint_table (cur, cur, breakpoints));
BOOST_REQUIRE_EQUAL (breakpoints.size (), 1u);
std::map<int, IDebugger::BreakPoint>::const_iterator iter;
iter = breakpoints.find (1);
@@ -833,7 +833,7 @@ test_file_list ()
BOOST_REQUIRE (num_files == 126);
}
-using boost::unit_test::test_suite ;
+using boost::unit_test::test_suite;
NEMIVER_API test_suite*
init_unit_test_suite (int argc, char **argv)
@@ -842,26 +842,26 @@ init_unit_test_suite (int argc, char **argv)
NEMIVER_TRY
- nemiver::common::Initializer::do_init () ;
-
- test_suite *suite = BOOST_TEST_SUITE ("GDBMI tests") ;
- suite->add (BOOST_TEST_CASE (&test_str0)) ;
- suite->add (BOOST_TEST_CASE (&test_str1)) ;
- suite->add (BOOST_TEST_CASE (&test_str2)) ;
- suite->add (BOOST_TEST_CASE (&test_attr0)) ;
- suite->add (BOOST_TEST_CASE (&test_stoppped_async_output)) ;
- suite->add (BOOST_TEST_CASE (&test_running_async_output)) ;
- suite->add (BOOST_TEST_CASE (&test_var_list_children)) ;
- suite->add (BOOST_TEST_CASE (&test_output_record)) ;
- suite->add (BOOST_TEST_CASE (&test_stack0)) ;
- suite->add (BOOST_TEST_CASE (&test_stack_arguments0)) ;
- suite->add (BOOST_TEST_CASE (&test_stack_arguments1)) ;
- suite->add (BOOST_TEST_CASE (&test_local_vars)) ;
- suite->add (BOOST_TEST_CASE (&test_member_variable)) ;
- suite->add (BOOST_TEST_CASE (&test_var_with_member_variable)) ;
- suite->add (BOOST_TEST_CASE (&test_var_with_comma)) ;
- suite->add (BOOST_TEST_CASE (&test_embedded_string)) ;
- suite->add (BOOST_TEST_CASE (&test_overloads_prompt)) ;
+ nemiver::common::Initializer::do_init ();
+
+ test_suite *suite = BOOST_TEST_SUITE ("GDBMI tests");
+ suite->add (BOOST_TEST_CASE (&test_str0));
+ suite->add (BOOST_TEST_CASE (&test_str1));
+ suite->add (BOOST_TEST_CASE (&test_str2));
+ suite->add (BOOST_TEST_CASE (&test_attr0));
+ suite->add (BOOST_TEST_CASE (&test_stoppped_async_output));
+ suite->add (BOOST_TEST_CASE (&test_running_async_output));
+ suite->add (BOOST_TEST_CASE (&test_var_list_children));
+ suite->add (BOOST_TEST_CASE (&test_output_record));
+ suite->add (BOOST_TEST_CASE (&test_stack0));
+ suite->add (BOOST_TEST_CASE (&test_stack_arguments0));
+ suite->add (BOOST_TEST_CASE (&test_stack_arguments1));
+ suite->add (BOOST_TEST_CASE (&test_local_vars));
+ suite->add (BOOST_TEST_CASE (&test_member_variable));
+ suite->add (BOOST_TEST_CASE (&test_var_with_member_variable));
+ suite->add (BOOST_TEST_CASE (&test_var_with_comma));
+ suite->add (BOOST_TEST_CASE (&test_embedded_string));
+ suite->add (BOOST_TEST_CASE (&test_overloads_prompt));
suite->add (BOOST_TEST_CASE (&test_register_names));
suite->add (BOOST_TEST_CASE (&test_changed_registers));
suite->add (BOOST_TEST_CASE (&test_register_values));
@@ -870,10 +870,10 @@ init_unit_test_suite (int argc, char **argv)
suite->add (BOOST_TEST_CASE (&test_breakpoint_table));
suite->add (BOOST_TEST_CASE (&test_breakpoint));
suite->add (BOOST_TEST_CASE (&test_file_list));
- return suite ;
+ return suite;
NEMIVER_CATCH_NOX
- return 0 ;
+ return 0;
}
diff --git a/tests/test-global-variables.cc b/tests/test-global-variables.cc
index e4575b6..c832626 100644
--- a/tests/test-global-variables.cc
+++ b/tests/test-global-variables.cc
@@ -7,18 +7,18 @@
#include "common/nmv-exception.h"
#include "nmv-i-var-list-walker.h"
-using namespace nemiver ;
-using namespace nemiver::common ;
+using namespace nemiver;
+using namespace nemiver::common;
-typedef std::list<IDebugger::VariableSafePtr> DebuggerVariableList ;
-typedef std::map<std::string, IVarListWalkerSafePtr> VarListWalkerMap ;
-typedef std::map<std::string, string> StringMap ;
-typedef std::map<UString, UString> UStringMap ;
+typedef std::list<IDebugger::VariableSafePtr> DebuggerVariableList;
+typedef std::map<std::string, IVarListWalkerSafePtr> VarListWalkerMap;
+typedef std::map<std::string, string> StringMap;
+typedef std::map<UString, UString> UStringMap;
Glib::RefPtr<Glib::MainLoop> s_loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
-static IDebugger::Frame s_current_frame ;
+static IDebugger::Frame s_current_frame;
static int s_nb_listed_vars;
static int s_nb_visited_vars;
static UString s_last_listed_var;
@@ -33,7 +33,7 @@ on_command_done_signal (const UString &a_name,
{
if (a_cookie.empty ()) {
}
- MESSAGE ("command " << a_name << " done") ;
+ MESSAGE ("command " << a_name << " done");
}
void
@@ -59,7 +59,7 @@ on_stopped_signal (const UString &a_reason,
const UString &a_cookie,
IDebuggerSafePtr &a_debugger)
{
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_debugger);
if (a_reason.empty () || a_has_frame || a_frame.level () || a_thread_id ||
a_cookie.empty () || a_debugger) {
@@ -67,23 +67,23 @@ on_stopped_signal (const UString &a_reason,
}
if (a_reason == "exited-normally") {
- MESSAGE ("program exited normally") ;
- s_loop->quit () ;
- return ;
+ MESSAGE ("program exited normally");
+ s_loop->quit ();
+ return;
}
if (!a_has_frame) {
- MESSAGE ("stopped, but not in a frame, reason: " << a_reason) ;
- return ;
+ MESSAGE ("stopped, but not in a frame, reason: " << a_reason);
+ return;
}
- s_current_frame = a_frame ;
+ s_current_frame = a_frame;
MESSAGE ("stopped in function: '"
<< a_frame.function_name ()
- << "()'") ;
+ << "()'");
- a_debugger->list_global_variables () ;
+ a_debugger->list_global_variables ();
}
void
@@ -123,7 +123,7 @@ on_variable_list_visited_signal (IDebuggerSafePtr a_debugger)
THROW_IF_FAIL (a_debugger);
cout << "finished visiting variables list\n";
- a_debugger->do_continue () ;
+ a_debugger->do_continue ();
NEMIVER_CATCH_NOX
}
@@ -131,18 +131,18 @@ on_variable_list_visited_signal (IDebuggerSafePtr a_debugger)
IVarListWalkerSafePtr
create_var_list_walker (IDebuggerSafePtr a_debugger)
{
- THROW_IF_FAIL (a_debugger) ;
+ THROW_IF_FAIL (a_debugger);
IVarListWalkerSafePtr result =
DynamicModuleManager::load_iface_with_default_manager<IVarListWalker>
("varlistwalker",
- "IVarListWalker") ;
- result->initialize (a_debugger) ;
+ "IVarListWalker");
+ result->initialize (a_debugger);
result->variable_visited_signal ().connect
- (sigc::bind (&on_variable_visited_signal, a_debugger)) ;
+ (sigc::bind (&on_variable_visited_signal, a_debugger));
result->variable_list_visited_signal ().connect
- (sigc::bind (&on_variable_list_visited_signal, a_debugger)) ;
- return result ;
+ (sigc::bind (&on_variable_list_visited_signal, a_debugger));
+ return result;
}
IVarListWalkerSafePtr
@@ -169,11 +169,11 @@ on_global_variables_listed_signal (const std::list<IDebugger::VariableSafePtr> &
if (a_vars.size () == 0) {
cout << "got zero global variables\n";
- return ;
+ return;
}
- cout << "got global variables\n" ;
+ cout << "got global variables\n";
IVarListWalkerSafePtr walker = get_var_list_walker (a_debugger);
- std::list<IDebugger::VariableSafePtr>::const_iterator it ;
+ std::list<IDebugger::VariableSafePtr>::const_iterator it;
for (it = a_vars.begin (); it != a_vars.end (); ++it) {
cout << "------------------------------\n";
cout << "listed-var-name: " << (*it)->name () << "\n";
@@ -199,40 +199,40 @@ test_main (int argc, char **argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
//load the IDebugger interface
IDebuggerSafePtr debugger =
DynamicModuleManager::load_iface_with_default_manager<IDebugger>
("gdbengine",
- "IDebugger") ;
+ "IDebugger");
//setup the debugger with the glib mainloop
- debugger->set_event_loop_context (Glib::MainContext::get_default ()) ;
+ debugger->set_event_loop_context (Glib::MainContext::get_default ());
//*******************************
//<connect to IDebugger events>
//******************************
- debugger->command_done_signal ().connect (&on_command_done_signal) ;
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->command_done_signal ().connect (&on_command_done_signal);
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect (&on_program_finished_signal);
- debugger->running_signal ().connect (&on_running_signal) ;
+ debugger->running_signal ().connect (&on_running_signal);
debugger->stopped_signal ().connect (sigc::bind (&on_stopped_signal,
- debugger)) ;
+ debugger));
debugger->global_variables_listed_signal ().connect
- (sigc::bind (&on_global_variables_listed_signal, debugger)) ;
+ (sigc::bind (&on_global_variables_listed_signal, debugger));
//*******************************
//</connect to IDebugger events>
//******************************
- debugger->load_program ("fooprog", ".") ;
- debugger->set_breakpoint ("main") ;
- debugger->run () ;
+ debugger->load_program ("fooprog", ".");
+ debugger->set_breakpoint ("main");
+ debugger->run ();
//********************
//run the event loop.
//********************
- s_loop->run () ;
+ s_loop->run ();
cout << "variables listed: " << s_nb_listed_vars << "\n";
cout << "variables visited: " << s_nb_visited_vars << "\n";
@@ -255,7 +255,7 @@ test_main (int argc, char **argv)
NEMIVER_CATCH_AND_RETURN_NOX (-1)
- return 0 ;
+ return 0;
}
diff --git a/tests/test-libtool-wrapper-detection.cc b/tests/test-libtool-wrapper-detection.cc
index aa1f2f0..47ea756 100644
--- a/tests/test-libtool-wrapper-detection.cc
+++ b/tests/test-libtool-wrapper-detection.cc
@@ -6,7 +6,7 @@
#include "common/nmv-proc-utils.h"
using namespace nemiver::common;
-using boost::unit_test::test_suite ;
+using boost::unit_test::test_suite;
void
test0 ()
@@ -29,11 +29,11 @@ init_unit_test_suite (int argc, char** argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- test_suite *suite = BOOST_TEST_SUITE ("libtool wrapper detect tests") ;
- suite->add (BOOST_TEST_CASE (&test0)) ;
- suite->add (BOOST_TEST_CASE (&test_filename_with_dashes)) ;
+ test_suite *suite = BOOST_TEST_SUITE ("libtool wrapper detect tests");
+ suite->add (BOOST_TEST_CASE (&test0));
+ suite->add (BOOST_TEST_CASE (&test_filename_with_dashes));
return suite;
NEMIVER_CATCH_NOX
diff --git a/tests/test-local-vars-list.cc b/tests/test-local-vars-list.cc
index bdc4c16..8bd929d 100644
--- a/tests/test-local-vars-list.cc
+++ b/tests/test-local-vars-list.cc
@@ -5,17 +5,17 @@
#include "common/nmv-exception.h"
#include "nmv-i-var-list.h"
-using namespace std ;
-using namespace nemiver ;
-using namespace nemiver::common ;
+using namespace std;
+using namespace nemiver;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
IDebuggerSafePtr debugger;
-static int nb_stops=0 ;
-static int nb_var_type_set=0 ;
-static int nb_var_value_set=0 ;
+static int nb_stops=0;
+static int nb_var_type_set=0;
+static int nb_var_value_set=0;
void
on_stopped_signal (IDebugger::StopReason a_reason,
@@ -26,47 +26,47 @@ on_stopped_signal (IDebugger::StopReason a_reason,
const UString &/*a_cookie*/,
const IVarListSafePtr a_var_list)
{
- BOOST_REQUIRE (a_var_list) ;
+ BOOST_REQUIRE (a_var_list);
- MESSAGE ("stopped, reason: " << (int)a_reason) ;
+ MESSAGE ("stopped, reason: " << (int)a_reason);
if (a_reason == IDebugger::EXITED_NORMALLY) {
//okay, time to get out. Let's check if the overall test
//went like we want
- BOOST_REQUIRE (nb_var_type_set == 3) ;
- BOOST_REQUIRE (nb_var_value_set == 3) ;
- BOOST_REQUIRE (a_var_list->get_raw_list ().size () == 3) ;
- IDebugger::VariableSafePtr var ;
- BOOST_REQUIRE (a_var_list->find_variable ("foo_ptr", var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (var->name () != "") ;
- BOOST_REQUIRE (var->type () != "") ;
-
- BOOST_REQUIRE (a_var_list->find_variable ("bar_ptr", var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (var->name () != "") ;
- BOOST_REQUIRE (var->type () != "") ;
-
- BOOST_REQUIRE (a_var_list->find_variable ("baz_ptr", var)) ;
- BOOST_REQUIRE (var) ;
- BOOST_REQUIRE (var->name () != "") ;
- BOOST_REQUIRE (var->type () != "") ;
- loop->quit () ;
- return ;
+ BOOST_REQUIRE (nb_var_type_set == 3);
+ BOOST_REQUIRE (nb_var_value_set == 3);
+ BOOST_REQUIRE (a_var_list->get_raw_list ().size () == 3);
+ IDebugger::VariableSafePtr var;
+ BOOST_REQUIRE (a_var_list->find_variable ("foo_ptr", var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (var->name () != "");
+ BOOST_REQUIRE (var->type () != "");
+
+ BOOST_REQUIRE (a_var_list->find_variable ("bar_ptr", var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (var->name () != "");
+ BOOST_REQUIRE (var->type () != "");
+
+ BOOST_REQUIRE (a_var_list->find_variable ("baz_ptr", var));
+ BOOST_REQUIRE (var);
+ BOOST_REQUIRE (var->name () != "");
+ BOOST_REQUIRE (var->type () != "");
+ loop->quit ();
+ return;
}
if (a_has_frame && a_frame.function_name () == "main") {
MESSAGE ("in main:" << (int)a_frame.line ());
- ++nb_stops ;
+ ++nb_stops;
if (nb_stops == 1) {
- debugger->list_local_variables () ;
+ debugger->list_local_variables ();
} else if (nb_stops == 4) {
- a_var_list->update_state () ;
- debugger->do_continue () ;
- return ;
+ a_var_list->update_state ();
+ debugger->do_continue ();
+ return;
}
- debugger->step_over () ;
+ debugger->step_over ();
}
}
@@ -78,11 +78,11 @@ on_local_variables_listed_signal (const DebuggerVariableList &a_vars,
{
if (a_cookie.empty ()) {}
- BOOST_REQUIRE (a_var_list) ;
- BOOST_REQUIRE (a_var_list->get_raw_list ().empty ()) ;
- DebuggerVariableList::const_iterator it ;
- for (it = a_vars.begin () ; it != a_vars.end () ; ++it) {
- a_var_list->append_variable (*it) ;
+ BOOST_REQUIRE (a_var_list);
+ BOOST_REQUIRE (a_var_list->get_raw_list ().empty ());
+ DebuggerVariableList::const_iterator it;
+ for (it = a_vars.begin (); it != a_vars.end () ; ++it) {
+ a_var_list->append_variable (*it);
}
}
@@ -90,34 +90,34 @@ on_local_variables_listed_signal (const DebuggerVariableList &a_vars,
void
on_var_type_set (const IDebugger::VariableSafePtr &a_var)
{
- BOOST_REQUIRE (a_var) ;
- BOOST_REQUIRE (a_var->name () != "") ;
- BOOST_REQUIRE (a_var->type () != "") ;
+ BOOST_REQUIRE (a_var);
+ BOOST_REQUIRE (a_var->name () != "");
+ BOOST_REQUIRE (a_var->type () != "");
if (a_var->name () == "foo_ptr"
||a_var->name () == "bar_ptr"
||a_var->name () == "baz_ptr") {
- ++nb_var_type_set ;
+ ++nb_var_type_set;
MESSAGE ("variable type set: "
- <<a_var->name () << ":" << a_var->type ()) ;
+ <<a_var->name () << ":" << a_var->type ());
} else {
UString msg = "unexpected variable: " + a_var->name ();
- BOOST_FAIL (msg.c_str ()) ;
+ BOOST_FAIL (msg.c_str ());
}
}
void
on_var_value_set (const IDebugger::VariableSafePtr &a_var)
{
- BOOST_REQUIRE (a_var) ;
- BOOST_REQUIRE (a_var->name () != "") ;
+ BOOST_REQUIRE (a_var);
+ BOOST_REQUIRE (a_var->name () != "");
if (a_var->name () == "foo_ptr"
||a_var->name () == "bar_ptr"
||a_var->name () == "baz_ptr") {
- ++nb_var_value_set ;
+ ++nb_var_value_set;
MESSAGE ("variable value set: "
- << a_var->name ()) ;
+ << a_var->name ());
}
}
@@ -128,44 +128,44 @@ test_main (int argc, char **argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
//load the IDebugger interface
debugger =
DynamicModuleManager::load_iface_with_default_manager<IDebugger>
("gdbengine",
- "IDebugger") ;
+ "IDebugger");
//setup the debugger with the glib mainloop
- debugger->set_event_loop_context (Glib::MainContext::get_default ()) ;
+ debugger->set_event_loop_context (Glib::MainContext::get_default ());
//load the variable list interface
IVarListSafePtr var_list =
DynamicModuleManager::load_iface_with_default_manager<IVarList>
("varlist",
"IVarList");
- var_list->initialize (debugger) ;
+ var_list->initialize (debugger);
//set debugger slots
debugger->stopped_signal ().connect (sigc::bind (&on_stopped_signal,
var_list));
debugger->local_variables_listed_signal ().connect (sigc::bind
- (&on_local_variables_listed_signal, var_list)) ;
+ (&on_local_variables_listed_signal, var_list));
//set variable list slots
- var_list->variable_value_set_signal ().connect (&on_var_value_set) ;
- var_list->variable_type_set_signal ().connect (&on_var_type_set) ;
+ var_list->variable_value_set_signal ().connect (&on_var_value_set);
+ var_list->variable_type_set_signal ().connect (&on_var_type_set);
//TODO: finish this: connect to var_list and debugger signals
//load .libs/pointerderef program, list its local variables
//add them to the list, step a bit, update the varlist state at
//each step, check the state has been updated.
vector<UString> args;
- debugger->load_program (".libs/pointerderef", args, ".") ;
- debugger->set_breakpoint ("main") ;
- debugger->run () ;
+ debugger->load_program (".libs/pointerderef", args, ".");
+ debugger->set_breakpoint ("main");
+ debugger->run ();
- loop->run () ;
+ loop->run ();
NEMIVER_CATCH_AND_RETURN_NOX (-1)
- return 0 ;
+ return 0;
}
diff --git a/tests/test-overloads.cc b/tests/test-overloads.cc
index ddcf4f4..e24b02b 100644
--- a/tests/test-overloads.cc
+++ b/tests/test-overloads.cc
@@ -7,25 +7,25 @@
#include "nmv-i-debugger.h"
using namespace nemiver;
-using namespace nemiver::common ;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
static bool broke_in_overload=false;
void
on_engine_died_signal ()
{
- MESSAGE ("engine died") ;
- loop->quit () ;
+ MESSAGE ("engine died");
+ loop->quit ();
}
void
on_program_finished_signal ()
{
- MESSAGE ("program finished") ;
- loop->quit () ;
+ MESSAGE ("program finished");
+ loop->quit ();
if (!broke_in_overload) {
BOOST_FAIL ("did not break in the overload");
}
@@ -35,7 +35,7 @@ void
on_command_done_signal (const UString &a_command,
const UString &a_cookie)
{
- MESSAGE ("command done: '" << a_command << "', cookie: '" << a_cookie) ;
+ MESSAGE ("command done: '" << a_command << "', cookie: '" << a_cookie);
}
void
@@ -55,7 +55,7 @@ on_breakpoints_set_signal (const std::map<int, IDebugger::BreakPoint> &a_breaks,
void
on_running_signal ()
{
- MESSAGE ("debugger running ...") ;
+ MESSAGE ("debugger running ...");
}
@@ -67,14 +67,14 @@ on_stopped_signal (const UString &a_reason,
const UString &a_cookie,
IDebuggerSafePtr &a_debugger)
{
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_debugger);
if (a_thread_id || a_cookie.empty ()) {/*keep compiler happy*/}
MESSAGE ("debugger stopped. reason == " << a_reason);
if (a_reason == "breakpoint-hit") {
if (a_has_frame ) {
if (a_frame.function_name () == "func1") {
- a_debugger->set_breakpoint ("Person::overload") ;
+ a_debugger->set_breakpoint ("Person::overload");
} else if (a_frame.function_name ().find ("Person::overload")
!= UString::npos) {
broke_in_overload = true;
@@ -110,33 +110,33 @@ test_main (int argc, char *argv[])
if (argc || argv) {/*keep compiler happy*/}
try {
- Initializer::do_init () ;
+ Initializer::do_init ();
- THROW_IF_FAIL (loop) ;
+ THROW_IF_FAIL (loop);
- DynamicModuleManager module_manager ;
+ DynamicModuleManager module_manager;
IDebuggerSafePtr debugger =
module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
- debugger->set_event_loop_context (loop->get_context ()) ;
+ debugger->set_event_loop_context (loop->get_context ());
//*****************************
//<connect to IDebugger events>
//*****************************
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect
- (&on_program_finished_signal) ;
+ (&on_program_finished_signal);
- debugger->command_done_signal ().connect (&on_command_done_signal) ;
+ debugger->command_done_signal ().connect (&on_command_done_signal);
debugger->breakpoints_set_signal ().connect
- (&on_breakpoints_set_signal) ;
+ (&on_breakpoints_set_signal);
debugger->running_signal ().connect (&on_running_signal);
debugger->stopped_signal ().connect
- (sigc::bind (&on_stopped_signal, debugger)) ;
+ (sigc::bind (&on_stopped_signal, debugger));
debugger->got_overloads_choice_signal ().connect
(sigc::bind (&on_got_overloads_choice_signal, debugger));
@@ -145,23 +145,23 @@ test_main (int argc, char *argv[])
//</connect to IDebugger events>
//*****************************
- std::vector<UString> args, source_search_dir ;
- args.push_back ("fooprog") ;
- source_search_dir.push_back (".") ;
+ std::vector<UString> args, source_search_dir;
+ args.push_back ("fooprog");
+ source_search_dir.push_back (".");
debugger->load_program (args, "", source_search_dir);
- debugger->set_breakpoint ("func1") ;
- debugger->run () ;
- loop->run () ;
+ debugger->set_breakpoint ("func1");
+ debugger->run ();
+ loop->run ();
} catch (Glib::Exception &e) {
- LOG_ERROR ("got error: " << e.what () << "\n") ;
- return -1 ;
+ LOG_ERROR ("got error: " << e.what () << "\n");
+ return -1;
} catch (exception &e) {
- LOG_ERROR ("got error: " << e.what () << "\n") ;
- return -1 ;
+ LOG_ERROR ("got error: " << e.what () << "\n");
+ return -1;
} catch (...) {
- LOG_ERROR ("got an unknown error\n") ;
- return -1 ;
+ LOG_ERROR ("got an unknown error\n");
+ return -1;
}
return 0;
}
diff --git a/tests/test-stdout.cc b/tests/test-stdout.cc
index 2d15025..90101fb 100644
--- a/tests/test-stdout.cc
+++ b/tests/test-stdout.cc
@@ -6,12 +6,12 @@
int
main ()
{
- nemiver::common::Initializer::do_init () ;
+ nemiver::common::Initializer::do_init ();
int i=10000;
while (--i) {
- LOG ("line number '" << (int) i << "'") ;
+ LOG ("line number '" << (int) i << "'");
}
- return 0 ;
+ return 0;
}
diff --git a/tests/test-types.cc b/tests/test-types.cc
index 275197b..cdfaee1 100644
--- a/tests/test-types.cc
+++ b/tests/test-types.cc
@@ -9,20 +9,20 @@ using namespace nemiver;
using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
void
on_engine_died_signal ()
{
- MESSAGE ("engine died") ;
- loop->quit () ;
+ MESSAGE ("engine died");
+ loop->quit ();
}
void
on_program_finished_signal ()
{
- MESSAGE ("program finished") ;
- loop->quit () ;
+ MESSAGE ("program finished");
+ loop->quit ();
}
void
@@ -77,32 +77,32 @@ test_main (int, char **)
Initializer::do_init();
THROW_IF_FAIL (loop);
- DynamicModuleManager module_manager ;
+ DynamicModuleManager module_manager;
IDebuggerSafePtr debugger =
module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
- debugger->set_event_loop_context (loop->get_context ()) ;
+ debugger->set_event_loop_context (loop->get_context ());
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect
- (&on_program_finished_signal) ;
+ (&on_program_finished_signal);
debugger->stopped_signal ().connect
- (sigc::bind (&on_stopped_signal, debugger)) ;
+ (sigc::bind (&on_stopped_signal, debugger));
debugger->variable_type_signal ().connect
- (&on_variable_type_signal) ;
+ (&on_variable_type_signal);
debugger->variable_value_signal ().connect (&on_variable_value_signal);
- std::vector<UString> args, source_search_dir ;
- source_search_dir.push_back (".") ;
+ std::vector<UString> args, source_search_dir;
+ source_search_dir.push_back (".");
debugger->load_program ("fooprog", args, ".", source_search_dir);
- debugger->set_breakpoint ("func1") ;
- debugger->run () ;
- loop->run () ;
+ debugger->set_breakpoint ("func1");
+ debugger->run ();
+ loop->run ();
NEMIVER_CATCH_NOX
return 0;
diff --git a/tests/test-unicode.cc b/tests/test-unicode.cc
index 12dd3f5..db42f29 100644
--- a/tests/test-unicode.cc
+++ b/tests/test-unicode.cc
@@ -6,40 +6,40 @@
#include "common/nmv-initializer.h"
#include "common/nmv-exception.h"
-using namespace std ;
-using namespace nemiver ;
-using nemiver::common::Initializer ;
-using nemiver::common::UString ;
-using nemiver::common::WString ;
-using nemiver::common::ustring_to_wstring ;
-using nemiver::common::wstring_to_ustring ;
+using namespace std;
+using namespace nemiver;
+using nemiver::common::Initializer;
+using nemiver::common::UString;
+using nemiver::common::WString;
+using nemiver::common::ustring_to_wstring;
+using nemiver::common::wstring_to_ustring;
-gunichar s_wstr[] = {230, 231, 232, 233, 234, 0} ;
+gunichar s_wstr[] = {230, 231, 232, 233, 234, 0};
void test_wstring_to_ustring ()
{
- UString utf8_str ;
- BOOST_REQUIRE (wstring_to_ustring (s_wstr, utf8_str)) ;
- unsigned int s_wstr_len = (sizeof (s_wstr)/sizeof (gunichar))-1 ;
- BOOST_REQUIRE (s_wstr_len == 5) ;
- BOOST_REQUIRE (s_wstr_len == utf8_str.size ()) ;
- for (unsigned int i=0 ; i < utf8_str.size () ; ++i) {
- BOOST_REQUIRE (s_wstr[i] == utf8_str[i]) ;
+ UString utf8_str;
+ BOOST_REQUIRE (wstring_to_ustring (s_wstr, utf8_str));
+ unsigned int s_wstr_len = (sizeof (s_wstr)/sizeof (gunichar))-1;
+ BOOST_REQUIRE (s_wstr_len == 5);
+ BOOST_REQUIRE (s_wstr_len == utf8_str.size ());
+ for (unsigned int i=0; i < utf8_str.size () ; ++i) {
+ BOOST_REQUIRE (s_wstr[i] == utf8_str[i]);
}
}
void test_ustring_to_wstring ()
{
- UString utf8_str ;
- BOOST_REQUIRE (wstring_to_ustring (s_wstr, utf8_str)) ;
- WString wstr ;
- BOOST_REQUIRE (ustring_to_wstring (utf8_str, wstr)) ;
- BOOST_REQUIRE (wstr.size () == utf8_str.size ()) ;
- BOOST_REQUIRE (wstr.size () == 5) ;
- BOOST_REQUIRE (!wstr.compare (0, wstr.size (), s_wstr)) ;
+ UString utf8_str;
+ BOOST_REQUIRE (wstring_to_ustring (s_wstr, utf8_str));
+ WString wstr;
+ BOOST_REQUIRE (ustring_to_wstring (utf8_str, wstr));
+ BOOST_REQUIRE (wstr.size () == utf8_str.size ());
+ BOOST_REQUIRE (wstr.size () == 5);
+ BOOST_REQUIRE (!wstr.compare (0, wstr.size (), s_wstr));
}
-using boost::unit_test::test_suite ;
+using boost::unit_test::test_suite;
NEMIVER_API test_suite*
init_unit_test_suite (int argc, char** argv)
@@ -48,14 +48,14 @@ init_unit_test_suite (int argc, char** argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- test_suite *suite = BOOST_TEST_SUITE ("Unicode tests") ;
- suite->add (BOOST_TEST_CASE (&test_wstring_to_ustring)) ;
- suite->add (BOOST_TEST_CASE (&test_ustring_to_wstring)) ;
- return suite ;
+ test_suite *suite = BOOST_TEST_SUITE ("Unicode tests");
+ suite->add (BOOST_TEST_CASE (&test_wstring_to_ustring));
+ suite->add (BOOST_TEST_CASE (&test_ustring_to_wstring));
+ return suite;
NEMIVER_CATCH_NOX
- return 0 ;
+ return 0;
}
diff --git a/tests/test-var-list.cc b/tests/test-var-list.cc
index e5f1f71..44ca7c7 100644
--- a/tests/test-var-list.cc
+++ b/tests/test-var-list.cc
@@ -5,17 +5,17 @@
#include "common/nmv-exception.h"
#include "nmv-i-var-list.h"
-using namespace std ;
-using namespace nemiver ;
-using namespace nemiver::common ;
+using namespace std;
+using namespace nemiver;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> s_loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
-IDebugger::Frame s_current_frame ;
+IDebugger::Frame s_current_frame;
-void lookup_variable (IVarListSafePtr &a_var_list) ;
+void lookup_variable (IVarListSafePtr &a_var_list);
void
on_command_done_signal (const UString &a_name,
@@ -23,7 +23,7 @@ on_command_done_signal (const UString &a_name,
{
if (a_cookie.empty ()) {
}
- MESSAGE ("command " << a_name << " done") ;
+ MESSAGE ("command " << a_name << " done");
}
void
@@ -50,35 +50,35 @@ on_stopped_signal (IDebugger::StopReason a_reason,
const UString &/*a_cookie*/,
IDebuggerSafePtr &a_debugger)
{
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_debugger);
if (a_reason == IDebugger::EXITED_NORMALLY) {
- MESSAGE ("program exited normally") ;
- s_loop->quit () ;
- return ;
+ MESSAGE ("program exited normally");
+ s_loop->quit ();
+ return;
}
if (!a_has_frame) {
- MESSAGE ("stopped, but not in a frame, reason: " << a_reason) ;
- return ;
+ MESSAGE ("stopped, but not in a frame, reason: " << a_reason);
+ return;
}
- s_current_frame = a_frame ;
+ s_current_frame = a_frame;
MESSAGE ("stopped in function: '"
<< a_frame.function_name ()
- << "()'") ;
- a_debugger->list_local_variables () ;
- a_debugger->list_frames_arguments () ;
+ << "()'");
+ a_debugger->list_local_variables ();
+ a_debugger->list_frames_arguments ();
if (a_frame.function_name () == "main") {
- a_debugger->do_continue() ;
+ a_debugger->do_continue();
} else if (a_frame.function_name () == "func1") {
- a_debugger->do_continue() ;
+ a_debugger->do_continue();
} else if (a_frame.function_name () == "func2") {
- a_debugger->do_continue() ;
+ a_debugger->do_continue();
} else if (a_frame.function_name () == "func3") {
- a_debugger->do_continue() ;
+ a_debugger->do_continue();
}
}
@@ -90,15 +90,15 @@ on_frames_arguments_listed_signal
IVarListSafePtr &a_var_list)
{
if (a_cookie.empty ()) {/*keep compiler happy*/}
- BOOST_REQUIRE (a_var_list) ;
- map<int, list<IDebugger::VariableSafePtr> >::const_iterator it ;
- it = a_frames_params.find (0) ;
+ BOOST_REQUIRE (a_var_list);
+ map<int, list<IDebugger::VariableSafePtr> >::const_iterator it;
+ it = a_frames_params.find (0);
if (it == a_frames_params.end ()) {
- LOG_ERROR ("Could not find current frame") ;
- return ;
+ LOG_ERROR ("Could not find current frame");
+ return;
}
- a_var_list->remove_variables () ;
- a_var_list->append_variables (it->second,false/*don't update type*/) ;
+ a_var_list->remove_variables ();
+ a_var_list->append_variables (it->second,false/*don't update type*/);
}
void
@@ -108,9 +108,9 @@ on_local_variables_listed_signal (const DebuggerVariableList &a_variables,
{
if (a_variables.empty () || a_cookie.empty ()) {
}
- BOOST_REQUIRE (a_var_list) ;
- a_var_list->remove_variables () ;
- a_var_list->append_variables (a_variables, false/*don't update type*/) ;
+ BOOST_REQUIRE (a_var_list);
+ a_var_list->remove_variables ();
+ a_var_list->append_variables (a_variables, false/*don't update type*/);
}
void
@@ -139,17 +139,17 @@ on_variable_type_signal (const UString &a_variable_name,
void
on_variable_removed_signal (const IDebugger::VariableSafePtr &a_var)
{
- BOOST_REQUIRE (a_var) ;
- MESSAGE ("variable removed: " << a_var->name ()) ;
+ BOOST_REQUIRE (a_var);
+ MESSAGE ("variable removed: " << a_var->name ());
/*
- cout << "=================\n" ;
+ cout << "=================\n";
if (a_var) {
- UString str ;
- a_var->to_string (str, true) ;
- cout << str ;
+ UString str;
+ a_var->to_string (str, true);
+ cout << str;
}
- cout << "\n=================" << endl ;
+ cout << "\n=================" << endl;
*/
}
@@ -157,34 +157,34 @@ void
on_variable_added_signal (const IDebugger::VariableSafePtr &a_var,
IVarListSafePtr &a_var_list)
{
- BOOST_REQUIRE (a_var) ;
- BOOST_REQUIRE (a_var_list) ;
+ BOOST_REQUIRE (a_var);
+ BOOST_REQUIRE (a_var_list);
- MESSAGE ("variable added: " << a_var->name ()) ;
- IDebugger::VariableSafePtr variable ;
- BOOST_REQUIRE (a_var_list->find_variable (a_var->name (), variable)) ;
+ MESSAGE ("variable added: " << a_var->name ());
+ IDebugger::VariableSafePtr variable;
+ BOOST_REQUIRE (a_var_list->find_variable (a_var->name (), variable));
if (s_current_frame.function_name () == "func3") {
- lookup_variable (a_var_list) ;
+ lookup_variable (a_var_list);
}
}
void
lookup_variable (IVarListSafePtr &a_var_list)
{
- BOOST_REQUIRE (a_var_list) ;
+ BOOST_REQUIRE (a_var_list);
if (s_current_frame.function_name () != "func3") {
- return ;
+ return;
}
- IDebugger::VariableSafePtr variable ;
- MESSAGE ("Looking for simple variable ...") ;
- BOOST_REQUIRE (a_var_list->find_variable ("a_param", variable)) ;
- MESSAGE ("OK") ;
- MESSAGE ("Looking for fully qualified variable ...") ;
+ IDebugger::VariableSafePtr variable;
+ MESSAGE ("Looking for simple variable ...");
+ BOOST_REQUIRE (a_var_list->find_variable ("a_param", variable));
+ MESSAGE ("OK");
+ MESSAGE ("Looking for fully qualified variable ...");
BOOST_REQUIRE (a_var_list->find_variable ("a_param.m_first_name",
- variable)) ;
- MESSAGE ("OK") ;
+ variable));
+ MESSAGE ("OK");
}
NEMIVER_API int
@@ -193,28 +193,28 @@ test_main (int argc, char **argv)
if (argc || argv) {/*keep compiler happy*/}
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
//load the IDebugger interface
IDebuggerSafePtr debugger =
DynamicModuleManager::load_iface_with_default_manager<IDebugger>
("gdbengine",
- "IDebugger") ;
+ "IDebugger");
//setup the debugger with the glib mainloop
- debugger->set_event_loop_context (Glib::MainContext::get_default ()) ;
+ debugger->set_event_loop_context (Glib::MainContext::get_default ());
//load the variable list interface
IVarListSafePtr var_list =
DynamicModuleManager::load_iface_with_default_manager<IVarList>
("varlist",
"IVarList");
- var_list->initialize (debugger) ;
+ var_list->initialize (debugger);
//*****************************
//<connect to var list signals>
//*****************************
var_list->variable_added_signal ().connect
- (sigc::bind (&on_variable_added_signal, var_list)) ;
- var_list->variable_removed_signal ().connect (&on_variable_removed_signal) ;
+ (sigc::bind (&on_variable_added_signal, var_list));
+ var_list->variable_removed_signal ().connect (&on_variable_removed_signal);
//*****************************
//</connect to var list signals>
//*****************************
@@ -222,40 +222,40 @@ test_main (int argc, char **argv)
//*******************************
//<connect to IDebugger events>
//******************************
- debugger->command_done_signal ().connect (&on_command_done_signal) ;
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->command_done_signal ().connect (&on_command_done_signal);
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect (&on_program_finished_signal);
- debugger->running_signal ().connect (&on_running_signal) ;
+ debugger->running_signal ().connect (&on_running_signal);
debugger->stopped_signal ().connect (sigc::bind (&on_stopped_signal,
- debugger)) ;
+ debugger));
debugger->variable_value_signal ().connect
- (sigc::bind (&on_variable_value_signal, var_list)) ;
+ (sigc::bind (&on_variable_value_signal, var_list));
debugger->variable_type_signal ().connect
- (sigc::bind (&on_variable_type_signal, var_list)) ;
+ (sigc::bind (&on_variable_type_signal, var_list));
debugger->frames_arguments_listed_signal ().connect
(sigc::bind (&on_frames_arguments_listed_signal,
- var_list)) ;
+ var_list));
debugger->local_variables_listed_signal ().connect
(sigc::bind (&on_local_variables_listed_signal,
- var_list)) ;
+ var_list));
//*******************************
//</connect to IDebugger events>
//******************************
vector<UString> args;
- debugger->load_program ("fooprog", args, ".") ;
- debugger->set_breakpoint ("main") ;
- debugger->set_breakpoint ("func1") ;
- debugger->set_breakpoint ("func2") ;
- debugger->set_breakpoint ("func3") ;
- debugger->run () ;
+ debugger->load_program ("fooprog", args, ".");
+ debugger->set_breakpoint ("main");
+ debugger->set_breakpoint ("func1");
+ debugger->set_breakpoint ("func2");
+ debugger->set_breakpoint ("func3");
+ debugger->run ();
//****************************************
//run the event loop.
//****************************************
- s_loop->run () ;
+ s_loop->run ();
NEMIVER_CATCH_AND_RETURN_NOX (-1)
- return 0 ;
+ return 0;
}
diff --git a/tests/test-var-path-expr.cc b/tests/test-var-path-expr.cc
index 8dfb344..2b28004 100644
--- a/tests/test-var-path-expr.cc
+++ b/tests/test-var-path-expr.cc
@@ -7,23 +7,23 @@
#include "nmv-i-debugger.h"
using namespace nemiver;
-using namespace nemiver::common ;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
static void
on_engine_died_signal ()
{
- MESSAGE ("engine died") ;
- loop->quit () ;
+ MESSAGE ("engine died");
+ loop->quit ();
}
static void
on_program_finished_signal ()
{
- MESSAGE ("program finished") ;
- loop->quit () ;
+ MESSAGE ("program finished");
+ loop->quit ();
}
static void
@@ -32,9 +32,9 @@ on_breakpoints_set_signal (const std::map<int, IDebugger::BreakPoint> &a_breaks,
{
if (a_cookie.empty ()) {}
- MESSAGE ("breakpoints set:") ;
- std::map<int, IDebugger::BreakPoint>::const_iterator it ;
- for (it = a_breaks.begin () ; it != a_breaks.end () ; ++it) {
+ MESSAGE ("breakpoints set:");
+ std::map<int, IDebugger::BreakPoint>::const_iterator it;
+ for (it = a_breaks.begin (); it != a_breaks.end () ; ++it) {
MESSAGE ("<break><num>" << it->first <<"</num><line>"
<< it->second.file_name () << ":" << it->second.line ()
<< "</line></break>");
@@ -114,39 +114,39 @@ test_main (int argc, char *argv[])
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
- THROW_IF_FAIL (loop) ;
+ THROW_IF_FAIL (loop);
- DynamicModuleManager module_manager ;
+ DynamicModuleManager module_manager;
IDebuggerSafePtr debugger =
module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
- debugger->set_event_loop_context (loop->get_context ()) ;
+ debugger->set_event_loop_context (loop->get_context ());
//*****************************
//<connect to IDebugger events>
//*****************************
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect
- (&on_program_finished_signal) ;
+ (&on_program_finished_signal);
debugger->breakpoints_set_signal ().connect
- (&on_breakpoints_set_signal) ;
+ (&on_breakpoints_set_signal);
debugger->stopped_signal ().connect (sigc::bind (&on_stopped_signal,
debugger));
- std::vector<UString> args, source_search_dir ;
- source_search_dir.push_back (".") ;
+ std::vector<UString> args, source_search_dir;
+ source_search_dir.push_back (".");
debugger->load_program ("fooprog", args, ".", source_search_dir);
- debugger->set_breakpoint ("main") ;
- debugger->run () ;
- loop->run () ;
+ debugger->set_breakpoint ("main");
+ debugger->run ();
+ loop->run ();
NEMIVER_CATCH_NOX
- return 0 ;
+ return 0;
}
diff --git a/tests/test-var-walker.cc b/tests/test-var-walker.cc
index 57be4c4..3264594 100644
--- a/tests/test-var-walker.cc
+++ b/tests/test-var-walker.cc
@@ -8,59 +8,59 @@
#include "common/nmv-exception.h"
#include "nmv-i-var-list-walker.h"
-using namespace nemiver ;
-using namespace nemiver::common ;
+using namespace nemiver;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> s_loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
-IDebugger::Frame s_current_frame ;
+IDebugger::Frame s_current_frame;
-typedef std::list<IDebugger::VariableSafePtr> DebuggerVariableList ;
-typedef std::map<std::string, IVarListWalkerSafePtr> VarListWalkerMap ;
-typedef std::map<std::string, string> StringMap ;
+typedef std::list<IDebugger::VariableSafePtr> DebuggerVariableList;
+typedef std::map<std::string, IVarListWalkerSafePtr> VarListWalkerMap;
+typedef std::map<std::string, string> StringMap;
VarListWalkerMap&
var_list_walker ()
{
- static VarListWalkerMap s_var_list_walker ;
- return s_var_list_walker ;
+ static VarListWalkerMap s_var_list_walker;
+ return s_var_list_walker;
}
StringMap&
expected_variables ()
{
- static StringMap s_expected_variables ;
- return s_expected_variables ;
+ static StringMap s_expected_variables;
+ return s_expected_variables;
}
StringMap&
actual_variables ()
{
- static StringMap s_actual_variables ;
- return s_actual_variables ;
+ static StringMap s_actual_variables;
+ return s_actual_variables;
}
void on_variable_visited_signal (const IVarWalkerSafePtr &a_walker,
- IDebuggerSafePtr &a_debugger) ;
+ IDebuggerSafePtr &a_debugger);
-void on_variable_list_visited_signal (IDebuggerSafePtr &a_debugger) ;
+void on_variable_list_visited_signal (IDebuggerSafePtr &a_debugger);
IVarListWalkerSafePtr
create_var_list_walker (IDebuggerSafePtr a_debugger)
{
- THROW_IF_FAIL (a_debugger) ;
+ THROW_IF_FAIL (a_debugger);
IVarListWalkerSafePtr result =
DynamicModuleManager::load_iface_with_default_manager<IVarListWalker>
("varlistwalker",
- "IVarListWalker") ;
- result->initialize (a_debugger) ;
+ "IVarListWalker");
+ result->initialize (a_debugger);
result->variable_visited_signal ().connect
- (sigc::bind (&on_variable_visited_signal, a_debugger)) ;
+ (sigc::bind (&on_variable_visited_signal, a_debugger));
result->variable_list_visited_signal ().connect
- (sigc::bind (&on_variable_list_visited_signal, a_debugger)) ;
- return result ;
+ (sigc::bind (&on_variable_list_visited_signal, a_debugger));
+ return result;
}
void
@@ -69,7 +69,7 @@ on_command_done_signal (const UString &a_name,
{
if (a_cookie.empty ()) {
}
- MESSAGE ("command " << a_name << " done") ;
+ MESSAGE ("command " << a_name << " done");
}
void
@@ -96,27 +96,27 @@ on_stopped_signal (IDebugger::StopReason a_reason,
const UString &/*a_cookie*/,
IDebuggerSafePtr &a_debugger)
{
- BOOST_REQUIRE (a_debugger) ;
+ BOOST_REQUIRE (a_debugger);
if (a_reason == IDebugger::EXITED_NORMALLY) {
- MESSAGE ("program exited normally") ;
- s_loop->quit () ;
- return ;
+ MESSAGE ("program exited normally");
+ s_loop->quit ();
+ return;
}
if (!a_has_frame) {
- MESSAGE ("stopped, but not in a frame, reason: " << a_reason) ;
- return ;
+ MESSAGE ("stopped, but not in a frame, reason: " << a_reason);
+ return;
}
- s_current_frame = a_frame ;
+ s_current_frame = a_frame;
MESSAGE ("stopped in function: '"
<< a_frame.function_name ()
- << "()'") ;
+ << "()'");
- a_debugger->list_local_variables () ;
- a_debugger->list_frames_arguments () ;
+ a_debugger->list_local_variables ();
+ a_debugger->list_frames_arguments ();
}
void
@@ -125,19 +125,19 @@ on_frames_arguments_listed_signal
const UString &a_cookie)
{
if (a_cookie.empty ()) {/*keep compiler happy*/}
- map<int, list<IDebugger::VariableSafePtr> >::const_iterator it ;
- it = a_frames_params.find (0) ;
+ map<int, list<IDebugger::VariableSafePtr> >::const_iterator it;
+ it = a_frames_params.find (0);
if (it == a_frames_params.end ()) {
- LOG_ERROR ("Could not find current frame") ;
- return ;
+ LOG_ERROR ("Could not find current frame");
+ return;
}
BOOST_REQUIRE (var_list_walker ().find (s_current_frame.function_name ())
- != var_list_walker ().end ()) ;
+ != var_list_walker ().end ());
IVarListWalkerSafePtr walker = var_list_walker ()[s_current_frame.function_name ()];
- BOOST_REQUIRE (walker) ;
- walker->remove_variables () ;
- walker->append_variables (it->second) ;
- walker->do_walk_variables () ;
+ BOOST_REQUIRE (walker);
+ walker->remove_variables ();
+ walker->append_variables (it->second);
+ walker->do_walk_variables ();
}
void
@@ -147,12 +147,12 @@ on_local_variables_listed_signal (const DebuggerVariableList &a_variables,
if (a_variables.empty () || a_cookie.empty ()) {
}
BOOST_REQUIRE (var_list_walker ().find (s_current_frame.function_name ())
- != var_list_walker ().end ()) ;
+ != var_list_walker ().end ());
IVarListWalkerSafePtr walker = var_list_walker ()[s_current_frame.function_name ()];
- BOOST_REQUIRE (walker) ;
- walker->remove_variables () ;
- walker->append_variables (a_variables) ;
- walker->do_walk_variables () ;
+ BOOST_REQUIRE (walker);
+ walker->remove_variables ();
+ walker->append_variables (a_variables);
+ walker->do_walk_variables ();
}
void
@@ -164,16 +164,16 @@ on_variable_visited_signal (const IVarWalkerSafePtr &a_walker,
MESSAGE ("in function "
<< s_current_frame.function_name ()
<< ", visited "
- << a_walker->get_variable ()->name ()) ;
+ << a_walker->get_variable ()->name ());
actual_variables ()[s_current_frame.function_name ()] +=
- " " + a_walker->get_variable ()->name () ;
+ " " + a_walker->get_variable ()->name ();
}
void
on_variable_list_visited_signal (IDebuggerSafePtr &a_debugger)
{
- a_debugger->do_continue () ;
- MESSAGE ("continuing from frame " << s_current_frame.function_name ()) ;
+ a_debugger->do_continue ();
+ MESSAGE ("continuing from frame " << s_current_frame.function_name ());
}
NEMIVER_API int
@@ -183,87 +183,87 @@ test_main (int argc, char **argv)
NEMIVER_TRY
- Initializer::do_init () ;
+ Initializer::do_init ();
//load the IDebugger interface
IDebuggerSafePtr debugger =
DynamicModuleManager::load_iface_with_default_manager<IDebugger>
("gdbengine",
- "IDebugger") ;
+ "IDebugger");
//setup the debugger with the glib mainloop
- debugger->set_event_loop_context (Glib::MainContext::get_default ()) ;
+ debugger->set_event_loop_context (Glib::MainContext::get_default ());
//*******************************
//<connect to IDebugger events>
//******************************
- debugger->command_done_signal ().connect (&on_command_done_signal) ;
- debugger->engine_died_signal ().connect (&on_engine_died_signal) ;
+ debugger->command_done_signal ().connect (&on_command_done_signal);
+ debugger->engine_died_signal ().connect (&on_engine_died_signal);
debugger->program_finished_signal ().connect (&on_program_finished_signal);
- debugger->running_signal ().connect (&on_running_signal) ;
+ debugger->running_signal ().connect (&on_running_signal);
debugger->stopped_signal ().connect (sigc::bind (&on_stopped_signal,
- debugger)) ;
+ debugger));
debugger->frames_arguments_listed_signal ().connect
- (&on_frames_arguments_listed_signal) ;
+ (&on_frames_arguments_listed_signal);
debugger->local_variables_listed_signal ().connect
- (&on_local_variables_listed_signal) ;
+ (&on_local_variables_listed_signal);
//*******************************
//</connect to IDebugger events>
//******************************
vector<UString> args;
- debugger->load_program ("fooprog", args, ".") ;
- debugger->set_breakpoint ("main") ;
- debugger->set_breakpoint ("func1") ;
- debugger->set_breakpoint ("func2") ;
- debugger->set_breakpoint ("func3") ;
-
- var_list_walker ()["main"] = create_var_list_walker (debugger) ;
- expected_variables ()["main"] = " person a_argc a_argv" ;
- var_list_walker ()["func1"] = create_var_list_walker (debugger) ;
- expected_variables ()["func1"] = " i" ;
- var_list_walker ()["func2"] = create_var_list_walker (debugger) ;
- expected_variables ()["func2"] = " j a_a a_b" ;
- var_list_walker ()["func3"] = create_var_list_walker (debugger) ;
- expected_variables ()["func3"] = " a_param" ;
- debugger->run () ;
+ debugger->load_program ("fooprog", args, ".");
+ debugger->set_breakpoint ("main");
+ debugger->set_breakpoint ("func1");
+ debugger->set_breakpoint ("func2");
+ debugger->set_breakpoint ("func3");
+
+ var_list_walker ()["main"] = create_var_list_walker (debugger);
+ expected_variables ()["main"] = " person a_argc a_argv";
+ var_list_walker ()["func1"] = create_var_list_walker (debugger);
+ expected_variables ()["func1"] = " i";
+ var_list_walker ()["func2"] = create_var_list_walker (debugger);
+ expected_variables ()["func2"] = " j a_a a_b";
+ var_list_walker ()["func3"] = create_var_list_walker (debugger);
+ expected_variables ()["func3"] = " a_param";
+ debugger->run ();
//****************************************
//run the event loop.
//****************************************
- s_loop->run () ;
+ s_loop->run ();
- BOOST_REQUIRE (actual_variables ().find ("main") != actual_variables ().end ()) ;
- BOOST_REQUIRE (actual_variables ().find ("func1") != actual_variables ().end ()) ;
- BOOST_REQUIRE (actual_variables ().find ("func2") != actual_variables ().end ()) ;
- BOOST_REQUIRE (actual_variables ().find ("func3") != actual_variables ().end ()) ;
+ BOOST_REQUIRE (actual_variables ().find ("main") != actual_variables ().end ());
+ BOOST_REQUIRE (actual_variables ().find ("func1") != actual_variables ().end ());
+ BOOST_REQUIRE (actual_variables ().find ("func2") != actual_variables ().end ());
+ BOOST_REQUIRE (actual_variables ().find ("func3") != actual_variables ().end ());
if (actual_variables ()["main"] != expected_variables ()["main"]) {
- string str ("main vars: ") ;
- str += actual_variables ()["main"] ;
- BOOST_FAIL (str.c_str ()) ;
+ string str ("main vars: ");
+ str += actual_variables ()["main"];
+ BOOST_FAIL (str.c_str ());
}
if (actual_variables ()["func1"] != expected_variables ()["func1"]) {
- string str ("func1 vars: ") ;
- str += actual_variables ()["func1"] ;
+ string str ("func1 vars: ");
+ str += actual_variables ()["func1"];
MESSAGE ("actual variables of");
- BOOST_FAIL (str.c_str ()) ;
+ BOOST_FAIL (str.c_str ());
}
if (actual_variables ()["func2"] != expected_variables ()["func2"]) {
- string str ("func2 vars: ") ;
- str += actual_variables ()["func2"] ;
- BOOST_FAIL (str.c_str ()) ;
+ string str ("func2 vars: ");
+ str += actual_variables ()["func2"];
+ BOOST_FAIL (str.c_str ());
}
if (actual_variables ()["func3"] != expected_variables ()["func3"]) {
- string str ("func3 vars: ") ;
- str += actual_variables ()["func3"] ;
- BOOST_FAIL (str.c_str ()) ;
+ string str ("func3 vars: ");
+ str += actual_variables ()["func3"];
+ BOOST_FAIL (str.c_str ());
}
NEMIVER_CATCH_AND_RETURN_NOX (-1)
- return 0 ;
+ return 0;
}
diff --git a/tests/test-vars.cc b/tests/test-vars.cc
index 618f410..f40e225 100644
--- a/tests/test-vars.cc
+++ b/tests/test-vars.cc
@@ -7,11 +7,11 @@
#include "common/nmv-exception.h"
#include "nmv-i-var-list-walker.h"
-using namespace nemiver ;
-using namespace nemiver::common ;
+using namespace nemiver;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> s_loop =
- Glib::MainLoop::create (Glib::MainContext::get_default ()) ;
+ Glib::MainLoop::create (Glib::MainContext::get_default ());
static int nb_vars_created;
static int nb_vars_created2;
static int nb_vars_deleted;
diff --git a/tests/test-watchpoint.cc b/tests/test-watchpoint.cc
index 407b0cf..4cd7c83 100644
--- a/tests/test-watchpoint.cc
+++ b/tests/test-watchpoint.cc
@@ -6,7 +6,7 @@
#include "nmv-i-debugger.h"
using namespace nemiver;
-using namespace nemiver::common ;
+using namespace nemiver::common;
Glib::RefPtr<Glib::MainLoop> loop =
Glib::MainLoop::create (Glib::MainContext::get_default ());
@@ -18,7 +18,7 @@ void
on_engine_died_signal ()
{
MESSAGE ("engine died");
- loop->quit () ;
+ loop->quit ();
}
void
@@ -36,7 +36,7 @@ on_breakpoints_set_signal (const std::map<int, IDebugger::BreakPoint> &a_breaks,
MESSAGE ("breakpoints set:");
std::map<int, IDebugger::BreakPoint>::const_iterator it;
- for (it = a_breaks.begin () ; it != a_breaks.end () ; ++it) {
+ for (it = a_breaks.begin (); it != a_breaks.end () ; ++it) {
MESSAGE ("<break><num>" << it->first <<"</num><line>"
<< it->second.file_name () << ":" << it->second.line ()
<< "</line></break>");
@@ -107,7 +107,7 @@ test_main (int, char **)
debugger->set_breakpoint ("func1");
debugger->run ();
- loop->run () ;
+ loop->run ();
NEMIVER_CATCH_NOX
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]