find, size
This commit is contained in:
@@ -206,15 +206,15 @@ bool CSMPackageInstallDlg::CheckPackages()
|
|||||||
char cwd_[MAX_PATH];
|
char cwd_[MAX_PATH];
|
||||||
_getcwd(cwd_, MAX_PATH);
|
_getcwd(cwd_, MAX_PATH);
|
||||||
RString cwd(cwd_);
|
RString cwd(cwd_);
|
||||||
if( cwd[cwd.GetLength()-1] != '\\' )
|
if( cwd[cwd.size()-1] != '\\' )
|
||||||
cwd += "\\";
|
cwd += "\\";
|
||||||
|
|
||||||
for( i = 0; i < (int) Directories.size(); ++i )
|
for( i = 0; i < (int) Directories.size(); ++i )
|
||||||
{
|
{
|
||||||
RString path = cwd+Directories[i];
|
RString path = cwd+Directories[i];
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
memcpy(buf, path, path.GetLength()+1);
|
memcpy( buf, path, path.size()+1 );
|
||||||
buf[path.GetLength()+1] = 0;
|
buf[path.size()+1] = 0;
|
||||||
|
|
||||||
SHFILEOPSTRUCT op;
|
SHFILEOPSTRUCT op;
|
||||||
memset(&op, 0, sizeof(op));
|
memset(&op, 0, sizeof(op));
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ bool SMPackageUtil::SetPref( RString name, bool val )
|
|||||||
* songs and note skins, this is the first three. */
|
* songs and note skins, this is the first three. */
|
||||||
RString SMPackageUtil::GetPackageDirectory(RString path)
|
RString SMPackageUtil::GetPackageDirectory(RString path)
|
||||||
{
|
{
|
||||||
if( path.Find("CVS") != -1 )
|
if( path.find("CVS") != string::npos )
|
||||||
return ""; // skip
|
return ""; // skip
|
||||||
|
|
||||||
vector<RString> Parts;
|
vector<RString> Parts;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ static bool ExportPackage( RString sPackageName, const vector<RString>& asDirect
|
|||||||
RString buf = f.GetString();
|
RString buf = f.GetString();
|
||||||
|
|
||||||
CZipMemFile control;
|
CZipMemFile control;
|
||||||
control.Write( buf.GetBuffer(0), buf.GetLength() );
|
control.Write( buf.GetBuffer(0), buf.size() );
|
||||||
|
|
||||||
control.Seek( 0, CZipAbstractFile::begin );
|
control.Seek( 0, CZipAbstractFile::begin );
|
||||||
zip.AddNewFile( control, "smzip.ctl" );
|
zip.AddNewFile( control, "smzip.ctl" );
|
||||||
@@ -186,9 +186,9 @@ static bool ExportPackage( RString sPackageName, const vector<RString>& asDirect
|
|||||||
RString sFilePath = asFilePaths[j];
|
RString sFilePath = asFilePaths[j];
|
||||||
|
|
||||||
// don't export "thumbs.db" files or "CVS" folders
|
// don't export "thumbs.db" files or "CVS" folders
|
||||||
if( sFilePath.Find("CVS")!=-1 )
|
if( sFilePath.find("CVS") != string::npos )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
if( sFilePath.Find("Thumbs.db")!=-1 )
|
if( sFilePath.find("Thumbs.db") != string::npos )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
RString sExt = GetExtension( sFilePath );
|
RString sExt = GetExtension( sFilePath );
|
||||||
@@ -499,7 +499,7 @@ void CSmpackageExportDlg::RefreshTree()
|
|||||||
GetDirListing( "Courses\\*.crs", as1, false, false );
|
GetDirListing( "Courses\\*.crs", as1, false, false );
|
||||||
for( unsigned i=0; i<as1.size(); i++ )
|
for( unsigned i=0; i<as1.size(); i++ )
|
||||||
{
|
{
|
||||||
as1[i] = as1[i].Left(as1[i].GetLength()-4); // strip off ".crs"
|
as1[i] = as1[i].Left(as1[i].size()-4); // strip off ".crs"
|
||||||
m_tree.InsertItem( as1[i], item1 );
|
m_tree.InsertItem( as1[i], item1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user