예제 #1
0
파일: path.cpp 프로젝트: 371816210/vlc_vlc
extern "C" char * GetConstPrivatePath(void)
{
    TFileName privatePath;
    TBuf8<KMaxFileName> privatepathutf8;
    size_t len;
    char carray[KMaxFileName];

    if (GetPrivatePath(privatePath) != KErrNone)
    {
        return strdup("C:\\Data\\Others");
    }

    CnvUtfConverter::ConvertFromUnicodeToUtf8( privatepathutf8, privatePath );

    TInt index = 0;
    for (index = 0; index < privatepathutf8.Length(); index++)
    {
        carray[index] = privatepathutf8[index];
    }
    carray[index] = 0;

    if ((len = strnlen((const char *)carray, KMaxFileName) < KMaxFileName))
    {
        carray[len-1] = '\0';
        return strdup((const char *)carray);
    }
    else
    {
        return strdup("C:\\Data\\Others");
    }
}
예제 #2
0
TInt CSecMgrStore::GetPolicyPath(TDes& aFile)
	{
	TInt ret(GetPrivatePath (aFile));

	if ( KErrNone==ret)
		{
		aFile.Append (KPolicyDir);
		aFile.Append (KDirSeparator);

		TRAP (ret, BaflUtils::EnsurePathExistsL (iFsSession, aFile));
		}

	return ret;
	}
예제 #3
0
TInt CSecMgrStore::GetScriptPath(TDes& aFile)
	{
	TInt ret(GetPrivatePath (aFile));

	if ( KErrNone==ret)
		{
		aFile.Append (KScriptDir);
		aFile.Append (KDirSeparator);

		TRAP (ret, BaflUtils::EnsurePathExistsL (iFsSession, aFile));

		if ( KErrAlreadyExists==ret)
			ret = KErrNone;
		}

	return ret;
	}