Index: src/ch/MainWnd.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -34,7 +34,6 @@ #include "ClipboardMonitor.h" #include #include -#include "../libchcore/TWStringData.h" #include "../common/TShellExtMenuConfig.h" #include "../libchcore/TConfig.h" #include "FileSupport.h" @@ -433,8 +432,8 @@ if(!pszBuffer || ulLen == 0 || pszBuffer[ulLen - 1] != L'\0') return FALSE; - chcore::TWStringData wstrData(pszBuffer); - AfxMessageBox(wstrData.GetData()); // TEMP = to remove before commit + chcore::TString wstrData(pszBuffer); + AfxMessageBox(wstrData); // TEMP = to remove before commit chcore::TTaskDefinition tTaskDefinition; tTaskDefinition.LoadFromString(wstrData); @@ -768,7 +767,7 @@ } chcore::TConfig cfgStorage; - chcore::TWStringData wstrData; + chcore::TString wstrData; cfgShellExt.StoreInConfig(cfgStorage, _T("ShellExtCfg")); cfgStorage.WriteToString(wstrData); Index: src/chext/DropMenuExt.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -24,7 +24,6 @@ #include "../libchcore/TTaskDefinition.h" #include #include "ShellPathsHelpers.h" -#include "../libchcore/TWStringData.h" #include "../common/TShellExtMenuConfig.h" #include "../libchcore/TSharedMemory.h" @@ -150,14 +149,14 @@ tTaskDefinition.SetOperationType(eOperationType); // get task data as xml - chcore::TWStringData wstrData; + chcore::TString wstrData; tTaskDefinition.StoreInString(wstrData); // fill struct COPYDATASTRUCT cds; cds.dwData = spSelectedItem->IsSpecialOperation() ? eCDType_TaskDefinitionContentSpecial : eCDType_TaskDefinitionContent; - cds.lpData = (void*)wstrData.GetData(); - cds.cbData = (DWORD)wstrData.GetBytesCount(); + cds.lpData = (void*)(const wchar_t*)wstrData; + cds.cbData = (DWORD)((wstrData.GetLength() + 1) * sizeof(wchar_t)); // send a message ::SendMessage(hWnd, WM_COPYDATA, reinterpret_cast(lpici->hwnd), reinterpret_cast(&cds)); @@ -230,7 +229,7 @@ std::wstring strSHMName = IPCSupport::GenerateSHMName(ulSHMID); chcore::TSharedMemory tSharedMemory; - chcore::TWStringData wstrData; + chcore::TString wstrData; chcore::TConfig cfgShellExtData; tSharedMemory.Open(strSHMName.c_str()); Index: src/chext/MenuExt.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -25,7 +25,6 @@ #include "chext-utils.h" #include #include "ShellPathsHelpers.h" -#include "../libchcore/TWStringData.h" #include "../common/TShellExtMenuConfig.h" #include "../libchcore/TSharedMemory.h" #include "../libchcore/TTaskDefinition.h" @@ -194,14 +193,14 @@ tTaskDefinition.SetOperationType(eOperationType); // get task data as xml - chcore::TWStringData wstrData; + chcore::TString wstrData; tTaskDefinition.StoreInString(wstrData); // fill struct COPYDATASTRUCT cds; cds.dwData = spSelectedItem->IsSpecialOperation() ? eCDType_TaskDefinitionContentSpecial : eCDType_TaskDefinitionContent; - cds.lpData = (void*)wstrData.GetData(); - cds.cbData = (DWORD)wstrData.GetBytesCount(); + cds.lpData = (void*)(const wchar_t*)wstrData; + cds.cbData = (DWORD)((wstrData.GetLength() + 1) * sizeof(wchar_t)); // send a message ::SendMessage(hWnd, WM_COPYDATA, reinterpret_cast(lpici->hwnd), reinterpret_cast(&cds)); @@ -383,7 +382,7 @@ std::wstring strSHMName = IPCSupport::GenerateSHMName(ulSHMID); chcore::TSharedMemory tSharedMemory; - chcore::TWStringData wstrData; + chcore::TString wstrData; chcore::TConfig cfgShellExtData; tSharedMemory.Open(strSHMName.c_str()); Index: src/libchcore/TConfig.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -26,7 +26,6 @@ #include #include #include "../libicpf/exception.h" -#include "TWStringData.h" #pragma warning(push) #pragma warning(disable: 4702 4512) @@ -245,7 +244,7 @@ } } -void TConfig::ReadFromString(const TWStringData& strInput) +void TConfig::ReadFromString(const TString& strInput) { if(strInput.IsEmpty()) THROW(_T("Invalid argument"), 0, 0, 0); @@ -254,7 +253,7 @@ ClearNL(); // also clears m_bModified - std::wistringstream ifs(strInput.GetData(), std::ios_base::in); + std::wistringstream ifs((const wchar_t*)strInput, std::ios_base::in); try { boost::property_tree::xml_parser::read_xml(ifs, m_propTree); @@ -266,15 +265,15 @@ } } -void TConfig::WriteToString(TWStringData& strOutput) +void TConfig::WriteToString(TString& strOutput) { boost::shared_lock lock(m_lock); std::wostringstream ofs(std::ios_base::out); boost::property_tree::xml_parser::write_xml(ofs, m_propTree); - strOutput = ofs.str(); + strOutput = ofs.str().c_str(); } void TConfig::SetFilePath(PCTSTR pszPath) Index: src/libchcore/TConfig.h =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/TConfig.h (.../TConfig.h) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/libchcore/TConfig.h (.../TConfig.h) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -33,8 +33,6 @@ BEGIN_CHCORE_NAMESPACE -class TWStringData; - // class defines configuration change notification record; not to be used outside class TConfigNotifier { @@ -98,8 +96,8 @@ void Read(PCTSTR pszFile); void Write(bool bOnlyIfModified = false); - void ReadFromString(const TWStringData& strInput); - void WriteToString(TWStringData& strOutput); + void ReadFromString(const TString& strInput); + void WriteToString(TString& strOutput); void SetFilePath(PCTSTR pszPath); Index: src/libchcore/TSharedMemory.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -23,7 +23,6 @@ #include "stdafx.h" #include "TSharedMemory.h" #include -#include "TWStringData.h" #include "ErrorCodes.h" BEGIN_CHCORE_NAMESPACE @@ -121,9 +120,9 @@ *(size_t*)m_pMappedMemory = sizeof(size_t); // no data inside (set just in case) } -void TSharedMemory::Create(const wchar_t* pszName, const TWStringData& wstrData) +void TSharedMemory::Create(const wchar_t* pszName, const TString& wstrData) { - Create(pszName, (BYTE*)wstrData.GetData(), wstrData.GetBytesCount()); + Create(pszName, (const BYTE*)(const wchar_t*)wstrData, (wstrData.GetLength() + 1) * sizeof(wchar_t)); } void TSharedMemory::Create(const wchar_t* pszName, const BYTE* pbyData, size_t stSize) @@ -190,7 +189,7 @@ } } -void TSharedMemory::Read(TWStringData& wstrData) const +void TSharedMemory::Read(TString& wstrData) const { if(!m_hFileMapping || !m_pMappedMemory || m_stSize <= sizeof(size_t)) THROW_CORE_EXCEPTION(eSharedMemoryNotOpen); @@ -210,9 +209,9 @@ wstrData = pszRealData; } -void TSharedMemory::Write(const TWStringData& wstrData) +void TSharedMemory::Write(const TString& wstrData) { - Write((BYTE*)wstrData.GetData(), wstrData.GetBytesCount()); + Write((const BYTE*)(const wchar_t*)wstrData, (wstrData.GetLength() + 1) * sizeof(wchar_t)); } void TSharedMemory::Write(const BYTE* pbyData, size_t stSize) Index: src/libchcore/TSharedMemory.h =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/TSharedMemory.h (.../TSharedMemory.h) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/libchcore/TSharedMemory.h (.../TSharedMemory.h) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -23,25 +23,25 @@ #ifndef __TSHAREDMEMORY_H__ #define __TSHAREDMEMORY_H__ +#include "TString.h" + BEGIN_CHCORE_NAMESPACE -class TWStringData; - class LIBCHCORE_API TSharedMemory { public: TSharedMemory(); ~TSharedMemory(); void Create(const wchar_t* pszName, size_t stSize); - void Create(const wchar_t* pszName, const TWStringData& wstrData); + void Create(const wchar_t* pszName, const TString& wstrData); void Create(const wchar_t* pszName, const BYTE* pbyData, size_t stSize); void Open(const wchar_t* pszName); void Close() throw(); - void Read(TWStringData& wstrData) const; - void Write(const TWStringData& wstrData); + void Read(TString& wstrData) const; + void Write(const TString& wstrData); void Write(const BYTE* pbyData, size_t stSize); // below are the unsafe functions (i.e. not protected with mutex) Index: src/libchcore/TTaskDefinition.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/TTaskDefinition.cpp (.../TTaskDefinition.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/libchcore/TTaskDefinition.cpp (.../TTaskDefinition.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -253,7 +253,7 @@ } } -void TTaskDefinition::StoreInString(TWStringData& strOutput) +void TTaskDefinition::StoreInString(TString& strOutput) { // read everything chcore::TConfig tTaskInfo; @@ -276,7 +276,7 @@ tTaskInfo.WriteToString(strOutput); } -void TTaskDefinition::LoadFromString(const TWStringData& strInput) +void TTaskDefinition::LoadFromString(const TString& strInput) { // read everything chcore::TConfig tTaskInfo; Index: src/libchcore/TTaskDefinition.h =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/TTaskDefinition.h (.../TTaskDefinition.h) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/libchcore/TTaskDefinition.h (.../TTaskDefinition.h) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -71,8 +71,8 @@ void Load(const std::wstring& strPath); void Store(const std::wstring& strPath, bool bOnlyIfModified = false); - void StoreInString(TWStringData& strInput); - void LoadFromString(const TWStringData& strInput); + void StoreInString(TString& strInput); + void LoadFromString(const TString& strInput); private: TString m_strTaskUniqueID; ///< Unique ID of the task that will process this request (generated automatically) Fisheye: Tag be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb refers to a dead (removed) revision in file `src/libchcore/TWStringData.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb refers to a dead (removed) revision in file `src/libchcore/TWStringData.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libchcore/libchcore.vc90.vcproj =================================================================== diff -u -r9ffa8edc757436ca9e71bdc89e5d31a2103c588c -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb --- src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision 9ffa8edc757436ca9e71bdc89e5d31a2103c588c) +++ src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) @@ -519,14 +519,6 @@ RelativePath=".\TTaskOperationPlan.h" > - - - -