mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
- Add defaultPath global var and use it instead of creating Path objects all the time a filename is queried and/or xml file is read.
svn path=/trunk/; revision=38352
This commit is contained in:
parent
c5c0af3081
commit
03a011db89
3 changed files with 6 additions and 5 deletions
|
@ -161,9 +161,8 @@ NormalizeFilename ( const string& filename )
|
||||||
{
|
{
|
||||||
if ( filename == "" )
|
if ( filename == "" )
|
||||||
return "";
|
return "";
|
||||||
Path path;
|
string normalizedPath = defaultPath.Fixup ( filename, true );
|
||||||
string normalizedPath = path.Fixup ( filename, true );
|
string relativeNormalizedPath = defaultPath.RelativeFromWorkingDirectory ( normalizedPath );
|
||||||
string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath );
|
|
||||||
return FixSeparator ( relativeNormalizedPath );
|
return FixSeparator ( relativeNormalizedPath );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
|
const Path defaultPath;
|
||||||
|
|
||||||
/* static */ string
|
/* static */ string
|
||||||
Environment::GetVariable ( const string& name )
|
Environment::GetVariable ( const string& name )
|
||||||
{
|
{
|
||||||
|
@ -259,8 +261,7 @@ Project::ExecuteInvocations ()
|
||||||
void
|
void
|
||||||
Project::ReadXml ()
|
Project::ReadXml ()
|
||||||
{
|
{
|
||||||
Path path;
|
head = XMLLoadFile ( xmlfile, defaultPath, xmlbuildfiles );
|
||||||
head = XMLLoadFile ( xmlfile, path, xmlbuildfiles );
|
|
||||||
node = NULL;
|
node = NULL;
|
||||||
for ( size_t i = 0; i < head->subElements.size (); i++ )
|
for ( size_t i = 0; i < head->subElements.size (); i++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,7 @@ extern std::string sSep;
|
||||||
extern std::string sBadSep;
|
extern std::string sBadSep;
|
||||||
extern char cSep;
|
extern char cSep;
|
||||||
extern char cBadSep;
|
extern char cBadSep;
|
||||||
|
extern const Path defaultPath;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define DEF_EXEPREFIX ""
|
#define DEF_EXEPREFIX ""
|
||||||
|
|
Loading…
Reference in a new issue