Permalink
Browse files

Now function which checks the location returns passed path. Also macr…

…o for fast calling that function added
  • Loading branch information...
1 parent 11a238f commit 7977329b6e781e5469e4bd8450f409a9de6939b5 @max-frai max-frai committed Aug 28, 2010
Showing with 14 additions and 0 deletions.
  1. +4 −0 include/Core/Utils.hpp
  2. +10 −0 src/Core/Utils.cpp
View
@@ -21,6 +21,9 @@ using namespace boost::posix_time;
#define FORMAT(parentString, params) (boost::format(parentString) % params).str()
#define NEW_EVENT(Signature, Name) typedef SlotObject< signals2::signal<Signature> > Name;
+// Check the location exists
+#define LOCATION(path) Utils::get_mutable_instance().checkLocation(path);
+
#define utils (Utils::get_mutable_instance())
#define utilsConst (Utils::get_const_instance())
@@ -38,6 +41,7 @@ class Utils : public singleton<Utils>
Utils() : mDimension("2D") { }
~Utils() { }
+ string checkLocation(const string &path);
const string getMediaPath() const;
const string getDimension() const;
void setDimension(string &d);
View
@@ -40,6 +40,16 @@ void Utils::writeTimestamp()
mTimeStamp = getCurrentTime();
}
+string Utils::checkLocation(const string &path)
+{
+ if (!boost::filesystem::exists(path))
+ {
+ LOG(FORMAT("The path `%1%` isn't valid!", path));
+ }
+
+ return path;
+}
+
string Utils::getTimeDifference()
{
// If we don't call writeTimestamp before this function

0 comments on commit 7977329

Please sign in to comment.