Project::GetPath

Description

Returns the file system path for the currently opened project. By default, the path includes a trailing backslash. If the project has not been saved, the path to the Origin User Files folder is returned.

Both of these behaviors can be overridden by the passing the PROJ_PATH_NO_ENDING_SLASH or PROJ_PATH_UNSAVED_EMPTY constants as parameters to the function. The constant can be combined per the example provided below.

Syntax

string GetPath( )

Parameters

Optionally accepts the PROJ_PATH_NO_ENDING_SLASH or PROJ_PATH_UNSAVED_EMPTY constants or combined PROJ_PATH_NO_ENDING_SLASH|PROJ_PATH_UNSAVED_EMPTY.

Return

The file system path for the currently opened project.

Examples

EX1

// Print out the file system path for the current project including trailing backslash.
// If project is not saved, the path to the Origin User Files folder is printed.
void    Project_GetPath_ex1()
{
    printf("The path of the project is %s\n", Project.GetPath());
}

EX2

// Print out the file system path for the current project EXCLUDING trailing backslash.
// If project is not saved, the path to the Origin User Files folder is printed.
void    Project_GetPath_ex1()
{
    printf("The path of the project is %s\n", Project.GetPath(PROJ_PATH_NO_ENDING_SLASH));
}

EX2

// Print out the file system path for the current project EXCLUDING trailing backslash.
// If project is not saved, an empty string is returned.
void    Project_GetPath_ex1()
{
    printf("The path of the project is %s\n", Project.GetPath(PROJ_PATH_NO_ENDING_SLASH | PROJ_PATH_UNSAVED_EMPTY ));
}

Remark

See Also

header to Include

origin.h