X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene-loader%2Fpublic-api%2Futils.h;h=1aace35cc53dc37522ff7689b65b17072a07f013;hb=bd126b5d480c08bf7a995b2c4532e80e76ec4ad2;hp=3ab0c33a597c77a69b6a61b7d393b129d09f174e;hpb=4b8ce75c615d3ebb84de69224a6210d3fd7cdea1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene-loader/public-api/utils.h b/dali-scene-loader/public-api/utils.h index 3ab0c33..1aace35 100644 --- a/dali-scene-loader/public-api/utils.h +++ b/dali-scene-loader/public-api/utils.h @@ -41,10 +41,7 @@ namespace SceneLoader class DALI_SCENE_LOADER_API StreamBuffer : public std::basic_streambuf { public: - StreamBuffer(char* buffer, size_t size) noexcept(true) - { - setp(buffer, buffer + size); - } + StreamBuffer(char* buffer, size_t size) noexcept(true); }; /* @@ -57,18 +54,10 @@ class DALI_SCENE_LOADER_API ExceptionFlinger public: enum { MESSAGE_BUFFER_SIZE = 512 }; - ExceptionFlinger(const char* location) noexcept(true) - : mLocation(location), - mStreamBuffer(GetMessageBuffer(), MESSAGE_BUFFER_SIZE - 1), - mStream(&mStreamBuffer) - {} + ExceptionFlinger(const char* location) noexcept(true); [[noreturn]] - ~ExceptionFlinger() noexcept(false) - { - operator<<('\0'); - throw DaliException(mLocation, GetMessageBuffer()); - } + ~ExceptionFlinger() noexcept(false); template ExceptionFlinger& operator<<(const T& rhs) noexcept(true) @@ -78,9 +67,17 @@ public: } private: + struct Impl + { + const char* mLocation; + + [[noreturn]] + ~Impl() noexcept(false); + }; + static char* GetMessageBuffer() noexcept(true); - const char* mLocation; + Impl mImpl; StreamBuffer mStreamBuffer; std::ostream mStream; };