summaryrefslogtreecommitdiff
path: root/shared/com_util.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:12:46 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:12:46 +0200
commitb338e29fd3eaf700f8c8360aa0310048ba941d54 (patch)
tree122f8ef3790d12cd10275ef7453a9e8053322d78 /shared/com_util.h
parent3.18 (diff)
downloadFreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.gz
FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.bz2
FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.zip
3.19
Diffstat (limited to 'shared/com_util.h')
-rw-r--r--shared/com_util.h28
1 files changed, 3 insertions, 25 deletions
diff --git a/shared/com_util.h b/shared/com_util.h
index a396fbee..4a8c4f54 100644
--- a/shared/com_util.h
+++ b/shared/com_util.h
@@ -31,10 +31,10 @@ std::wstring getText(ComPtr<T> comObj, MemFun memFun);
class Bstring
{
public:
- Bstring(const std::wstring& str);
- ~Bstring();
+ Bstring(const std::wstring& str) { str_ = ::SysAllocStringLen(str.data(), str.length()); } //string::data() returns unmodified string potentially containing 0-values
+ ~Bstring() { if (str_) ::SysFreeString(str_); }
- const BSTR get() const;
+ const BSTR get() const { return str_; }
private:
Bstring(const Bstring&); //not implemented
@@ -127,28 +127,6 @@ std::wstring getText(ComPtr<T> comObj, MemFun memFun)
}
return text;
}
-
-
-inline
-Bstring::Bstring(const std::wstring& str)
-{
- str_ = ::SysAllocStringLen(str.data(), str.length()); //string::data() returns unmodified string potentially containing 0-values
-}
-
-
-inline
-Bstring::~Bstring()
-{
- if (str_)
- ::SysFreeString(str_);
-}
-
-
-inline
-const BSTR Bstring::get() const
-{
- return str_;
-}
}
bgstack15