|
// *********************************************************
// ドラッグドロップされたファイルを書庫へ登録または更新
// 戻り値 : 0 正常終了, それ以外はエラー
// *********************************************************
int LboxUnzip::Freeze( HDROP hDrop )
{
int i,nFiles;
LboxString LFile;
LFile.Resize( MAX_PATH );
nFiles = DragQueryFile(
hDrop,
0xFFFFFFFF,
LFile.szLboxString,
LFile.nLboxString
);
this->Command.SetChar( 0, 0 );
this->Command.operator = ( "-rD " );
LFile.operator = (&(this->TargetPath));
LFile.Enclose('"');
this->Command.operator += ( &(LFile) );
this->Command.operator += ( " " );
for( i = 0; i < nFiles; i++ ) {
if ( i != 0 ) {
this->Command.operator += ( " " );
}
DragQueryFile(
hDrop,
i,
LFile.szLboxString,
LFile.nLboxString
);
LFile.RemoveFileSpec();
LFile.AddBackslash();
LFile.Enclose( '"' );
this->Command.operator += ( &LFile );
this->Command.operator += ( " " );
DragQueryFile(
hDrop,
i,
LFile.szLboxString,
LFile.nLboxString
);
LFile.StripPath();
LFile.Enclose( '"' );
this->Command.operator += ( &LFile );
}
return LboxUnzip::Zip(
&(this->Command)
);
}
// *********************************************************
// 複数のファイルを書庫登録または更新
// 戻り値 : 0 正常終了, それ以外はエラー
// LPath は、フルパスファイルリスト ( タブ区切り )
// *********************************************************
int LboxUnzip::Freeze( LboxString *LPath )
{
return LboxUnzip::Freeze(
LPath->szLboxString
);
}
int LboxUnzip::Freeze( LPTSTR lpPath )
{
LboxToken LToken;
LboxString LString;
LToken.CreateToken( lpPath, "\t" );
int i;
this->Command.operator = ( "-rD " );
LString.operator = (&(this->TargetPath));
LString.Enclose('"');
this->Command.operator += ( &(LString) );
this->Command.operator += ( " " );
for( i = 0; i < LToken.nCount; i++ ) {
if ( i != 0 ) {
this->Command.operator += ( " " );
}
LString.operator = (LToken.Token[i]);
LString.RemoveFileSpec();
LString.AddBackslash();
LString.Enclose('"');
this->Command.operator += (&LString);
this->Command.operator += ( " " );
LString.operator = (LToken.Token[i]);
LString.StripPath();
LString.Enclose('"');
this->Command.operator += (&LString);
}
return LboxUnzip::Zip(
&(this->Command)
);
}
| |