GetFullPath

 

Description

Get full path of a file.

Syntax

string GetFullPath( LPCSTR lpcszFileName, LPCSTR lpSubPath = NULL, BOOL bLocalized = FALSE )

Parameters

lpcszFileName
[input]File name to search for.
lpSubPath
[input]Optional subfolder of the Origin software path to search in.
bLocalized
[input]TRUE if the given file can be localized so that we will need to first try the localization location first

Return

If the file was found then a string containing the full path file name is returned else an empty string is returned.

Examples

EX1

void    GetFullPath_ex1()
{
    string strFile = "origin.ini";
    string strFullPath = GetFullPath(strFile);
    if( !strFullPath.IsEmpty() )
    {
        string strPath = GetFilePath(strFullPath);
        printf("File %s was found in %s folder.\n", strFile, strPath);
    }
}

Remark

Search Origin's client and then server path to return the full path name of the specified file.

This function will separately look for server and client path only if Origin is a network version. For single user version, this function will simply return the full path from Origin's software path.

See Also

header to Include

origin.h

Reference