BOOL CZipImplement::CreatedMultipleDirectory(wchar_t* direct)
{
std::wstring Directoryname = direct; if (Directoryname[Directoryname.length() - 1] != '\\')
{
Directoryname.append(1, '\\');
}
std::vector<std::wstring> vpath;
std::wstring strtemp;
BOOL bSuccess = FALSE;
for (int i = 0; i < Directoryname.length(); i++)
{
if ( Directoryname[i] != '\\')
{
strtemp.append(1,Directoryname[i]);
}
else
{
vpath.push_back(strtemp);
strtemp.append(1, '\\');
}
}
std::vector::const_iterator vIter; for (vIter = vpath.begin();vIter != vpath.end(); vIter++)
{
bSuccess = CreateDirectory(vIter->c_str(), NULL) ? TRUE :FALSE;
} return bSuccess;
}
错误提示是:
Error 2 error C2955: 'std::vector' : use of class template requires template argument list
Error 3 error C2955: 'std::vector' : use of class template requires template argument list
Error 4 error C2133: 'vIter' : unknown size
Error 5 error C2512: 'std::_Vector_const_iterator<_Ty,_Alloc::rebind<_Ty>::other>' : no appropriate default constructor available
Error 6 error C2582: 'operator =' function is unavailable in 'std::_Vector_const_iterator<_Ty,_Alloc::rebind<_Ty>::other>'
Error 7 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Ty,_Alloc::rebind<_Ty>::other>' (or there is no acceptable conversion)
Error 8 error C2678: binary '++' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Ty,_Alloc::rebind<_Ty>::other>' (or there is no acceptable conversion)
Error 9 error C2678: binary '->' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Ty,_Alloc::rebind<_Ty>::other>' (or there is no acceptable conversion)
Error 10 error C2039: 'c_str' : is not a member of 'std::_Vector_const_iterator<_Ty,_Alloc::rebind<_Ty>::other>'
应为std::vector<std::wstring>::const_iterator vIter;