Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -N -rb193a95402f2bf4c456fb9d65d111caaf6994823 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision b193a95402f2bf4c456fb9d65d111caaf6994823) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -597,9 +597,9 @@ if(pFilter) { if(pFilter->GetUseMask()) - dlg.m_astrAddMask.Add(pFilter->GetCombinedMask()); + dlg.m_astrAddMask.Add(pFilter->GetCombinedMask().c_str()); if(pFilter->GetUseExcludeMask()) - dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask()); + dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask().c_str()); } } @@ -630,7 +630,7 @@ if (rFilter.GetUseMask()) { chcore::TString strData = rFilter.GetCombinedMask(); - _tcscpy(szLoaded, strData); + _tcscpy(szLoaded, strData.c_str()); } else _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERMASKEMPTY_STRING)); @@ -645,7 +645,7 @@ if (rFilter.GetUseExcludeMask()) { chcore::TString strData = rFilter.GetCombinedExcludeMask(); - _tcscpy(szLoaded, strData); + _tcscpy(szLoaded, strData.c_str()); } else _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERMASKEMPTY_STRING)); @@ -684,15 +684,15 @@ _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_DATECREATED_STRING+rFilter.GetDateType()), GetResManager().LoadString(IDS_LT_STRING+rFilter.GetDateCmpType1())); szLoaded[1023] = _T('\0'); chcore::TString strFmtDateTime = rFilter.GetDateTime1().Format(rFilter.GetUseDate1(), rFilter.GetUseTime1()); - _tcscat(szLoaded, (PCTSTR)strFmtDateTime); + _tcscat(szLoaded, strFmtDateTime.c_str()); if (rFilter.GetUseDateTime2()) { _tcscat(szLoaded, GetResManager().LoadString(IDS_AND_STRING)); _tcscat(szLoaded, GetResManager().LoadString(IDS_LT_STRING + rFilter.GetDateCmpType2())); strFmtDateTime = rFilter.GetDateTime2().Format(rFilter.GetUseDate2(), rFilter.GetUseTime2()); - _tcscat(szLoaded, (PCTSTR)strFmtDateTime); + _tcscat(szLoaded, strFmtDateTime.c_str()); } } else @@ -828,9 +828,9 @@ if(pFilter) { if(pFilter->GetUseMask() && boost::numeric_cast(stIndex) != iItem) - dlg.m_astrAddMask.Add(pFilter->GetCombinedMask()); + dlg.m_astrAddMask.Add(pFilter->GetCombinedMask().c_str()); if (pFilter->GetUseExcludeMask() && boost::numeric_cast(stIndex) != iItem) - dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask()); + dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask().c_str()); } } Index: src/ch/FilterDlg.cpp =================================================================== diff -u -N -rb193a95402f2bf4c456fb9d65d111caaf6994823 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/ch/FilterDlg.cpp (.../FilterDlg.cpp) (revision b193a95402f2bf4c456fb9d65d111caaf6994823) +++ src/ch/FilterDlg.cpp (.../FilterDlg.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -138,14 +138,14 @@ // copy data from TFileFilter to a dialog - mask m_bFilter = m_ffFilter.GetUseMask(); - m_ctlFilter.SetCurSel(m_ctlFilter.AddString(m_ffFilter.GetCombinedMask())); + m_ctlFilter.SetCurSel(m_ctlFilter.AddString(m_ffFilter.GetCombinedMask().c_str())); for (int i=0;im_strText = strPath; + pItem->m_strText = strPath.c_str(); pItem->m_uiPos = boost::numeric_cast(spTaskStats->GetCombinedProgress() * 100.0); pItem->m_tTaskID = spTaskStats->GetTaskID(); } Index: src/ch/StatusDlg.cpp =================================================================== diff -u -N -r70a5190f19728f132697e58b01599b46a5ca7f7e -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 70a5190f19728f132697e58b01599b46a5ca7f7e) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -1005,14 +1005,14 @@ if(strCurrentPath.IsEmpty()) strCurrentPath = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); - lvi.pszText = (PTSTR)(PCTSTR)strCurrentPath;; + lvi.pszText = (PTSTR)strCurrentPath.c_str();; lvi.cchTextMax = lstrlen(lvi.pszText); m_ctlStatusList.SetItem(&lvi); // destination path lvi.iSubItem = 2; chcore::TString strDestinationPath = spTaskStats->GetDestinationPath(); - lvi.pszText = (PTSTR)(PCTSTR)strDestinationPath; + lvi.pszText = (PTSTR)strDestinationPath.c_str(); lvi.cchTextMax = lstrlen(lvi.pszText); m_ctlStatusList.SetItem(&lvi); @@ -1097,7 +1097,7 @@ if(strPath.IsEmpty()) strPath = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); - GetDlgItem(IDC_SOURCEOBJECT_STATIC)->SetWindowText(strPath); // src object + GetDlgItem(IDC_SOURCEOBJECT_STATIC)->SetWindowText(strPath.c_str()); // src object SetBufferSizesString(spTaskStats->GetCurrentBufferSize(), spSubTaskStats->GetCurrentBufferIndex()); } @@ -1145,9 +1145,9 @@ m_ctlTaskCountProgress.SetProgress(spTaskStats->GetProcessedCount(), spTaskStats->GetTotalCount()); m_ctlTaskSizeProgress.SetProgress(spTaskStats->GetProcessedSize(), spTaskStats->GetTotalSize()); - GetDlgItem(IDC_DESTINATIONOBJECT_STATIC)->SetWindowText(spTaskStats->GetDestinationPath()); + GetDlgItem(IDC_DESTINATIONOBJECT_STATIC)->SetWindowText(spTaskStats->GetDestinationPath().c_str()); GetDlgItem(IDC_THREADPRIORITY_STATIC)->SetWindowText(GetResManager().LoadString(IDS_PRIORITY0_STRING + PriorityToIndex(spTaskStats->GetThreadPriority()))); - GetDlgItem(IDC_TASKID_STATIC)->SetWindowText(spTaskStats->GetTaskName()); + GetDlgItem(IDC_TASKID_STATIC)->SetWindowText(spTaskStats->GetTaskName().c_str()); } void CStatusDlg::SetWindowTitle(PCTSTR pszText) Index: src/chext/DropMenuExt.cpp =================================================================== diff -u -N -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) +++ src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -155,7 +155,7 @@ // fill struct COPYDATASTRUCT cds; cds.dwData = spSelectedItem->IsSpecialOperation() ? eCDType_TaskDefinitionContentSpecial : eCDType_TaskDefinitionContent; - cds.lpData = (void*)(const wchar_t*)wstrData; + cds.lpData = (void*)wstrData.c_str(); cds.cbData = (DWORD)((wstrData.GetLength() + 1) * sizeof(wchar_t)); // send a message @@ -186,13 +186,13 @@ { case GCS_HELPTEXTW: { - wcsncpy(reinterpret_cast(pszName), spSelectedItem->GetItemTip(), spSelectedItem->GetItemTip().GetLength() + 1); + wcsncpy(reinterpret_cast(pszName), spSelectedItem->GetItemTip().c_str(), spSelectedItem->GetItemTip().GetLength() + 1); break; } case GCS_HELPTEXTA: { USES_CONVERSION; - CT2A ct2a(spSelectedItem->GetItemTip()); + CT2A ct2a(spSelectedItem->GetItemTip().c_str()); strncpy(reinterpret_cast(pszName), ct2a, strlen(ct2a) + 1); break; } Index: src/chext/MenuExt.cpp =================================================================== diff -u -N -rbe5d5dfa17e79a1db8e64ad2d2ed5faea30399cb -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision be5d5dfa17e79a1db8e64ad2d2ed5faea30399cb) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -199,7 +199,7 @@ // fill struct COPYDATASTRUCT cds; cds.dwData = spSelectedItem->IsSpecialOperation() ? eCDType_TaskDefinitionContentSpecial : eCDType_TaskDefinitionContent; - cds.lpData = (void*)(const wchar_t*)wstrData; + cds.lpData = (void*)wstrData.c_str(); cds.cbData = (DWORD)((wstrData.GetLength() + 1) * sizeof(wchar_t)); // send a message @@ -253,7 +253,7 @@ // calc text size SIZE size; - GetTextExtentPoint32(hDC, spSelectedItem->GetName(), boost::numeric_cast(spSelectedItem->GetName().GetLength()), &size); + GetTextExtentPoint32(hDC, spSelectedItem->GetName().c_str(), boost::numeric_cast(spSelectedItem->GetName().GetLength()), &size); // restore old settings SelectObject(hDC, hOldFont); @@ -325,7 +325,7 @@ rcText.right = lpdis->rcItem.right; rcText.bottom = lpdis->rcItem.bottom; - DrawText(lpdis->hDC, spSelectedItem->GetName(), -1, &rcText, DT_LEFT | DT_SINGLELINE | DT_VCENTER); + DrawText(lpdis->hDC, spSelectedItem->GetName().c_str(), -1, &rcText, DT_LEFT | DT_SINGLELINE | DT_VCENTER); return S_OK; } @@ -352,13 +352,13 @@ { case GCS_HELPTEXTW: { - wcsncpy(reinterpret_cast(pszName), spSelectedItem->GetItemTip(), spSelectedItem->GetItemTip().GetLength() + 1); + wcsncpy(reinterpret_cast(pszName), spSelectedItem->GetItemTip().c_str(), spSelectedItem->GetItemTip().GetLength() + 1); break; } case GCS_HELPTEXTA: { USES_CONVERSION; - CT2A ct2a(spSelectedItem->GetItemTip()); + CT2A ct2a(spSelectedItem->GetItemTip().c_str()); strncpy(reinterpret_cast(pszName), ct2a, strlen(ct2a) + 1); break; } Index: src/chext/TContextMenuHandler.cpp =================================================================== diff -u -N -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -69,7 +69,7 @@ mii.fState = (spRootMenuItem->GetChildrenCount() > 0) ? MFS_ENABLED : MFS_GRAYED; mii.wID = m_uiNextMenuID++; mii.hSubMenu = hSubMenu; - mii.dwTypeData = (PTSTR)(PCTSTR)spMenuItem->GetName(); + mii.dwTypeData = (PTSTR)spMenuItem->GetName().c_str(); mii.cch = (UINT)spMenuItem->GetName().GetLength(); ::InsertMenuItem(hMenu, uiFirstItemPosition++, TRUE, &mii); @@ -85,7 +85,7 @@ bool bEnableOwnerDrawnItem = m_bEnableOwnerDrawnPaths && spMenuItem->SpecifiesDestinationPath(); bool bEnableItem = rShellExtData.VerifyItemCanBeExecuted(spMenuItem); - ::InsertMenu(hMenu, uiFirstItemPosition++, MF_BYPOSITION | MF_STRING | (bEnableItem ? MF_ENABLED : MF_GRAYED) | (bEnableOwnerDrawnItem ? MF_OWNERDRAW : 0), m_uiNextMenuID, spMenuItem->GetName()); + ::InsertMenu(hMenu, uiFirstItemPosition++, MF_BYPOSITION | MF_STRING | (bEnableItem ? MF_ENABLED : MF_GRAYED) | (bEnableOwnerDrawnItem ? MF_OWNERDRAW : 0), m_uiNextMenuID, spMenuItem->GetName().c_str()); if(bOverrideDefaultItem && rShellExtData.IsDefaultItem(spMenuItem)) ::SetMenuDefaultItem(hMenu, m_uiNextMenuID, FALSE); Index: src/libchcore/ConfigNodeContainer.cpp =================================================================== diff -u -N -r7c79146c750dfd74b7bdc9f01e51921a91596a75 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 7c79146c750dfd74b7bdc9f01e51921a91596a75) +++ src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -236,7 +236,7 @@ for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { - if(iter->m_strNodeName.Get().StartsWith(strReplace)) + if(iter->m_strNodeName.Get().StartsWith(strReplace.c_str())) { bFound = true; @@ -263,7 +263,7 @@ for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { - if(iter->m_strNodeName.Get().StartsWith(strReplace)) + if(iter->m_strNodeName.Get().StartsWith(strReplace.c_str())) { bFound = true; @@ -303,7 +303,7 @@ for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { - if(iter->m_strNodeName.Get().StartsWith(strSearch)) + if(iter->m_strNodeName.Get().StartsWith(strSearch.c_str())) { setExistingNames.insert(std::make_pair(iter->m_strNodeName.Get(), iter->m_iOrder)); } @@ -355,14 +355,14 @@ for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { TString strCurrentNode = iter->m_strNodeName.Get(); - if(strCurrentNode.StartsWith(strSearch)) + if(strCurrentNode.StartsWith(strSearch.c_str())) { strCurrentNode.MidSelf(strSearch.GetLength()); size_t stPos = strCurrentNode.Find(_T("]")); if(stPos == std::numeric_limits::max()) THROW_CORE_EXCEPTION(eErr_InvalidData); - size_t stNumber = boost::lexical_cast(strCurrentNode.Left(stPos)); + size_t stNumber = boost::lexical_cast(strCurrentNode.Left(stPos).c_str()); stMaxNodeNumber = std::max(stMaxNodeNumber, stNumber + 1); } } @@ -480,66 +480,57 @@ size_t stLastBracketID = std::numeric_limits::max(); TString strGroupNode; - TCHAR szData[1024]; -szData; boost::property_tree::wiptree treeSubnodes; - int iNode = 0; -iNode; boost::shared_lock lock(m_lock); for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { const TString& rNodeName = iter->m_strNodeName.Get(); - // tmp - //_sntprintf_s(szData, 1024, _TRUNCATE, _T("ExportToPropertyTree (%ld): %s\n"), iNode++, (PCTSTR)rNodeName); -// OutputDebugString(szData); - // /tmp - TString strNodeName = rNodeName; size_t stBracketPos = strNodeName.Find(_T("[")); if(stBracketPos != TString::npos) { // there is a bracket in the node name - this element is a part of a hierarchy of similar nodes - size_t stSecondBracketPos = strNodeName.Find(_T("["), stBracketPos + 1); + size_t stSecondBracketPos = strNodeName.Find(_T("]"), stBracketPos + 1); if(stSecondBracketPos == TString::npos) THROW_CORE_EXCEPTION(eErr_InvalidData); strGroupNode = strNodeName.Left(stBracketPos); TString strSubnodeName = strNodeName.Mid(stSecondBracketPos + 1); - size_t stBracketID = boost::lexical_cast(strNodeName.Mid(stBracketPos, stSecondBracketPos - stBracketPos - 1)); + size_t stBracketID = boost::lexical_cast(strNodeName.Mid(stBracketPos + 1, stSecondBracketPos - stBracketPos - 1)); if(stBracketID != stLastBracketID) { // new ID - add new property tree node if(!treeSubnodes.empty()) { - rTree.add_child((PCTSTR)strGroupNode, treeSubnodes); + rTree.add_child(strGroupNode.c_str(), treeSubnodes); treeSubnodes.clear(); } } // same ID - add new element to existing property tree node - treeSubnodes.put((PCTSTR)strSubnodeName, iter->m_strValue); + treeSubnodes.put(strSubnodeName.c_str(), iter->m_strValue); } else { // add the subnodes from previous bracket-based entries if(!treeSubnodes.empty()) { - rTree.add_child((PCTSTR)strGroupNode, treeSubnodes); + rTree.add_child(strGroupNode.c_str(), treeSubnodes); treeSubnodes.clear(); } // no bracket in the node name - this is just a standard entry - rTree.add((PCTSTR)strNodeName, iter->m_strValue); + rTree.add(strNodeName.c_str(), iter->m_strValue); } } // add the last subnode if not empty if(!treeSubnodes.empty()) - rTree.add_child((PCTSTR)strGroupNode, treeSubnodes); + rTree.add_child(strGroupNode.c_str(), treeSubnodes); } void ConfigNodeContainer::Dump() @@ -549,7 +540,7 @@ for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { - _sntprintf_s(szBuffer, stBufferSize, _TRUNCATE, _T("Node (oid %Iu): %s.%ld = %s\n"), iter->m_stObjectID, (PCTSTR)iter->m_strNodeName.Get(), iter->m_iOrder.Get(), (PCTSTR)iter->m_strValue.Get()); + _sntprintf_s(szBuffer, stBufferSize, _TRUNCATE, _T("Node (oid %Iu): %s.%ld = %s\n"), iter->m_stObjectID, iter->m_strNodeName.Get().c_str(), iter->m_iOrder.Get(), iter->m_strValue.Get().c_str()); OutputDebugString(szBuffer); } } Index: src/libchcore/ConfigNodeContainer.h =================================================================== diff -u -N -rb1e03eb232a784d6e2d40f67cbbbb33be0972228 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/ConfigNodeContainer.h (.../ConfigNodeContainer.h) (revision b1e03eb232a784d6e2d40f67cbbbb33be0972228) +++ src/libchcore/ConfigNodeContainer.h (.../ConfigNodeContainer.h) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -88,7 +88,7 @@ ConfigNodeContainer::NodeContainer::const_iterator iterFnd = m_mic.find(boost::make_tuple(pszPropName, 0)); if(iterFnd != m_mic.end()) - tResult = boost::lexical_cast((PCTSTR)(*iterFnd).m_strValue.Get()); + tResult = boost::lexical_cast((*iterFnd).m_strValue.Get().c_str()); return tResult; } @@ -120,7 +120,7 @@ else if((*iterFnd).m_strValue.Get().CompareNoCase(_T("true")) == 0) bResult = true; else - bResult = boost::lexical_cast((PCTSTR)(*iterFnd).m_strValue.Get()); + bResult = boost::lexical_cast((*iterFnd).m_strValue.Get().c_str()); } return bResult; @@ -133,7 +133,7 @@ ConfigNodeContainer::NodeContainer::const_iterator iterFnd = m_mic.find(boost::make_tuple(pszPropName, 0)); if(iterFnd != m_mic.end()) { - rValue = boost::lexical_cast((PCTSTR)(*iterFnd).m_strValue.Get()); + rValue = boost::lexical_cast((*iterFnd).m_strValue.Get().c_str()); return true; } @@ -167,7 +167,7 @@ else if(strValue.CompareNoCase(_T("true")) == 0) rValue = true; else - rValue = boost::lexical_cast((PCTSTR)strValue); + rValue = boost::lexical_cast(strValue.c_str()); return true; } Index: src/libchcore/TBinarySerializer.cpp =================================================================== diff -u -N -r548382442cbf7bed7f744b279ce3f66b54992724 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TBinarySerializer.cpp (.../TBinarySerializer.cpp) (revision 548382442cbf7bed7f744b279ce3f66b54992724) +++ src/libchcore/TBinarySerializer.cpp (.../TBinarySerializer.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -467,7 +467,7 @@ try { - std::wstring wstrData((const wchar_t*)strValue); + std::wstring wstrData(strValue.c_str()); (*m_spArchive) & wstrData; } catch (std::exception& e) Index: src/libchcore/TConfig.cpp =================================================================== diff -u -N -rffdee64cb0f2d472bb4102abe80ee12783e794c8 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision ffdee64cb0f2d472bb4102abe80ee12783e794c8) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -99,7 +99,7 @@ boost::property_tree::wiptree tPropertyTree; GetImpl()->ExportToPropertyTree(tPropertyTree); - std::wofstream ofs(GetImpl()->m_strFilePath, std::ios_base::out); + std::wofstream ofs(GetImpl()->m_strFilePath.c_str(), std::ios_base::out); boost::property_tree::xml_parser::write_xml(ofs, tPropertyTree); } @@ -110,7 +110,7 @@ boost::property_tree::wiptree tPropertyTree; - std::wistringstream ifs((const wchar_t*)strInput, std::ios_base::in); + std::wistringstream ifs(strInput.c_str(), std::ios_base::in); boost::property_tree::xml_parser::read_xml(ifs, tPropertyTree); boost::unique_lock lock(GetImpl()->m_lock); @@ -186,7 +186,7 @@ spRowReader->GetValue(_T("node_order"), iOrder); spRowReader->GetValue(_T("value"), strValue); - m_pImpl->AddEntry(strName, iOrder, strValue); // also resets modification state inside + m_pImpl->AddEntry(strName.c_str(), iOrder, strValue); // also resets modification state inside } } Index: src/libchcore/TConfigSerializers.h =================================================================== diff -u -N -rb1e03eb232a784d6e2d40f67cbbbb33be0972228 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TConfigSerializers.h (.../TConfigSerializers.h) (revision b1e03eb232a784d6e2d40f67cbbbb33be0972228) +++ src/libchcore/TConfigSerializers.h (.../TConfigSerializers.h) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -42,7 +42,7 @@ TString wstrData; bool bRes = rConfig.GetValue(pszPropName, wstrData); if(bRes) - strValue = wstrData; + strValue = wstrData.c_str(); else strValue.Empty(); return bRes; @@ -73,7 +73,7 @@ { for(size_t stIndex = 0; stIndex < vToConvert.GetCount(); ++stIndex) { - vValues.push_back((PCTSTR)vToConvert.GetAt(stIndex)); + vValues.push_back(vToConvert.GetAt(stIndex).c_str()); } } Index: src/libchcore/TFileFilter.cpp =================================================================== diff -u -N -rffdee64cb0f2d472bb4102abe80ee12783e794c8 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TFileFilter.cpp (.../TFileFilter.cpp) (revision ffdee64cb0f2d472bb4102abe80ee12783e794c8) +++ src/libchcore/TFileFilter.cpp (.../TFileFilter.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -308,7 +308,7 @@ bool bRes=false; for(TStringArray::const_iterator iterMask = m_astrMask.Get().Begin(); iterMask != m_astrMask.Get().End(); ++iterMask) { - if(MatchMask(*iterMask, spInfo->GetFullFilePath().GetFileName().ToString())) + if(MatchMask((*iterMask).c_str(), spInfo->GetFullFilePath().GetFileName().ToString())) bRes = true; } if(!bRes) @@ -320,7 +320,7 @@ { for(TStringArray::const_iterator iterExcludeMask = m_astrExcludeMask.Get().Begin(); iterExcludeMask != m_astrExcludeMask.Get().End(); ++iterExcludeMask) { - if(MatchMask(*iterExcludeMask, spInfo->GetFullFilePath().GetFileName().ToString())) + if(MatchMask((*iterExcludeMask).c_str(), spInfo->GetFullFilePath().GetFileName().ToString())) return false; } } Index: src/libchcore/TFileFiltersArray.cpp =================================================================== diff -u -N -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -66,7 +66,9 @@ { TConfig cfgNode; rFilter.StoreInConfig(cfgNode); - rConfig.AddSubConfig(TString(pszNodeName) + _T(".FilterDefinition"), cfgNode); + + TString strNode = TString(pszNodeName) + _T(".FilterDefinition"); + rConfig.AddSubConfig(strNode.c_str(), cfgNode); } } Index: src/libchcore/TLocalFilesystem.cpp =================================================================== diff -u -N -ra5aa3c3cb78f3767641de2627d1a49a1dc35b429 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision a5aa3c3cb78f3767641de2627d1a49a1dc35b429) +++ src/libchcore/TLocalFilesystem.cpp (.../TLocalFilesystem.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -46,9 +46,7 @@ UINT uiDrvType = DRIVE_UNKNOWN; if(!spPath.IsNetworkPath()) { - std::wstring wstrDrive = spPath.ToWString(); - - if(!wstrDrive.empty()) + if(!spPath.IsEmpty()) { TSmartPath pathDrive = spPath.GetDrive(); pathDrive.AppendSeparatorIfDoesNotExist(); Index: src/libchcore/TPath.cpp =================================================================== diff -u -N -r7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TPath.cpp (.../TPath.cpp) (revision 7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66) +++ src/libchcore/TPath.cpp (.../TPath.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -250,7 +250,7 @@ // ============================================================================ const wchar_t* TSmartPath::ToString() const { - return m_strPath; + return m_strPath.c_str(); } // ============================================================================ @@ -332,9 +332,9 @@ bool TSmartPath::IsChildOf(const TSmartPath& rPath, bool bCaseSensitive) const { if(bCaseSensitive) - return m_strPath.StartsWith(rPath.m_strPath); + return m_strPath.StartsWith(rPath.m_strPath.c_str()); else - return m_strPath.StartsWithNoCase(rPath.m_strPath); + return m_strPath.StartsWithNoCase(rPath.m_strPath.c_str()); } // ============================================================================ @@ -350,9 +350,9 @@ { bool bStartsWith = false; if(bCaseSensitive) - bStartsWith = m_strPath.StartsWith(rReferenceBasePath.m_strPath); + bStartsWith = m_strPath.StartsWith(rReferenceBasePath.m_strPath.c_str()); else - bStartsWith = m_strPath.StartsWithNoCase(rReferenceBasePath.m_strPath); + bStartsWith = m_strPath.StartsWithNoCase(rReferenceBasePath.m_strPath.c_str()); if(bStartsWith) { Index: src/libchcore/TSQLiteSerializerContainer.cpp =================================================================== diff -u -N -r7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66) +++ src/libchcore/TSQLiteSerializerContainer.cpp (.../TSQLiteSerializerContainer.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -126,9 +126,9 @@ TString strQuery = rGroupRows.front()->GetQuery(m_strName); if(!strQuery.IsEmpty()) { - DBTRACE2(_T("Preparing query for %lu records: %s\n"), (unsigned long)iterMapGroups->second.size(), (PCTSTR)strQuery); + DBTRACE2(_T("Preparing query for %lu records: %s\n"), (unsigned long)iterMapGroups->second.size(), strQuery.c_str()); - tStatement.Prepare(strQuery); + tStatement.Prepare(strQuery.c_str()); for(std::vector::iterator iterRow = iterMapGroups->second.begin(); iterRow != iterMapGroups->second.end(); ++iterRow) { @@ -163,7 +163,7 @@ strItemsToRemove.TrimRightSelf(_T(",")); TString strQuery = boost::str(boost::wformat(L"DELETE FROM %1% WHERE id IN (%2%)") % m_strName % strItemsToRemove).c_str(); - tStatement.Prepare(strQuery); + tStatement.Prepare(strQuery.c_str()); DBTRACE1_D(_T("Executing query: %s\n"), (PCTSTR)strQuery); tStatement.Step(); Index: src/libchcore/TSQLiteSerializerFactory.cpp =================================================================== diff -u -N -rb7655a8f0721e5454befd29e3e067748eb0521e9 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSQLiteSerializerFactory.cpp (.../TSQLiteSerializerFactory.cpp) (revision b7655a8f0721e5454befd29e3e067748eb0521e9) +++ src/libchcore/TSQLiteSerializerFactory.cpp (.../TSQLiteSerializerFactory.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -53,14 +53,14 @@ strName = boost::lexical_cast(u).c_str(); } - TSmartPath pathTask = PathFromString(strName); + TSmartPath pathTask = PathFromWString(strName); if(!pathTask.HasFileRoot()) { if(!strName.EndsWithNoCase(_T(".sqlite"))) strName += _T(".sqlite"); pathTask = m_pathSerializeDir; - pathTask += PathFromString(strName); + pathTask += PathFromWString(strName); } if(bForceRecreate) Index: src/libchcore/TSQLiteSerializerRowData.cpp =================================================================== diff -u -N -r7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66) +++ src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -160,7 +160,7 @@ ModifyColumnData(stColIndex) = (unsigned long long)0; else { - wchar_t* pszBuffer = m_poolStrings.AllocForString(strValue); + wchar_t* pszBuffer = m_poolStrings.AllocForString(strValue.c_str()); ModifyColumnData(stColIndex) = (unsigned long long)(void*)pszBuffer; } Index: src/libchcore/TSQLiteSerializerRowReader.cpp =================================================================== diff -u -N -rfc67a825635691930b3ac00dc95b16e59f3d2fae -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSQLiteSerializerRowReader.cpp (.../TSQLiteSerializerRowReader.cpp) (revision fc67a825635691930b3ac00dc95b16e59f3d2fae) +++ src/libchcore/TSQLiteSerializerRowReader.cpp (.../TSQLiteSerializerRowReader.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -50,10 +50,10 @@ { // generate query to retrieve data from db TString strQuery; - strQuery = boost::str(boost::wformat(L"SELECT %1% FROM %2% ORDER BY id") % (PCTSTR)m_rColumns.GetCommaSeparatedColumns() % (PCTSTR)m_strContainerName).c_str(); + strQuery = boost::str(boost::wformat(L"SELECT %1% FROM %2% ORDER BY id") % m_rColumns.GetCommaSeparatedColumns().c_str() % m_strContainerName.c_str()).c_str(); DBTRACE1_D(_T("Executing query: %s\n"), (PCTSTR)strQuery); - m_spStatement->Prepare(strQuery); + m_spStatement->Prepare(strQuery.c_str()); m_bInitialized = true; } @@ -161,7 +161,7 @@ if(!m_bInitialized) THROW_CORE_EXCEPTION(eErr_SerializeLoadError); - size_t stColumn = m_rColumns.GetColumnIndex(strColName); + size_t stColumn = m_rColumns.GetColumnIndex(strColName.c_str()); return boost::numeric_cast(stColumn); } Index: src/libchcore/TSQLiteStatement.cpp =================================================================== diff -u -N -r320c4eb6ba3a38dcd6fbda6a9a12a8350a153e41 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSQLiteStatement.cpp (.../TSQLiteStatement.cpp) (revision 320c4eb6ba3a38dcd6fbda6a9a12a8350a153e41) +++ src/libchcore/TSQLiteStatement.cpp (.../TSQLiteStatement.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -168,7 +168,7 @@ void TSQLiteStatement::BindValue(int iColumn, const TString& strText) { - BindValue(iColumn, (PCTSTR)strText); + BindValue(iColumn, strText.c_str()); } void TSQLiteStatement::BindValue(int iColumn, const TSmartPath& path) Index: src/libchcore/TSharedMemory.cpp =================================================================== diff -u -N -r548382442cbf7bed7f744b279ce3f66b54992724 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision 548382442cbf7bed7f744b279ce3f66b54992724) +++ src/libchcore/TSharedMemory.cpp (.../TSharedMemory.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -123,7 +123,7 @@ void TSharedMemory::Create(const wchar_t* pszName, const TString& wstrData) { - Create(pszName, (const BYTE*)(const wchar_t*)wstrData, (wstrData.GetLength() + 1) * sizeof(wchar_t)); + Create(pszName, (const BYTE*)wstrData.c_str(), (wstrData.GetLength() + 1) * sizeof(wchar_t)); } void TSharedMemory::Create(const wchar_t* pszName, const BYTE* pbyData, size_t stSize) @@ -212,7 +212,7 @@ void TSharedMemory::Write(const TString& wstrData) { - Write((const BYTE*)(const wchar_t*)wstrData, (wstrData.GetLength() + 1) * sizeof(wchar_t)); + Write((const BYTE*)wstrData.c_str(), (wstrData.GetLength() + 1) * sizeof(wchar_t)); } void TSharedMemory::Write(const BYTE* pbyData, size_t stSize) Index: src/libchcore/TSpeedTracker.cpp =================================================================== diff -u -N -r19925be73ffcadd9f345f10e03e55aadb3f0eeac -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSpeedTracker.cpp (.../TSpeedTracker.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) +++ src/libchcore/TSpeedTracker.cpp (.../TSpeedTracker.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -229,14 +229,14 @@ Clear(); - m_stNextSamplePos = boost::lexical_cast((PCTSTR)arrStrings.GetAt(0)); - m_dPartialSpeedNotInSamples = boost::lexical_cast((PCTSTR)arrStrings.GetAt(1)); - m_ullTimeIntervalNotInSamples = boost::lexical_cast((PCTSTR)arrStrings.GetAt(2)); - m_ullZeroIntervalData = boost::lexical_cast((PCTSTR)arrStrings.GetAt(3)); + m_stNextSamplePos = boost::lexical_cast(arrStrings.GetAt(0).c_str()); + m_dPartialSpeedNotInSamples = boost::lexical_cast(arrStrings.GetAt(1).c_str()); + m_ullTimeIntervalNotInSamples = boost::lexical_cast(arrStrings.GetAt(2).c_str()); + m_ullZeroIntervalData = boost::lexical_cast((PCTSTR)arrStrings.GetAt(3).c_str()); for(size_t stIndex = 4; stIndex < arrStrings.GetCount(); ++stIndex) { - m_vSamples[stIndex - 4] = boost::lexical_cast((PCTSTR)arrStrings.GetAt(stIndex)); + m_vSamples[stIndex - 4] = boost::lexical_cast(arrStrings.GetAt(stIndex).c_str()); } } Index: src/libchcore/TString.cpp =================================================================== diff -u -N -r7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TString.cpp (.../TString.cpp) (revision 7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66) +++ src/libchcore/TString.cpp (.../TString.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -661,16 +661,6 @@ m_pszData[tSize] = L'\0'; } -/** Cast operator - tries to return a pointer to wchar_t* using the current internal - * buffer. If the internal buffer is in ansi format, then the debug version asserts - * and release return NULL. - * \return Pointer to an unicode TString (could be null). - */ -TString::operator const wchar_t*() const -{ - return m_pszData ? m_pszData : L""; -} - void TString::SetString(const wchar_t* pszStart, size_t stCount) { if(!pszStart || stCount == 0) @@ -713,6 +703,11 @@ } } +const wchar_t* TString::c_str() const +{ + return m_pszData ? m_pszData : L""; +} + END_CHCORE_NAMESPACE chcore::TString operator+(const wchar_t* pszString, const chcore::TString& str) Index: src/libchcore/TString.h =================================================================== diff -u -N -r7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TString.h (.../TString.h) (revision 7b830c34855c8aaa81aac2c6e0ca0fa6bae95e66) +++ src/libchcore/TString.h (.../TString.h) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -89,9 +89,6 @@ bool operator>(const TString& str) const { return Compare(str) >= 0; }; /// Makes case sensitive comparison to the TString object ( see Compare(const TString& str) ) bool operator!=(const TString& str) const { return Compare(str) != 0; }; - - // cast operators - operator const wchar_t*() const; ///< Cast operator to wchar_t* /**@}*/ /** \name Standard operations */ @@ -137,6 +134,8 @@ bool GetAt(size_t tPos, wchar_t& wch) const; ///< Gets a character at a specified position wchar_t GetAt(size_t tPos) const; + const wchar_t* c_str() const; + wchar_t* GetBuffer(size_t tMinSize); ///< Gives user access to the unicode internal buffer void ReleaseBuffer(); ///< Releases the buffer get from get_bufferx functions void ReleaseBufferSetLength(size_t tSize); @@ -164,7 +163,7 @@ inline std::wostream& operator<<(std::wostream& os, const TString& rString) { - return os << std::wstring((const wchar_t*)rString); + return os << std::wstring(rString.c_str()); } END_CHCORE_NAMESPACE Index: src/libchcore/TSubTaskBase.cpp =================================================================== diff -u -N -ra7834ba278464cb62739f22d35f9bc16269706a1 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision a7834ba278464cb62739f22d35f9bc16269706a1) +++ src/libchcore/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -100,7 +100,7 @@ // set the dest path TString strCheckPath = GetTaskPropValue(rConfig); strCheckPath.Replace(_T("%name"), pathFilename.ToString()); - TSmartPath pathCheckPath(PathFromString(strCheckPath)); + TSmartPath pathCheckPath(PathFromWString(strCheckPath)); // when adding to strDstPath check if the path already exists - if so - try again int iCounter = 1; Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -N -rffdee64cb0f2d472bb4102abe80ee12783e794c8 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision ffdee64cb0f2d472bb4102abe80ee12783e794c8) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -227,7 +227,7 @@ strFormat.Replace(_T("%dstpath"), pathDestination.ToString()); strFormat.Replace(_T("%currindex"), boost::lexical_cast(m_tProgressInfo.GetCurrentIndex()).c_str()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); size_t stIndex = m_tProgressInfo.GetCurrentIndex(); for(; stIndex < stSize; stIndex++) @@ -403,7 +403,7 @@ strFormat = _T("Kill request while main copying file %srcpath -> %dstpath"); strFormat.Replace(_T("%srcpath"), pData->spSrcFile->GetFullFilePath().ToString()); strFormat.Replace(_T("%dstpath"), pData->pathDstFile.ToString()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); return TSubTaskBase::eSubResult_KillRequest; } @@ -673,7 +673,7 @@ strFormat.Replace(_T("%cdsize2"), boost::lexical_cast(rBufferSizes.GetCDSize()).c_str()); strFormat.Replace(_T("%lansize2"), boost::lexical_cast(rBufferSizes.GetLANSize()).c_str()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); if(!rBuffer.IsInitialized()) { @@ -734,7 +734,7 @@ TString strFormat = _T("Cancel request [error %errno] while opening source file %path (OpenSourceFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), spPathToOpen.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); return TSubTaskBase::eSubResult_CancelRequest; } @@ -748,7 +748,7 @@ TString strFormat = _T("Retrying [error %errno] to open source file %path (OpenSourceFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), spPathToOpen.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); bRetry = true; break; @@ -825,7 +825,7 @@ // log TString strFormat = _T("Cancel request while checking result of dialog before opening source file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%path"), pathDstFile.ToString()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); return TSubTaskBase::eSubResult_CancelRequest; } @@ -849,7 +849,7 @@ TString strFormat = _T("Retrying [error %errno] to open destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), pathDstFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); bRetry = true; @@ -861,7 +861,7 @@ TString strFormat = _T("Cancel request [error %errno] while opening destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), pathDstFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); return TSubTaskBase::eSubResult_CancelRequest; } @@ -910,7 +910,7 @@ TString strFormat = _T("Retrying [error %errno] to open destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_t("%path"), pathDstFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); bRetry = true; @@ -922,7 +922,7 @@ TString strFormat = _T("Cancel request [error %errno] while opening destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), pathDstFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); return TSubTaskBase::eSubResult_CancelRequest; } @@ -964,7 +964,7 @@ strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_t("%path"), pathFile.ToString()); strFormat.Replace(_t("%pos"), boost::lexical_cast(llDistance).c_str()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { pathFile.ToString(), NULL, eSeekError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); @@ -1013,7 +1013,7 @@ TString strFormat = _T("Error %errno while setting size of file %path to 0"); strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_t("%path"), pathFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { pathFile.ToString(), NULL, eResizeError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); @@ -1063,7 +1063,7 @@ strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_t("%count"), boost::lexical_cast(dwToRead).c_str()); strFormat.Replace(_t("%path"), pathFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { pathFile.ToString(), NULL, eReadError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); @@ -1115,7 +1115,7 @@ strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_t("%count"), boost::lexical_cast(dwToWrite).c_str()); strFormat.Replace(_t("%path"), pathFile.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { pathFile.ToString(), NULL, eWriteError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); @@ -1225,7 +1225,7 @@ strFormat = _T("Error %errno while calling CreateDirectory %path (ProcessFiles)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), pathDirectory.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { pathDirectory.ToString(), NULL, eCreateError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); @@ -1281,7 +1281,7 @@ TString strFormat = _T("Not enough free space on disk - needed %needsize bytes for data, available: %availablesize bytes."); strFormat.Replace(_t("%needsize"), boost::lexical_cast(ullNeededSize).c_str()); strFormat.Replace(_t("%availablesize"), boost::lexical_cast(ullAvailableSize).c_str()); - rLog.logw(strFormat); + rLog.logw(strFormat.c_str()); if(!spSrcPaths->IsEmpty()) { Index: src/libchcore/TSubTaskDelete.cpp =================================================================== diff -u -N -rffdee64cb0f2d472bb4102abe80ee12783e794c8 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision ffdee64cb0f2d472bb4102abe80ee12783e794c8) +++ src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -200,7 +200,7 @@ strFormat = _T("Error #%errno while deleting file/folder %path"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { spFileInfo->GetFullFilePath().ToString(), NULL, eDeleteError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); Index: src/libchcore/TSubTaskFastMove.cpp =================================================================== diff -u -N -rffdee64cb0f2d472bb4102abe80ee12783e794c8 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision ffdee64cb0f2d472bb4102abe80ee12783e794c8) +++ src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -254,7 +254,7 @@ strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%srcpath"), spFileInfo->GetFullFilePath().ToString()); strFormat.Replace(_T("%dstpath"), pathDestination.ToString()); - rLog.loge(strFormat); + rLog.loge(strFormat.c_str()); FEEDBACK_FILEERROR ferr = { pathSrc.ToString(), pathDestinationPath.ToString(), eFastMoveError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)spFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); Index: src/libchcore/TSubTaskScanDirectory.cpp =================================================================== diff -u -N -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -213,7 +213,7 @@ // log strFormat = _T("Adding file/folder (clipboard) : %path ..."); strFormat.Replace(_T("%path"), pathCurrent.ToString()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); // add if needed if(spFileInfo->IsDirectory()) @@ -227,14 +227,14 @@ // log strFormat = _T("Added folder %path"); strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); } // don't add folder contents when moving inside one disk boundary // log strFormat = _T("Recursing folder %path"); strFormat.Replace(_t("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); ScanDirectory(spFileInfo->GetFullFilePath(), spBasePath, true, !bIgnoreDirs || bForceDirectories, rafFilters); @@ -256,7 +256,7 @@ // log strFormat = _T("Added file %path"); strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat); + rLog.logi(strFormat.c_str()); } } Index: src/libchcore/TTask.cpp =================================================================== diff -u -N -ra3d1e4c03280ece94af75d9aef32a65266cf8050 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TTask.cpp (.../TTask.cpp) (revision a3d1e4c03280ece94af75d9aef32a65266cf8050) +++ src/libchcore/TTask.cpp (.../TTask.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -547,7 +547,7 @@ strFormat.Replace(_t("%hour"), boost::lexical_cast(tm.GetHour()).c_str()); strFormat.Replace(_t("%minute"), boost::lexical_cast(tm.GetMinute()).c_str()); strFormat.Replace(_t("%second"), boost::lexical_cast(tm.GetSecond()).c_str()); - m_log.logi(strFormat); + m_log.logi(strFormat.c_str()); } void TTask::OnEndOperation() @@ -561,7 +561,7 @@ strFormat.Replace(_t("%hour"), boost::lexical_cast(tm.GetHour()).c_str()); strFormat.Replace(_t("%minute"), boost::lexical_cast(tm.GetMinute()).c_str()); strFormat.Replace(_t("%second"), boost::lexical_cast(tm.GetSecond()).c_str()); - m_log.logi(strFormat); + m_log.logi(strFormat.c_str()); } void TTask::RequestStopThread() Index: src/libchcore/TTaskManager.cpp =================================================================== diff -u -N -rc8e73b75027d5e17fb8b1e1eb40e64f40fc62547 -r2fe97a93f21771d75901d4b6559057d1ea055104 --- src/libchcore/TTaskManager.cpp (.../TTaskManager.cpp) (revision c8e73b75027d5e17fb8b1e1eb40e64f40fc62547) +++ src/libchcore/TTaskManager.cpp (.../TTaskManager.cpp) (revision 2fe97a93f21771d75901d4b6559057d1ea055104) @@ -170,7 +170,7 @@ BOOST_FOREACH(const TString& strSerializerPath, vTasksSerializersToRemove) { // delete associated files - DeleteFile(strSerializerPath); + DeleteFile(strSerializerPath.c_str()); } } @@ -501,7 +501,7 @@ TSmartPath TTaskManager::CreateTaskLogPath(const TString& strTaskUuid) const { - TSmartPath pathLog = m_pathLogDir + PathFromString(TString(_T("Task-")) + strTaskUuid + _T(".log")); + TSmartPath pathLog = m_pathLogDir + PathFromWString(TString(_T("Task-")) + strTaskUuid + _T(".log")); return pathLog; }