mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +01:00
add IsLegalName(), Rename()
This commit is contained in:
parent
fc0a71ea85
commit
9b09e73520
2 changed files with 26 additions and 0 deletions
|
@ -61,6 +61,8 @@ class CXWGamesMgr : public CBase
|
||||||
|
|
||||||
TBool DeleteSelected( TInt aIndex );
|
TBool DeleteSelected( TInt aIndex );
|
||||||
TBool Exists( TGameName* aName );
|
TBool Exists( TGameName* aName );
|
||||||
|
TBool IsLegalName( const TGameName* aName );
|
||||||
|
void Rename( const TDesC16* aCurName, const TDesC16* aNewName );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,13 @@ CXWGamesMgr::Exists( TGameName* aName )
|
||||||
return err == KErrNone;
|
return err == KErrNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TBool
|
||||||
|
CXWGamesMgr::IsLegalName( const TGameName* aName )
|
||||||
|
{
|
||||||
|
RFs fs = iCoeEnv->FsSession();
|
||||||
|
return fs.IsValidName( *aName );
|
||||||
|
} /* IsLegalName */
|
||||||
|
|
||||||
void
|
void
|
||||||
CXWGamesMgr::GameNameToPath( TFileName* aPath, const TDesC16* aName )
|
CXWGamesMgr::GameNameToPath( TFileName* aPath, const TDesC16* aName )
|
||||||
{
|
{
|
||||||
|
@ -219,3 +226,20 @@ CXWGamesMgr::DeleteFileFor( TPtrC16* aName )
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CXWGamesMgr::Rename( const TDesC16* aCurName, const TDesC16* aNewName )
|
||||||
|
{
|
||||||
|
TFileName newName;
|
||||||
|
GameNameToPath( &newName, aNewName );
|
||||||
|
|
||||||
|
TFileName anOldName;
|
||||||
|
GameNameToPath( &anOldName, aCurName );
|
||||||
|
|
||||||
|
RFs fs = iCoeEnv->FsSession();
|
||||||
|
TInt err = fs.Rename( anOldName, newName );
|
||||||
|
XP_ASSERT( err == KErrNone );
|
||||||
|
User::LeaveIfError( err );
|
||||||
|
|
||||||
|
BuildListL();
|
||||||
|
} /* Rename */
|
||||||
|
|
Loading…
Add table
Reference in a new issue