< prev index next >

src/jdk.incubator.jpackage/linux/native/libapplauncher/LinuxPlatform.cpp

Print this page

        

*** 64,88 **** LinuxPlatform::~LinuxPlatform(void) { } TString LinuxPlatform::GetPackageAppDirectory() { return FilePath::IncludeTrailingSeparator( ! GetPackageRootDirectory()) + _T("app"); } TString LinuxPlatform::GetAppName() { TString result = GetModuleFileName(); result = FilePath::ExtractFileName(result); return result; } TString LinuxPlatform::GetPackageLauncherDirectory() { ! return GetPackageRootDirectory(); } TString LinuxPlatform::GetPackageRuntimeBinDirectory() { ! return FilePath::IncludeTrailingSeparator(GetPackageRootDirectory()) + _T("runtime/bin"); } void LinuxPlatform::ShowMessage(TString title, TString description) { printf("%s %s\n", PlatformString(title).toPlatformString(), PlatformString(description).toPlatformString()); --- 64,90 ---- LinuxPlatform::~LinuxPlatform(void) { } TString LinuxPlatform::GetPackageAppDirectory() { return FilePath::IncludeTrailingSeparator( ! GetPackageRootDirectory()) + _T("lib/app"); } TString LinuxPlatform::GetAppName() { TString result = GetModuleFileName(); result = FilePath::ExtractFileName(result); return result; } TString LinuxPlatform::GetPackageLauncherDirectory() { ! return FilePath::IncludeTrailingSeparator( ! GetPackageRootDirectory()) + _T("bin"); } TString LinuxPlatform::GetPackageRuntimeBinDirectory() { ! return FilePath::IncludeTrailingSeparator(GetPackageRootDirectory()) ! + _T("runtime/bin"); } void LinuxPlatform::ShowMessage(TString title, TString description) { printf("%s %s\n", PlatformString(title).toPlatformString(), PlatformString(description).toPlatformString());
*** 123,139 **** } return result; } - void LinuxPlatform::SetCurrentDirectory(TString Value) { - chdir(PlatformString(Value).toPlatformString()); - } - TString LinuxPlatform::GetPackageRootDirectory() { TString filename = GetModuleFileName(); ! return FilePath::ExtractFilePath(filename); } TString LinuxPlatform::GetAppDataDirectory() { TString result; TString home = GetEnv(_T("HOME")); --- 125,145 ---- } return result; } TString LinuxPlatform::GetPackageRootDirectory() { + TString result; TString filename = GetModuleFileName(); ! TString binPath = FilePath::ExtractFilePath(filename); ! ! size_t slash = binPath.find_last_of(TRAILING_PATHSEPARATOR); ! if (slash != TString::npos) { ! result = binPath.substr(0, slash); ! } ! ! return result; } TString LinuxPlatform::GetAppDataDirectory() { TString result; TString home = GetEnv(_T("HOME"));
*** 859,877 **** /* This will eihter be a TOKEN_EOF, TOKEN_CLOSE_BRACKET, or a * TOKEN_EMPTY_CLOSE_BRACKET */ GetNextToken(); - /* Skip until '>', '/>' or EOF. This should really be an error, */ - /* but we are loose */ - // if(CurTokenType == TOKEN_EMPTY_CLOSE_BRACKET || - // CurTokenType == TOKEN_CLOSE_BRACKET || - // CurTokenType == TOKEN_EOF) { - // println("XML Parsing error: wrong kind of token found"); - // return NULL; - // } - if (CurTokenType == TOKEN_EMPTY_CLOSE_BRACKET) { GetNextToken(); /* We are done with the sublevel - fall through to continue */ /* parsing tags at the same level */ } else if (CurTokenType == TOKEN_CLOSE_BRACKET) { --- 865,874 ----
*** 1019,1030 **** } return FindXMLChild(root->_next, name); } ! /* Search for an attribute with the given name and returns the contents. Returns NULL if ! * attribute is not found */ TCHAR* FindXMLAttribute(XMLAttribute* attr, const TCHAR* name) { if (attr == NULL) return NULL; if (JPACKAGE_STRCMP(attr->_name, name) == 0) return attr->_value; return FindXMLAttribute(attr->_next, name); --- 1016,1027 ---- } return FindXMLChild(root->_next, name); } ! /* Search for an attribute with the given name and returns the contents. ! * Returns NULL if attribute is not found */ TCHAR* FindXMLAttribute(XMLAttribute* attr, const TCHAR* name) { if (attr == NULL) return NULL; if (JPACKAGE_STRCMP(attr->_name, name) == 0) return attr->_value; return FindXMLAttribute(attr->_next, name);
< prev index next >