mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Functions4U: Some improvements in LaunchFile, added UpperFolder and Dl (old DLL) now in Linux too
git-svn-id: svn://ultimatepp.org/upp/trunk@2664 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8fa7eb88b8
commit
4b22fe23ee
6 changed files with 24 additions and 22 deletions
|
|
@ -1115,7 +1115,7 @@ String GetNextFolder(String folder, String lastFolder) {
|
|||
return lastFolder;
|
||||
}
|
||||
|
||||
bool ThereIsUpperFolder(String folderName) {
|
||||
bool UpperFolder(String folderName) {
|
||||
if (folderName.IsEmpty())
|
||||
return false;
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
|
@ -1128,7 +1128,7 @@ bool ThereIsUpperFolder(String folderName) {
|
|||
}
|
||||
|
||||
String GetUpperFolder(String folderName) {
|
||||
if (!ThereIsUpperFolder(folderName))
|
||||
if (!UpperFolder(folderName))
|
||||
return folderName;
|
||||
int len = folderName.GetCount();
|
||||
if (folderName[len-1] == DIR_SEP)
|
||||
|
|
@ -1861,13 +1861,7 @@ Value GetVARIANT(VARIANT &result)
|
|||
ret = dbcs;
|
||||
*/
|
||||
{
|
||||
int len = WideCharToMultiByte(CP_UTF8, 0, result.bstrVal, -1, NULL, 0, NULL, NULL);
|
||||
if (len == 0)
|
||||
return Null;
|
||||
Buffer<char> w;
|
||||
w.Alloc(len);
|
||||
WideCharToMultiByte(CP_UTF8, 0, result.bstrVal, -1, w, len, NULL, NULL);
|
||||
ret = ~w;
|
||||
ret = WideToString(result.bstrVal);
|
||||
break;
|
||||
}
|
||||
case VT_LPSTR:
|
||||
|
|
@ -1893,6 +1887,18 @@ Value GetVARIANT(VARIANT &result)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
String WideToString(LPCWSTR wcs, int len) {
|
||||
if (len == -1) {
|
||||
len = WideCharToMultiByte(CP_UTF8, 0, wcs, len, NULL, 0, NULL, NULL);
|
||||
if (len == 0)
|
||||
return Null;
|
||||
}
|
||||
Buffer<char> w(len);
|
||||
WideCharToMultiByte(CP_UTF8, 0, wcs, len, w, len, NULL, NULL);
|
||||
return ~w;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_WIN32)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ bool DirectoryCopyX(const char *dir, const char *newPlace);
|
|||
bool DeleteFolderDeepWildcards(const char *dir, int flags = 0);
|
||||
///////////////////////////////
|
||||
|
||||
bool ThereIsUpperFolder(String folderName);
|
||||
bool UpperFolder(String folderName);
|
||||
String GetUpperFolder(String folderName);
|
||||
String GetNextFolder(String folder, String lastFolder);
|
||||
String GetRealName(String fileName);
|
||||
|
|
@ -436,6 +436,7 @@ private:
|
|||
|
||||
#if defined(PLATFORM_WIN32)
|
||||
Value GetVARIANT(VARIANT &result);
|
||||
String WideToString(LPCWSTR wcs, int len = -1);
|
||||
#endif
|
||||
|
||||
#ifdef CTRLLIB_H
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ olderName])&]
|
|||
[s2; Returns the name of the folder over [%-*@3 folderName].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
[s5;:ThereIsUpperFolder`(String`):%- [@(0.0.255) bool]_[* ThereIsUpperFolder]([_^String^ St
|
||||
ring]_[*@3 folderName])&]
|
||||
[s5;:UpperFolder`(String`):%- [@(0.0.255) bool]_[* UpperFolder]([_^String^ String]_[*@3 folde
|
||||
rName])&]
|
||||
[s0;l288; Returns true if there is a folder over [%-*@3 folderName].&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
|
|
@ -70,7 +70,7 @@ ing]_[*@3 folder], [_^String^ String]_[*@3 lastFolder])&]
|
|||
[s2; Considering [%-*@3 folder ]as a parent folder of [%-*@3 lastFolder],
|
||||
it returns the folder under [%-*@3 folder ]that is also parent
|
||||
of [%-*@3 lastFolder].&]
|
||||
[s0;l288; For example: GetNextFolder(`"/home`", `"/home/user/documents`")
|
||||
[s2; For example: GetNextFolder(`"/home`", `"/home/user/documents`")
|
||||
returns `"/home/user`".&]
|
||||
[s3; &]
|
||||
[s4;%- &]
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@ TOPIC("Dll$en-us")
|
|||
#include "Dll$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Functions4U$en-us")
|
||||
#include "Functions4U$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("SvgColors$en-us")
|
||||
#include "SvgColors$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ topic "News and changes Log";
|
|||
[{_}%EN-US
|
||||
[s0; [*R+184 Functions4U. News and changes log]&]
|
||||
[s0;%- &]
|
||||
[ {{1441:8559f0;g0;^t/25b/25 [s0;# [2 2010/07/27]]
|
||||
[ {{1441:8559f0;g0;^t/25b/25 [s0;# [2 2010/09/07]]
|
||||
:: [s0;# [2 Some improvements in LaunchFile, added UpperFolder and Dl
|
||||
(DLL) now in Linux too.]]
|
||||
:: [s0;# [2 2010/07/27]]
|
||||
:: [s0;# [2 Added String Replace(String str, char find, char replace).]]
|
||||
:: [s0;# [2 2010/07/19]]
|
||||
:: [s0;# [2 Removed las Xmlize and GridCtrl function. Now all are in Core
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
TOPIC("ChangesLog$en-us")
|
||||
#include "ChangesLog$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Functions4U$en-us")
|
||||
#include "Functions4U$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue