diff options
author | George Hazan <george.hazan@gmail.com> | 2015-03-29 16:18:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-03-29 16:18:53 +0000 |
commit | 247bf8ac0aa3ba2e6187ff96b1b91b80b153d94b (patch) | |
tree | bf1e971bfee636382a5ac12eb9ed123ec4462db9 /include/m_string.inl | |
parent | 156545d23f92b32673e641650a7cc493f3eecc16 (diff) |
CMString::Detouch() - handy way to obtain a buffer compatible with mir_free()
git-svn-id: http://svn.miranda-ng.org/main/trunk@12541 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include/m_string.inl')
-rw-r--r-- | include/m_string.inl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/m_string.inl b/include/m_string.inl index b42bc3b99b..4615319416 100644 --- a/include/m_string.inl +++ b/include/m_string.inl @@ -1411,6 +1411,13 @@ BOOL CMStringT<BaseType, StringTraits>::GetEnvironmentVariable(PCXSTR pszVar) return bRetVal;
}
+// Set the string to the value of environment variable 'pszVar'
+template< typename BaseType, class StringTraits >
+typename CMStringT<BaseType, StringTraits>::PXSTR CMStringT<BaseType, StringTraits>::Detouch() const
+{
+ return StringTraits::MirCopy(CMStringT<BaseType, StringTraits>::GetString(), GetLength());
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
template< typename BaseType, class StringTraits >
|