Win32: Added @uptime template token and MS_UPTIME stringid to goldlang.cfg

This commit is contained in:
Ianos Gnatiuc 2007-01-19 17:38:41 +00:00
parent c265a58103
commit 2c67afec51
17 changed files with 62 additions and 18 deletions

View File

@ -105,6 +105,8 @@ MS_LMOCTOBER "October"
MS_LMNOVEMBER "November" MS_LMNOVEMBER "November"
MS_LMDECEMBER "December" MS_LMDECEMBER "December"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
ST_IMPORTFILE "Import File" ST_IMPORTFILE "Import File"
WT_IMPORTWHICHFILE " Import which file? " WT_IMPORTWHICHFILE " Import which file? "
WT_IMPORTPICK " Import " WT_IMPORTPICK " Import "

View File

@ -124,6 +124,7 @@ MS_LMOCTOBER "Oktober"
MS_LMNOVEMBER "November" MS_LMNOVEMBER "November"
MS_LMDECEMBER "Dezember" MS_LMDECEMBER "Dezember"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- VERSCHIEDENES -- VERSCHIEDENES

View File

@ -134,6 +134,7 @@ MS_LMOCTOBER "Ottobre"
MS_LMNOVEMBER "Novembre" MS_LMNOVEMBER "Novembre"
MS_LMDECEMBER "Dicembre" MS_LMDECEMBER "Dicembre"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- MISCELA DI PAROLE CHIAVE -- MISCELA DI PAROLE CHIAVE

View File

@ -115,6 +115,7 @@ MS_LMOCTOBER "Oktober"
MS_LMNOVEMBER "November" MS_LMNOVEMBER "November"
MS_LMDECEMBER "December" MS_LMDECEMBER "December"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- MISCELLANEOUS LANGUAGE KEYWORDS -- MISCELLANEOUS LANGUAGE KEYWORDS

View File

@ -125,6 +125,8 @@ MS_LMOCTOBER "
MS_LMNOVEMBER "­®ï¡àì" MS_LMNOVEMBER "­®ï¡àì"
MS_LMDECEMBER "¤¥ª ¡àì" MS_LMDECEMBER "¤¥ª ¡àì"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- MISCELLANEOUS LANGUAGE KEYWORDS -- MISCELLANEOUS LANGUAGE KEYWORDS

View File

@ -144,6 +144,7 @@ MS_LMOCTOBER "
MS_LMNOVEMBER "<22>®ï¡àï" MS_LMNOVEMBER "<22>®ï¡àï"
MS_LMDECEMBER "„¥ª ¡àï" MS_LMDECEMBER "„¥ª ¡àï"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- Œ¥­î -- Œ¥­î

View File

@ -122,6 +122,8 @@ MS_LMOCTOBER "
MS_LMNOVEMBER "­®ï¡àì" MS_LMNOVEMBER "­®ï¡àì"
MS_LMDECEMBER "¤¥ª ¡àì" MS_LMDECEMBER "¤¥ª ¡àì"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- MISCELLANEOUS LANGUAGE KEYWORDS -- MISCELLANEOUS LANGUAGE KEYWORDS

View File

@ -112,6 +112,7 @@ MS_LMOCTOBER "oktober"
MS_LMNOVEMBER "november" MS_LMNOVEMBER "november"
MS_LMDECEMBER "december" MS_LMDECEMBER "december"
MS_UPTIME "%days day(s) %hours:%minutes:%seconds.%useconds"
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- MISCELLANEOUS LANGUAGE KEYWORDS -- MISCELLANEOUS LANGUAGE KEYWORDS

View File

@ -10,6 +10,8 @@ _____________________________________________________________________________
‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/ ‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/
_____________________________________________________________________________ _____________________________________________________________________________
+ Win32: „®Ў ў«Ґ­ ­®ўл© в®ЄҐ­ ¤«п ⥬Ї«Ґ©в®ў @uptime Ё MS_UPTIME Ё¤Ґ­вЁдЁЄ в®а
¤«п goldlang.cfg.
- ˆá¯à ¢«¥­  UUE ¤¥ª®¤¨à®¢ ­¨¥ ­¥áª®«ìª¨å ä ©«®¢. - ˆá¯à ¢«¥­  UUE ¤¥ª®¤¨à®¢ ­¨¥ ­¥áª®«ìª¨å ä ©«®¢.
‘­ ¯è®â ®â 16 ï­¢ àï 2007. ‘­ ¯è®â ®â 16 ï­¢ àï 2007.

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ Win32: Added @uptime template token and MS_UPTIME stringid to goldlang.cfg
- Fixed multifile UUE decoding. - Fixed multifile UUE decoding.
= Snapshot for the Jan 16, 2007. = Snapshot for the Jan 16, 2007.

View File

@ -101,7 +101,4 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
AMDCaProjectFile = F:\work\_db_cvs\golded+\windows\bin\release\win32\CodeAnalyst\golded.caw
EndGlobalSection
EndGlobal EndGlobal

View File

@ -86,6 +86,8 @@ static LangCrc LangCrcs[] = {
{ CRC_MS_LMNOVEMBER , NULL , "November" }, { CRC_MS_LMNOVEMBER , NULL , "November" },
{ CRC_MS_LMDECEMBER , NULL , "December" }, { CRC_MS_LMDECEMBER , NULL , "December" },
{ CRC_MS_UPTIME , NULL , "%days day(s) %hours:%minutes:%seconds.%useconds" },
{ CRC_ST_IMPORTFILE , NULL , "Import File" }, { CRC_ST_IMPORTFILE , NULL , "Import File" },
{ CRC_WT_IMPORTWHICHFILE , NULL , " Import which file? " }, { CRC_WT_IMPORTWHICHFILE , NULL , " Import which file? " },
{ CRC_WT_IMPORTPICK , NULL , " Import " }, { CRC_WT_IMPORTPICK , NULL , " Import " },

View File

@ -70,6 +70,8 @@ const word CRC_MS_LMOCTOBER = 0x51C9;
const word CRC_MS_LMNOVEMBER = 0x107D; const word CRC_MS_LMNOVEMBER = 0x107D;
const word CRC_MS_LMDECEMBER = 0x7733; const word CRC_MS_LMDECEMBER = 0x7733;
const word CRC_MS_UPTIME = 0x383A;
const word CRC_ST_IMPORTFILE = 0x027D; const word CRC_ST_IMPORTFILE = 0x027D;
const word CRC_WT_IMPORTWHICHFILE = 0xF718; const word CRC_WT_IMPORTWHICHFILE = 0xF718;
const word CRC_WT_IMPORTTXT = 0xB5DB; const word CRC_WT_IMPORTTXT = 0xB5DB;

View File

@ -72,6 +72,8 @@ struct LangGed {
char* LMNovember; // MS_LMNOVEMBER char* LMNovember; // MS_LMNOVEMBER
char* LMDecember; // MS_LMDECEMBER char* LMDecember; // MS_LMDECEMBER
char* Uptime; // MS_UPTIME
char* ImportFile; // ST_IMPORTFILE char* ImportFile; // ST_IMPORTFILE
char* ImportWhichFile; // WT_IMPORTWHICHFILE char* ImportWhichFile; // WT_IMPORTWHICHFILE
char* ImportTitle; // WT_IMPORTPICK char* ImportTitle; // WT_IMPORTPICK

View File

@ -140,6 +140,7 @@ inline bool domain_requested(const char *str, size_t pos)
return strnieql(str+pos, "{domain}", 8); return strnieql(str+pos, "{domain}", 8);
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __origarea) void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __origarea)
@ -682,7 +683,7 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
continue; continue;
} }
#if 0 #ifdef __WIN32__
if (strnieql(it2str(input, dst), "@uptime", 7)) if (strnieql(it2str(input, dst), "@uptime", 7))
{ {
size_t days = 0; size_t days = 0;
@ -704,21 +705,16 @@ void TokenXlat(int mode, std::string &input, GMsg* msg, GMsg* oldmsg, int __orig
hours = seconds/(60*60); seconds %= 60*60; hours = seconds/(60*60); seconds %= 60*60;
minutes = seconds/60; seconds %= 60; minutes = seconds/60; seconds %= 60;
char uptime[1024]; std::string uptime(LNG->Uptime);
/*
FormatString(
FormatString(
FormatString(
FormatString(
FormatString("%days day(s) %hours:%minutes:%seconds.%useconds",
"%days", days),
"%hours", hours),
"%minutes", minutes),
"%seconds", seconds),
"%useconds", useconds);
*/
tokenxchg(input, dst, "@uptime", uptime); FormatString( FormatString( FormatString( FormatString( FormatString(
uptime, "%days", days),
"%hours", hours),
"%minutes", minutes),
"%seconds", seconds),
"%useconds", useconds);
tokenxchg(input, dst, "@uptime", uptime.c_str());
} }
#endif #endif
} }

View File

@ -151,6 +151,10 @@ char* strcvtc(char* s);
#define PRINTF_DECLARE_BUFFER(b) b, ARRAYSIZE(b), __FILE__, __LINE__ #define PRINTF_DECLARE_BUFFER(b) b, ARRAYSIZE(b), __FILE__, __LINE__
int gsprintf(TCHAR* buffer, size_t sizeOfBuffer, const TCHAR* __file, int __line, const TCHAR* format, ...); int gsprintf(TCHAR* buffer, size_t sizeOfBuffer, const TCHAR* __file, int __line, const TCHAR* format, ...);
// ------------------------------------------------------------------
std::string &FormatString(std::string &format, const char *token, const char *replace);
std::string &FormatString(std::string &format, const char *token, size_t replace);
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// String tokenizer class // String tokenizer class

View File

@ -771,4 +771,30 @@ void tokenize(gstrarray &array, const TCHAR* str, const TCHAR *delim)
} }
// ------------------------------------------------------------------
std::string &FormatString(std::string &format, const char *token, const char *replace)
{
size_t tokenLen = strlen(token);
size_t pos = format.find(token);
for (; pos != std::string::npos; pos = format.find(token))
{
format.replace(pos, tokenLen, replace);
}
return format;
}
// ------------------------------------------------------------------
std::string &FormatString(std::string &format, const char *token, size_t replace)
{
char buff[128];
gsprintf(PRINTF_DECLARE_BUFFER(buff), "%u", replace);
return FormatString(format, token, buff);
}
// ------------------------------------------------------------------ // ------------------------------------------------------------------