ScanParam has only one parameter now

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
1999-08-31 20:05:24 +00:00
parent babd4308f2
commit 18027d49b9
2 changed files with 5 additions and 26 deletions

View File

@@ -97,12 +97,14 @@ class WXDLLEXPORT wxHtmlTag : public wxObject
// <P IMG SRC="WhaT.jpg"> GetParam("SRC") returns (WhaT.jpg) // <P IMG SRC="WhaT.jpg"> GetParam("SRC") returns (WhaT.jpg)
// (or ("WhaT.jpg") if with_commas == TRUE) // (or ("WhaT.jpg") if with_commas == TRUE)
int ScanParam(const wxString& par, char *format, ...) const; int ScanParam(const wxString& par, char *format, void *param) const;
// Scans param like scanf() functions family do. // Scans param like scanf() functions family do.
// Example : ScanParam("COLOR", "\"#%X\"", &clr); // Example : ScanParam("COLOR", "\"#%X\"", &clr);
// This is always with with_commas=FALSE // This is always with with_commas=FALSE
// Returns number of scanned values // Returns number of scanned values
// (like sscanf() does) // (like sscanf() does)
// NOTE: unlike scanf family, this function only accepts
// *one* parameter !
inline const wxString& GetAllParams() const {return m_Params;}; inline const wxString& GetAllParams() const {return m_Params;};
// Returns string containing all params. // Returns string containing all params.

View File

@@ -239,33 +239,10 @@ wxString wxHtmlTag::GetParam(const wxString& par, bool with_commas) const
int wxHtmlTag::ScanParam(const wxString& par, char *format, ...) const int wxHtmlTag::ScanParam(const wxString& par, char *format, void *param) const
{ {
int retval;
va_list argptr;
wxString parval = GetParam(par); wxString parval = GetParam(par);
return sscanf((const char*)parval, format, param);
va_start(argptr, format);
//#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__VISUALC__)
#ifndef HAVE_VSSCANF
retval = sscanf((const char*)parval, format, va_arg(argptr, void *));
#else
retval = vsscanf((const char*)parval, format, argptr);
#endif
/*
--- vsscanf is not defined under some compilers
if this module doesn't compile with your compiler,
modify the def statement and let me know. Thanks...
So far wxHtml functions are scanning only _one_ value
so I workarounded this by supposing that there is only
one ...-parameter
*/
va_end(argptr);
return retval;
} }
#endif #endif