From 3466ac128d391d253a605e3357cee30fcadb2cf1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 23 Oct 2007 19:56:30 +0000 Subject: [PATCH] Add c_str() methods for synfig::Time and synfig::TimePoint when _DEBUG is defined. git-svn-id: http://svn.voria.com/code@949 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/node.cpp | 8 ++++++++ synfig-core/trunk/src/synfig/node.h | 4 ++++ synfig-core/trunk/src/synfig/time.cpp | 8 ++++++++ synfig-core/trunk/src/synfig/time.h | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/synfig-core/trunk/src/synfig/node.cpp b/synfig-core/trunk/src/synfig/node.cpp index eaab964..e0815bd 100644 --- a/synfig-core/trunk/src/synfig/node.cpp +++ b/synfig-core/trunk/src/synfig/node.cpp @@ -118,6 +118,14 @@ refresh_node(synfig::Node* node, GUID old_guid) /* === M E T H O D S ======================================================= */ +#ifdef _DEBUG +const char * +TimePoint::c_str()const +{ + return get_time().get_string().c_str(); +} +#endif + void TimePoint::absorb(const TimePoint& x) { diff --git a/synfig-core/trunk/src/synfig/node.h b/synfig-core/trunk/src/synfig/node.h index ccdaaad..d60d7d7 100644 --- a/synfig-core/trunk/src/synfig/node.h +++ b/synfig-core/trunk/src/synfig/node.h @@ -63,6 +63,10 @@ public: { } +#ifdef _DEBUG + const char *c_str()const; +#endif + const GUID& get_guid()const { return guid; } const Time& get_time()const { return time; } Interpolation get_before()const { return before; } diff --git a/synfig-core/trunk/src/synfig/time.cpp b/synfig-core/trunk/src/synfig/time.cpp index 5cf03f1..4edc8af 100644 --- a/synfig-core/trunk/src/synfig/time.cpp +++ b/synfig-core/trunk/src/synfig/time.cpp @@ -270,6 +270,14 @@ Time::round(float fps)const return ceil(time)/fps; } +#ifdef _DEBUG +const char * +Time::c_str()const +{ + return get_string().c_str(); +} +#endif + //! \writeme bool Time::is_valid()const diff --git a/synfig-core/trunk/src/synfig/time.h b/synfig-core/trunk/src/synfig/time.h index 5ea2a89..a11050e 100644 --- a/synfig-core/trunk/src/synfig/time.h +++ b/synfig-core/trunk/src/synfig/time.h @@ -98,6 +98,10 @@ public: /*! \see Format */ String get_string(float fps=0, Time::Format format=FORMAT_NORMAL)const; +#ifdef _DEBUG + const char *c_str()const; +#endif + //! \writeme bool is_valid()const; -- 2.7.4