don't use implicit wxString->char*/wchar_t* conversion, it will not be available in wxUSE_STL build in the future
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,7 +55,7 @@ enum wxStreamProtocolType
|
|||||||
|
|
||||||
\membersection{wxFilterClassFactory::CanHandle}\label{wxfilterclassfactorycanhandle}
|
\membersection{wxFilterClassFactory::CanHandle}\label{wxfilterclassfactorycanhandle}
|
||||||
|
|
||||||
\constfunc{bool}{CanHandle}{\param{const wxChar* }{protocol}, \param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
|
\constfunc{bool}{CanHandle}{\param{const wxString\& }{protocol}, \param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
|
||||||
|
|
||||||
Returns true if this factory can handle the given protocol, MIME type, HTTP
|
Returns true if this factory can handle the given protocol, MIME type, HTTP
|
||||||
encoding or file extension.
|
encoding or file extension.
|
||||||
@@ -66,7 +66,7 @@ can be a complete filename rather than just an extension.
|
|||||||
|
|
||||||
\membersection{wxFilterClassFactory::Find}\label{wxfilterclassfactoryfind}
|
\membersection{wxFilterClassFactory::Find}\label{wxfilterclassfactoryfind}
|
||||||
|
|
||||||
\func{static const wxFilterClassFactory*}{Find}{\param{const wxChar* }{protocol}, \param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
|
\func{static const wxFilterClassFactory*}{Find}{\param{const wxString\& }{protocol}, \param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
|
||||||
|
|
||||||
A static member that finds a factory that can handle a given protocol, MIME
|
A static member that finds a factory that can handle a given protocol, MIME
|
||||||
type, HTTP encoding or file extension. Returns a pointer to the class
|
type, HTTP encoding or file extension. Returns a pointer to the class
|
||||||
|
@@ -1044,7 +1044,7 @@ temporary storage that should not be deallocated.
|
|||||||
|
|
||||||
\membersection{::wxFindFirstFile}\label{wxfindfirstfile}
|
\membersection{::wxFindFirstFile}\label{wxfindfirstfile}
|
||||||
|
|
||||||
\func{wxString}{wxFindFirstFile}{\param{const char *}{spec}, \param{int}{ flags = 0}}
|
\func{wxString}{wxFindFirstFile}{\param{const wxString\& }{spec}, \param{int}{ flags = 0}}
|
||||||
|
|
||||||
This function does directory searching; returns the first file
|
This function does directory searching; returns the first file
|
||||||
that matches the path {\it spec}, or the empty string. Use \helpref{wxFindNextFile}{wxfindnextfile} to
|
that matches the path {\it spec}, or the empty string. Use \helpref{wxFindNextFile}{wxfindnextfile} to
|
||||||
@@ -1342,7 +1342,7 @@ Note that empty tokens will be generated if there are two or more adjacent separ
|
|||||||
|
|
||||||
\membersection{::wxSplitPath}\label{wxsplitfunction}
|
\membersection{::wxSplitPath}\label{wxsplitfunction}
|
||||||
|
|
||||||
\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
|
\func{void}{wxSplitPath}{\param{const wxString\&}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
|
||||||
|
|
||||||
{\bf NB:} This function is obsolete, please use
|
{\bf NB:} This function is obsolete, please use
|
||||||
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
|
\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
|
||||||
|
@@ -347,7 +347,7 @@ public:
|
|||||||
wxMBConv& GetConv() const
|
wxMBConv& GetConv() const
|
||||||
{ if (m_pConv) return *m_pConv; else return wxConvLocal; }
|
{ if (m_pConv) return *m_pConv; else return wxConvLocal; }
|
||||||
|
|
||||||
static const wxArchiveClassFactory *Find(const wxChar *protocol,
|
static const wxArchiveClassFactory *Find(const wxString& protocol,
|
||||||
wxStreamProtocolType type
|
wxStreamProtocolType type
|
||||||
= wxSTREAM_PROTOCOL);
|
= wxSTREAM_PROTOCOL);
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ public:
|
|||||||
wxArrayString(size_t sz, const wxChar** a);
|
wxArrayString(size_t sz, const wxChar** a);
|
||||||
wxArrayString(size_t sz, const wxString* a);
|
wxArrayString(size_t sz, const wxString* a);
|
||||||
|
|
||||||
int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const;
|
int Index(const wxString& str, bool bCase = true, bool bFromEnd = false) const;
|
||||||
|
|
||||||
void Sort(bool reverseOrder = false);
|
void Sort(bool reverseOrder = false);
|
||||||
void Sort(CompareFunction function);
|
void Sort(CompareFunction function);
|
||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
Add(src[n]);
|
Add(src[n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const;
|
int Index(const wxString& str, bool bCase = true, bool bFromEnd = false) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#else // if !wxUSE_STL
|
#else // if !wxUSE_STL
|
||||||
@@ -158,7 +158,7 @@ public:
|
|||||||
// bFromEnd is false or from end otherwise. If bCase, comparison is case
|
// bFromEnd is false or from end otherwise. If bCase, comparison is case
|
||||||
// sensitive (default). Returns index of the first item matched or
|
// sensitive (default). Returns index of the first item matched or
|
||||||
// wxNOT_FOUND
|
// wxNOT_FOUND
|
||||||
int Index (const wxChar *sz, bool bCase = true, bool bFromEnd = false) const;
|
int Index (const wxString& str, bool bCase = true, bool bFromEnd = false) const;
|
||||||
// add new element at the end (if the array is not sorted), return its
|
// add new element at the end (if the array is not sorted), return its
|
||||||
// index
|
// index
|
||||||
size_t Add(const wxString& str, size_t nInsert = 1);
|
size_t Add(const wxString& str, size_t nInsert = 1);
|
||||||
|
@@ -209,7 +209,7 @@ public:
|
|||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
// break down the command line in arguments
|
// break down the command line in arguments
|
||||||
static wxArrayString ConvertStringToArgs(const wxChar *cmdline);
|
static wxArrayString ConvertStringToArgs(const wxString& cmdline);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// get usage string
|
// get usage string
|
||||||
@@ -230,7 +230,7 @@ private:
|
|||||||
class WXDLLIMPEXP_BASE wxCmdLineParser
|
class WXDLLIMPEXP_BASE wxCmdLineParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static wxArrayString ConvertStringToArgs(const wxChar *cmdline);
|
static wxArrayString ConvertStringToArgs(const wxString& cmdline);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER
|
#endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER
|
||||||
|
@@ -358,7 +358,7 @@ WXDLLIMPEXP_BASE wxString wxExpandEnvVars(const wxString &sz);
|
|||||||
/*
|
/*
|
||||||
Split path into parts removing '..' in progress
|
Split path into parts removing '..' in progress
|
||||||
*/
|
*/
|
||||||
WXDLLIMPEXP_BASE void wxSplitPath(wxArrayString& aParts, const wxChar *sz);
|
WXDLLIMPEXP_BASE void wxSplitPath(wxArrayString& aParts, const wxString& path);
|
||||||
|
|
||||||
#endif // _WX_CONFBASE_H_
|
#endif // _WX_CONFBASE_H_
|
||||||
|
|
||||||
|
@@ -56,7 +56,10 @@ public:
|
|||||||
|
|
||||||
// Calls that CLIENT can make
|
// Calls that CLIENT can make
|
||||||
virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0;
|
virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0;
|
||||||
virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); }
|
// FIXME-UTF8: review this code for compatibility implications, update
|
||||||
|
// accordingly, don' use c_str() below
|
||||||
|
virtual bool Execute(const wxString& str)
|
||||||
|
{ return Execute(str.c_str(), -1, wxIPC_TEXT); }
|
||||||
virtual wxChar *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0;
|
virtual wxChar *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0;
|
||||||
virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
|
virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
|
||||||
virtual bool StartAdvise(const wxString& item) = 0;
|
virtual bool StartAdvise(const wxString& item) = 0;
|
||||||
|
@@ -82,8 +82,10 @@ public:
|
|||||||
void Compress(bool on);
|
void Compress(bool on);
|
||||||
|
|
||||||
// unhide the Execute overload from wxConnectionBase
|
// unhide the Execute overload from wxConnectionBase
|
||||||
|
// FIXME-UTF8: change Execute() to DoExecute() to avoid having to do this;
|
||||||
|
// don't use c_str() below after removing ANSI build
|
||||||
virtual bool Execute(const wxString& str)
|
virtual bool Execute(const wxString& str)
|
||||||
{ return Execute(str, -1, wxIPC_TEXT); }
|
{ return Execute(str.c_str(), -1, wxIPC_TEXT); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxSocketBase *m_sock;
|
wxSocketBase *m_sock;
|
||||||
|
@@ -26,7 +26,6 @@ public:
|
|||||||
// ctor associates the stream with the given string which makes a copy of
|
// ctor associates the stream with the given string which makes a copy of
|
||||||
// it
|
// it
|
||||||
wxStringInputStream(const wxString& s);
|
wxStringInputStream(const wxString& s);
|
||||||
virtual ~wxStringInputStream();
|
|
||||||
|
|
||||||
virtual wxFileOffset GetLength() const;
|
virtual wxFileOffset GetLength() const;
|
||||||
|
|
||||||
@@ -40,7 +39,7 @@ private:
|
|||||||
wxString m_str;
|
wxString m_str;
|
||||||
|
|
||||||
// the buffer we're reading from
|
// the buffer we're reading from
|
||||||
char* m_buf;
|
wxCharBuffer m_buf;
|
||||||
|
|
||||||
// length of the buffer we're reading from
|
// length of the buffer we're reading from
|
||||||
size_t m_len;
|
size_t m_len;
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#if wxUSE_WCHAR_T
|
#if wxUSE_WCHAR_T
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_BASE wxString;
|
||||||
|
|
||||||
// the error value returned by wxMBConv methods
|
// the error value returned by wxMBConv methods
|
||||||
#define wxCONV_FAILED ((size_t)-1)
|
#define wxCONV_FAILED ((size_t)-1)
|
||||||
|
|
||||||
@@ -199,7 +201,7 @@ public:
|
|||||||
class WXDLLIMPEXP_BASE wxConvBrokenFileNames : public wxMBConv
|
class WXDLLIMPEXP_BASE wxConvBrokenFileNames : public wxMBConv
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxConvBrokenFileNames(const wxChar *charset);
|
wxConvBrokenFileNames(const wxString& charset);
|
||||||
wxConvBrokenFileNames(const wxConvBrokenFileNames& conv)
|
wxConvBrokenFileNames(const wxConvBrokenFileNames& conv)
|
||||||
: wxMBConv(),
|
: wxMBConv(),
|
||||||
m_conv(conv.m_conv ? conv.m_conv->Clone() : NULL)
|
m_conv(conv.m_conv ? conv.m_conv->Clone() : NULL)
|
||||||
@@ -387,7 +389,7 @@ class WXDLLIMPEXP_BASE wxCSConv : public wxMBConv
|
|||||||
public:
|
public:
|
||||||
// we can be created either from charset name or from an encoding constant
|
// we can be created either from charset name or from an encoding constant
|
||||||
// but we can't have both at once
|
// but we can't have both at once
|
||||||
wxCSConv(const wxChar *charset);
|
wxCSConv(const wxString& charset);
|
||||||
wxCSConv(wxFontEncoding encoding);
|
wxCSConv(wxFontEncoding encoding);
|
||||||
|
|
||||||
wxCSConv(const wxCSConv& conv);
|
wxCSConv(const wxCSConv& conv);
|
||||||
@@ -426,12 +428,12 @@ private:
|
|||||||
|
|
||||||
// set the name (may be only called when m_name == NULL), makes copy of
|
// set the name (may be only called when m_name == NULL), makes copy of
|
||||||
// charset string
|
// charset string
|
||||||
void SetName(const wxChar *charset);
|
void SetName(const char *charset);
|
||||||
|
|
||||||
|
|
||||||
// note that we can't use wxString here because of compilation
|
// note that we can't use wxString here because of compilation
|
||||||
// dependencies: we're included from wx/string.h
|
// dependencies: we're included from wx/string.h
|
||||||
wxChar *m_name;
|
char *m_name;
|
||||||
wxFontEncoding m_encoding;
|
wxFontEncoding m_encoding;
|
||||||
|
|
||||||
// use CreateConvIfNeeded() before accessing m_convReal!
|
// use CreateConvIfNeeded() before accessing m_convReal!
|
||||||
|
@@ -354,12 +354,12 @@ public:
|
|||||||
virtual const wxChar * const *GetProtocols(wxStreamProtocolType type
|
virtual const wxChar * const *GetProtocols(wxStreamProtocolType type
|
||||||
= wxSTREAM_PROTOCOL) const = 0;
|
= wxSTREAM_PROTOCOL) const = 0;
|
||||||
|
|
||||||
bool CanHandle(const wxChar *protocol,
|
bool CanHandle(const wxString& protocol,
|
||||||
wxStreamProtocolType type
|
wxStreamProtocolType type
|
||||||
= wxSTREAM_PROTOCOL) const;
|
= wxSTREAM_PROTOCOL) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxString::size_type FindExtension(const wxChar *location) const;
|
wxString::size_type FindExtension(const wxString& location) const;
|
||||||
|
|
||||||
DECLARE_ABSTRACT_CLASS(wxFilterClassFactoryBase)
|
DECLARE_ABSTRACT_CLASS(wxFilterClassFactoryBase)
|
||||||
};
|
};
|
||||||
@@ -374,7 +374,7 @@ public:
|
|||||||
virtual wxFilterInputStream *NewStream(wxInputStream *stream) const = 0;
|
virtual wxFilterInputStream *NewStream(wxInputStream *stream) const = 0;
|
||||||
virtual wxFilterOutputStream *NewStream(wxOutputStream *stream) const = 0;
|
virtual wxFilterOutputStream *NewStream(wxOutputStream *stream) const = 0;
|
||||||
|
|
||||||
static const wxFilterClassFactory *Find(const wxChar *protocol,
|
static const wxFilterClassFactory *Find(const wxString& protocol,
|
||||||
wxStreamProtocolType type
|
wxStreamProtocolType type
|
||||||
= wxSTREAM_PROTOCOL);
|
= wxSTREAM_PROTOCOL);
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
// the archive classes they use.
|
// the archive classes they use.
|
||||||
|
|
||||||
const wxArchiveClassFactory *
|
const wxArchiveClassFactory *
|
||||||
wxArchiveClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type)
|
wxArchiveClassFactory::Find(const wxString& protocol, wxStreamProtocolType type)
|
||||||
{
|
{
|
||||||
for (const wxArchiveClassFactory *f = GetFirst(); f; f = f->GetNext())
|
for (const wxArchiveClassFactory *f = GetFirst(); f; f = f->GetNext())
|
||||||
if (f->CanHandle(protocol, type))
|
if (f->CanHandle(protocol, type))
|
||||||
|
@@ -197,7 +197,7 @@ void wxArrayString::Shrink()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// searches the array for an item (forward or backwards)
|
// searches the array for an item (forward or backwards)
|
||||||
int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const
|
int wxArrayString::Index(const wxString& str, bool bCase, bool bFromEnd) const
|
||||||
{
|
{
|
||||||
if ( m_autoSort ) {
|
if ( m_autoSort ) {
|
||||||
// use binary search in the sorted array
|
// use binary search in the sorted array
|
||||||
@@ -211,7 +211,7 @@ int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const
|
|||||||
while ( lo < hi ) {
|
while ( lo < hi ) {
|
||||||
i = (lo + hi)/2;
|
i = (lo + hi)/2;
|
||||||
|
|
||||||
res = wxStrcmp(sz, m_pItems[i]);
|
res = str.compare(m_pItems[i]);
|
||||||
if ( res < 0 )
|
if ( res < 0 )
|
||||||
hi = i;
|
hi = i;
|
||||||
else if ( res > 0 )
|
else if ( res > 0 )
|
||||||
@@ -228,7 +228,7 @@ int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const
|
|||||||
if ( m_nCount > 0 ) {
|
if ( m_nCount > 0 ) {
|
||||||
size_t ui = m_nCount;
|
size_t ui = m_nCount;
|
||||||
do {
|
do {
|
||||||
if ( m_pItems[--ui].IsSameAs(sz, bCase) )
|
if ( m_pItems[--ui].IsSameAs(str, bCase) )
|
||||||
return ui;
|
return ui;
|
||||||
}
|
}
|
||||||
while ( ui != 0 );
|
while ( ui != 0 );
|
||||||
@@ -236,7 +236,7 @@ int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for( size_t ui = 0; ui < m_nCount; ui++ ) {
|
for( size_t ui = 0; ui < m_nCount; ui++ ) {
|
||||||
if( m_pItems[ui].IsSameAs(sz, bCase) )
|
if( m_pItems[ui].IsSameAs(str, bCase) )
|
||||||
return ui;
|
return ui;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -49,11 +49,15 @@
|
|||||||
|
|
||||||
static wxString GetTypeName(wxCmdLineParamType type);
|
static wxString GetTypeName(wxCmdLineParamType type);
|
||||||
|
|
||||||
static wxString GetOptionName(const wxChar *p, const wxChar *allowedChars);
|
static wxString GetOptionName(wxString::const_iterator p,
|
||||||
|
wxString::const_iterator end,
|
||||||
|
const wxChar *allowedChars);
|
||||||
|
|
||||||
static wxString GetShortOptionName(const wxChar *p);
|
static wxString GetShortOptionName(wxString::const_iterator p,
|
||||||
|
wxString::const_iterator end);
|
||||||
|
|
||||||
static wxString GetLongOptionName(const wxChar *p);
|
static wxString GetLongOptionName(wxString::const_iterator p,
|
||||||
|
wxString::const_iterator end);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private structs
|
// private structs
|
||||||
@@ -73,16 +77,16 @@ struct wxCmdLineOption
|
|||||||
_T("option should have at least one name") );
|
_T("option should have at least one name") );
|
||||||
|
|
||||||
wxASSERT_MSG
|
wxASSERT_MSG
|
||||||
(
|
(
|
||||||
GetShortOptionName(shrt).Len() == shrt.Len(),
|
GetShortOptionName(shrt.begin(), shrt.end()).Len() == shrt.Len(),
|
||||||
wxT("Short option contains invalid characters")
|
wxT("Short option contains invalid characters")
|
||||||
);
|
);
|
||||||
|
|
||||||
wxASSERT_MSG
|
wxASSERT_MSG
|
||||||
(
|
(
|
||||||
GetLongOptionName(lng).Len() == lng.Len(),
|
GetLongOptionName(lng.begin(), lng.end()).Len() == lng.Len(),
|
||||||
wxT("Long option contains invalid characters")
|
wxT("Long option contains invalid characters")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
kind = k;
|
kind = k;
|
||||||
@@ -572,24 +576,25 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
|
|
||||||
// empty argument or just '-' is not an option but a parameter
|
// empty argument or just '-' is not an option but a parameter
|
||||||
if ( maybeOption && arg.length() > 1 &&
|
if ( maybeOption && arg.length() > 1 &&
|
||||||
wxStrchr(m_data->m_switchChars, arg[0u]) )
|
// FIXME-UTF8: use wc_str() after removing ANSI build
|
||||||
|
wxStrchr(m_data->m_switchChars.c_str(), arg[0u]) )
|
||||||
{
|
{
|
||||||
bool isLong;
|
bool isLong;
|
||||||
wxString name;
|
wxString name;
|
||||||
int optInd = wxNOT_FOUND; // init to suppress warnings
|
int optInd = wxNOT_FOUND; // init to suppress warnings
|
||||||
|
|
||||||
// an option or a switch: find whether it's a long or a short one
|
// an option or a switch: find whether it's a long or a short one
|
||||||
if ( arg[0u] == _T('-') && arg[1u] == _T('-') )
|
if ( arg.length() >= 3 && arg[0u] == _T('-') && arg[1u] == _T('-') )
|
||||||
{
|
{
|
||||||
// a long one
|
// a long one
|
||||||
isLong = true;
|
isLong = true;
|
||||||
|
|
||||||
// Skip leading "--"
|
// Skip leading "--"
|
||||||
const wxChar *p = arg.c_str() + 2;
|
wxString::const_iterator p = arg.begin() + 2;
|
||||||
|
|
||||||
bool longOptionsEnabled = AreLongOptionsEnabled();
|
bool longOptionsEnabled = AreLongOptionsEnabled();
|
||||||
|
|
||||||
name = GetLongOptionName(p);
|
name = GetLongOptionName(p, arg.end());
|
||||||
|
|
||||||
if (longOptionsEnabled)
|
if (longOptionsEnabled)
|
||||||
{
|
{
|
||||||
@@ -617,9 +622,9 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
|
|
||||||
// a short one: as they can be cumulated, we try to find the
|
// a short one: as they can be cumulated, we try to find the
|
||||||
// longest substring which is a valid option
|
// longest substring which is a valid option
|
||||||
const wxChar *p = arg.c_str() + 1;
|
wxString::const_iterator p = arg.begin() + 1;
|
||||||
|
|
||||||
name = GetShortOptionName(p);
|
name = GetShortOptionName(p, arg.end());
|
||||||
|
|
||||||
size_t len = name.length();
|
size_t len = name.length();
|
||||||
do
|
do
|
||||||
@@ -679,15 +684,17 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
// look at what follows:
|
// look at what follows:
|
||||||
|
|
||||||
// +1 for leading '-'
|
// +1 for leading '-'
|
||||||
const wxChar *p = arg.c_str() + 1 + name.length();
|
wxString::const_iterator p = arg.begin() + 1 + name.length();
|
||||||
|
wxString::const_iterator end = arg.end();
|
||||||
|
|
||||||
if ( isLong )
|
if ( isLong )
|
||||||
p++; // for another leading '-'
|
++p; // for another leading '-'
|
||||||
|
|
||||||
wxCmdLineOption& opt = m_data->m_options[(size_t)optInd];
|
wxCmdLineOption& opt = m_data->m_options[(size_t)optInd];
|
||||||
if ( opt.kind == wxCMD_LINE_SWITCH )
|
if ( opt.kind == wxCMD_LINE_SWITCH )
|
||||||
{
|
{
|
||||||
// we must check that there is no value following the switch
|
// we must check that there is no value following the switch
|
||||||
if ( *p != _T('\0') )
|
if ( p != arg.end() )
|
||||||
{
|
{
|
||||||
errorMsg << wxString::Format(_("Unexpected characters following option '%s'."), name.c_str())
|
errorMsg << wxString::Format(_("Unexpected characters following option '%s'."), name.c_str())
|
||||||
<< _T('\n');
|
<< _T('\n');
|
||||||
@@ -722,12 +729,12 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
}
|
}
|
||||||
else // short option
|
else // short option
|
||||||
{
|
{
|
||||||
switch ( *p )
|
switch ( (*p).GetValue() )
|
||||||
{
|
{
|
||||||
case _T('='):
|
case _T('='):
|
||||||
case _T(':'):
|
case _T(':'):
|
||||||
// the value follows
|
// the value follows
|
||||||
p++;
|
++p;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
@@ -744,7 +751,8 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ... take it from there
|
// ... take it from there
|
||||||
p = m_data->m_arguments[n].c_str();
|
p = m_data->m_arguments[n].begin();
|
||||||
|
end = m_data->m_arguments[n].end();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -764,7 +772,7 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
|
|
||||||
if ( ok )
|
if ( ok )
|
||||||
{
|
{
|
||||||
wxString value = p;
|
wxString value(p, end);
|
||||||
switch ( opt.type )
|
switch ( opt.type )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
@@ -797,7 +805,8 @@ int wxCmdLineParser::Parse(bool showUsage)
|
|||||||
case wxCMD_LINE_VAL_DATE:
|
case wxCMD_LINE_VAL_DATE:
|
||||||
{
|
{
|
||||||
wxDateTime dt;
|
wxDateTime dt;
|
||||||
const wxChar *res = dt.ParseDate(value);
|
// FIXME-UTF8: ParseDate API will need changes
|
||||||
|
const wxChar *res = dt.ParseDate(value.c_str());
|
||||||
if ( !res || *res )
|
if ( !res || *res )
|
||||||
{
|
{
|
||||||
errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."),
|
errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."),
|
||||||
@@ -1140,12 +1149,13 @@ the parameter allowedChars.
|
|||||||
For example, if p points to "abcde-@-_", and allowedChars is "-_",
|
For example, if p points to "abcde-@-_", and allowedChars is "-_",
|
||||||
this function returns "abcde-".
|
this function returns "abcde-".
|
||||||
*/
|
*/
|
||||||
static wxString GetOptionName(const wxChar *p,
|
static wxString GetOptionName(wxString::const_iterator p,
|
||||||
const wxChar *allowedChars)
|
wxString::const_iterator end,
|
||||||
|
const wxChar *allowedChars)
|
||||||
{
|
{
|
||||||
wxString argName;
|
wxString argName;
|
||||||
|
|
||||||
while ( *p && (wxIsalnum(*p) || wxStrchr(allowedChars, *p)) )
|
while ( p != end && (wxIsalnum(*p) || wxStrchr(allowedChars, *p)) )
|
||||||
{
|
{
|
||||||
argName += *p++;
|
argName += *p++;
|
||||||
}
|
}
|
||||||
@@ -1163,14 +1173,16 @@ static wxString GetOptionName(const wxChar *p,
|
|||||||
#define wxCMD_LINE_CHARS_ALLOWED_BY_LONG_OPTION \
|
#define wxCMD_LINE_CHARS_ALLOWED_BY_LONG_OPTION \
|
||||||
wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION wxT("-")
|
wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION wxT("-")
|
||||||
|
|
||||||
static wxString GetShortOptionName(const wxChar *p)
|
static wxString GetShortOptionName(wxString::const_iterator p,
|
||||||
|
wxString::const_iterator end)
|
||||||
{
|
{
|
||||||
return GetOptionName(p, wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION);
|
return GetOptionName(p, end, wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
static wxString GetLongOptionName(const wxChar *p)
|
static wxString GetLongOptionName(wxString::const_iterator p,
|
||||||
|
wxString::const_iterator end)
|
||||||
{
|
{
|
||||||
return GetOptionName(p, wxCMD_LINE_CHARS_ALLOWED_BY_LONG_OPTION);
|
return GetOptionName(p, end, wxCMD_LINE_CHARS_ALLOWED_BY_LONG_OPTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_CMDLINE_PARSER
|
#endif // wxUSE_CMDLINE_PARSER
|
||||||
@@ -1188,7 +1200,7 @@ static wxString GetLongOptionName(const wxChar *p)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p)
|
wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxString& cmdline)
|
||||||
{
|
{
|
||||||
wxArrayString args;
|
wxArrayString args;
|
||||||
|
|
||||||
@@ -1196,14 +1208,17 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p)
|
|||||||
arg.reserve(1024);
|
arg.reserve(1024);
|
||||||
|
|
||||||
bool isInsideQuotes = false;
|
bool isInsideQuotes = false;
|
||||||
|
|
||||||
|
wxString::const_iterator p = cmdline.begin();
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
// skip white space
|
// skip white space
|
||||||
while ( *p == _T(' ') || *p == _T('\t') )
|
while ( p != cmdline.end() && (*p == _T(' ') || *p == _T('\t')) )
|
||||||
p++;
|
++p;
|
||||||
|
|
||||||
// anything left?
|
// anything left?
|
||||||
if ( *p == _T('\0') )
|
if ( p == cmdline.end() )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// parse this parameter
|
// parse this parameter
|
||||||
@@ -1211,7 +1226,7 @@ wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p)
|
|||||||
bool lastBS = false;
|
bool lastBS = false;
|
||||||
for ( arg.clear(); !endParam; p++ )
|
for ( arg.clear(); !endParam; p++ )
|
||||||
{
|
{
|
||||||
switch ( *p )
|
switch ( (*p).GetValue() )
|
||||||
{
|
{
|
||||||
case _T('"'):
|
case _T('"'):
|
||||||
if ( !lastBS )
|
if ( !lastBS )
|
||||||
|
@@ -264,7 +264,7 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
|
|
||||||
/* JACS: work around a memory bug that causes an assert
|
/* JACS: work around a memory bug that causes an assert
|
||||||
when using wxRegConfig, related to reference-counting.
|
when using wxRegConfig, related to reference-counting.
|
||||||
Can be reproduced by removing (const wxChar*) below and
|
Can be reproduced by removing .wc_str() below and
|
||||||
adding the following code to the config sample OnInit under
|
adding the following code to the config sample OnInit under
|
||||||
Windows:
|
Windows:
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
int value;
|
int value;
|
||||||
pConfig->Read(_T("MainWindowX"), & value);
|
pConfig->Read(_T("MainWindowX"), & value);
|
||||||
*/
|
*/
|
||||||
m_strOldPath = (const wxChar*) m_pContainer->GetPath();
|
m_strOldPath = m_pContainer->GetPath().wc_str();
|
||||||
if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR )
|
if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR )
|
||||||
m_strOldPath += wxCONFIG_PATH_SEPARATOR;
|
m_strOldPath += wxCONFIG_PATH_SEPARATOR;
|
||||||
m_pContainer->SetPath(strPath);
|
m_pContainer->SetPath(strPath);
|
||||||
@@ -399,19 +399,20 @@ wxString wxExpandEnvVars(const wxString& str)
|
|||||||
wxString strVarName(str.c_str() + n + 1, m - n - 1);
|
wxString strVarName(str.c_str() + n + 1, m - n - 1);
|
||||||
|
|
||||||
#ifdef __WXWINCE__
|
#ifdef __WXWINCE__
|
||||||
const wxChar *pszValue = NULL;
|
const bool expanded = false;
|
||||||
#else
|
#else
|
||||||
// NB: use wxGetEnv instead of wxGetenv as otherwise variables
|
// NB: use wxGetEnv instead of wxGetenv as otherwise variables
|
||||||
// set through wxSetEnv may not be read correctly!
|
// set through wxSetEnv may not be read correctly!
|
||||||
const wxChar *pszValue = NULL;
|
bool expanded = false;
|
||||||
wxString tmp;
|
wxString tmp;
|
||||||
if (wxGetEnv(strVarName, &tmp))
|
if (wxGetEnv(strVarName, &tmp))
|
||||||
pszValue = tmp;
|
{
|
||||||
#endif
|
strResult += tmp;
|
||||||
if ( pszValue != NULL ) {
|
expanded = true;
|
||||||
strResult += pszValue;
|
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
// variable doesn't exist => don't change anything
|
// variable doesn't exist => don't change anything
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
if ( bracket != Bracket_Windows )
|
if ( bracket != Bracket_Windows )
|
||||||
@@ -437,7 +438,7 @@ wxString wxExpandEnvVars(const wxString& str)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// skip closing bracket unless the variables wasn't expanded
|
// skip closing bracket unless the variables wasn't expanded
|
||||||
if ( pszValue == NULL )
|
if ( !expanded )
|
||||||
strResult << (wxChar)bracket;
|
strResult << (wxChar)bracket;
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
@@ -466,21 +467,21 @@ wxString wxExpandEnvVars(const wxString& str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// this function is used to properly interpret '..' in path
|
// this function is used to properly interpret '..' in path
|
||||||
void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
|
void wxSplitPath(wxArrayString& aParts, const wxString& path)
|
||||||
{
|
{
|
||||||
aParts.clear();
|
aParts.clear();
|
||||||
|
|
||||||
wxString strCurrent;
|
wxString strCurrent;
|
||||||
const wxChar *pc = sz;
|
wxString::const_iterator pc = path.begin();
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
if ( *pc == wxT('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
|
if ( pc == path.end() || *pc == wxCONFIG_PATH_SEPARATOR ) {
|
||||||
if ( strCurrent == wxT(".") ) {
|
if ( strCurrent == wxT(".") ) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
else if ( strCurrent == wxT("..") ) {
|
else if ( strCurrent == wxT("..") ) {
|
||||||
// go up one level
|
// go up one level
|
||||||
if ( aParts.size() == 0 )
|
if ( aParts.size() == 0 )
|
||||||
wxLogWarning(_("'%s' has extra '..', ignored."), sz);
|
wxLogWarning(_("'%s' has extra '..', ignored."), path);
|
||||||
else
|
else
|
||||||
aParts.erase(aParts.end() - 1);
|
aParts.erase(aParts.end() - 1);
|
||||||
|
|
||||||
@@ -493,12 +494,12 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
|
|||||||
//else:
|
//else:
|
||||||
// could log an error here, but we prefer to ignore extra '/'
|
// could log an error here, but we prefer to ignore extra '/'
|
||||||
|
|
||||||
if ( *pc == wxT('\0') )
|
if ( pc == path.end() )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strCurrent += *pc;
|
strCurrent += *pc;
|
||||||
|
|
||||||
pc++;
|
++pc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2172,9 +2172,9 @@ void wxDCBase::GetMultiLineTextExtent(const wxString& text,
|
|||||||
heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
|
heightTextTotal = 0, heightLineDefault = 0, heightLine = 0;
|
||||||
|
|
||||||
wxString curLine;
|
wxString curLine;
|
||||||
for ( const wxChar *pc = text; ; pc++ )
|
for ( wxString::const_iterator pc = text.begin(); ; ++pc )
|
||||||
{
|
{
|
||||||
if ( *pc == _T('\n') || *pc == _T('\0') )
|
if ( pc == text.end() || *pc == _T('\n') )
|
||||||
{
|
{
|
||||||
if ( curLine.empty() )
|
if ( curLine.empty() )
|
||||||
{
|
{
|
||||||
@@ -2205,15 +2205,14 @@ void wxDCBase::GetMultiLineTextExtent(const wxString& text,
|
|||||||
heightTextTotal += heightLine;
|
heightTextTotal += heightLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( *pc == _T('\n') )
|
if ( pc == text.end() )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else // '\n'
|
||||||
{
|
{
|
||||||
curLine.clear();
|
curLine.clear();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// the end of string
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -112,7 +112,7 @@ static const wxChar *s_MRUEntryFormat = wxT("&%d %s");
|
|||||||
// local functions
|
// local functions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static wxString FindExtension(const wxChar *path)
|
static wxString FindExtension(const wxString& path)
|
||||||
{
|
{
|
||||||
wxString ext;
|
wxString ext;
|
||||||
wxSplitPath(path, NULL, NULL, &ext);
|
wxSplitPath(path, NULL, NULL, &ext);
|
||||||
@@ -456,8 +456,7 @@ bool wxDocument::OnSaveModified()
|
|||||||
msgTitle = wxString(_("Warning"));
|
msgTitle = wxString(_("Warning"));
|
||||||
|
|
||||||
wxString prompt;
|
wxString prompt;
|
||||||
prompt.Printf(_("Do you want to save changes to document %s?"),
|
prompt.Printf(_("Do you want to save changes to document %s?"), title);
|
||||||
(const wxChar *)title);
|
|
||||||
int res = wxMessageBox(prompt, msgTitle,
|
int res = wxMessageBox(prompt, msgTitle,
|
||||||
wxYES_NO|wxCANCEL|wxICON_QUESTION,
|
wxYES_NO|wxCANCEL|wxICON_QUESTION,
|
||||||
GetDocumentWindow());
|
GetDocumentWindow());
|
||||||
|
@@ -427,17 +427,31 @@ _WX_DEFINE_BASEARRAY(wxString, wxBaseArrayStringBase)
|
|||||||
// extern "C" functions and the functions with C++ linkage and ptr_fun and
|
// extern "C" functions and the functions with C++ linkage and ptr_fun and
|
||||||
// wxStringCompareLess can't take wxStrcmp/wxStricmp directly as arguments in
|
// wxStringCompareLess can't take wxStrcmp/wxStricmp directly as arguments in
|
||||||
// this case, we need the wrappers below to make this work
|
// this case, we need the wrappers below to make this work
|
||||||
inline int wxStrcmpCppWrapper(const wxChar *p, const wxChar *q)
|
struct wxStringCmp
|
||||||
{
|
{
|
||||||
return wxStrcmp(p, q);
|
typedef wxString first_argument_type;
|
||||||
}
|
typedef wxString second_argument_type;
|
||||||
|
typedef int result_type;
|
||||||
|
|
||||||
inline int wxStricmpCppWrapper(const wxChar *p, const wxChar *q)
|
int operator()(const wxString& s1, const wxString& s2) const
|
||||||
|
{
|
||||||
|
return s1.compare(s2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct wxStringCmpNoCase
|
||||||
{
|
{
|
||||||
return wxStricmp(p, q);
|
typedef wxString first_argument_type;
|
||||||
}
|
typedef wxString second_argument_type;
|
||||||
|
typedef int result_type;
|
||||||
|
|
||||||
int wxArrayString::Index(const wxChar* sz, bool bCase, bool WXUNUSED(bFromEnd)) const
|
int operator()(const wxString& s1, const wxString& s2) const
|
||||||
|
{
|
||||||
|
return s1.CmpNoCase(s2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int wxArrayString::Index(const wxString& str, bool bCase, bool WXUNUSED(bFromEnd)) const
|
||||||
{
|
{
|
||||||
wxArrayString::const_iterator it;
|
wxArrayString::const_iterator it;
|
||||||
|
|
||||||
@@ -446,14 +460,14 @@ int wxArrayString::Index(const wxChar* sz, bool bCase, bool WXUNUSED(bFromEnd))
|
|||||||
it = std::find_if(begin(), end(),
|
it = std::find_if(begin(), end(),
|
||||||
std::not1(
|
std::not1(
|
||||||
std::bind2nd(
|
std::bind2nd(
|
||||||
std::ptr_fun(wxStrcmpCppWrapper), sz)));
|
wxStringCmp(), str)));
|
||||||
}
|
}
|
||||||
else // !bCase
|
else // !bCase
|
||||||
{
|
{
|
||||||
it = std::find_if(begin(), end(),
|
it = std::find_if(begin(), end(),
|
||||||
std::not1(
|
std::not1(
|
||||||
std::bind2nd(
|
std::bind2nd(
|
||||||
std::ptr_fun(wxStricmpCppWrapper), sz)));
|
wxStringCmpNoCase(), str)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return it == end() ? wxNOT_FOUND : it - begin();
|
return it == end() ? wxNOT_FOUND : it - begin();
|
||||||
@@ -464,8 +478,6 @@ class wxStringCompareLess
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxStringCompareLess(F f) : m_f(f) { }
|
wxStringCompareLess(F f) : m_f(f) { }
|
||||||
bool operator()(const wxChar* s1, const wxChar* s2)
|
|
||||||
{ return m_f(s1, s2) < 0; }
|
|
||||||
bool operator()(const wxString& s1, const wxString& s2)
|
bool operator()(const wxString& s1, const wxString& s2)
|
||||||
{ return m_f(s1, s2) < 0; }
|
{ return m_f(s1, s2) < 0; }
|
||||||
private:
|
private:
|
||||||
@@ -495,33 +507,32 @@ void wxArrayString::Sort(bool reverseOrder)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxSortedArrayString::Index(const wxChar* sz, bool bCase, bool WXUNUSED(bFromEnd)) const
|
int wxSortedArrayString::Index(const wxString& str, bool bCase, bool WXUNUSED(bFromEnd)) const
|
||||||
{
|
{
|
||||||
wxSortedArrayString::const_iterator it;
|
wxSortedArrayString::const_iterator it;
|
||||||
wxString s(sz);
|
|
||||||
|
|
||||||
if (bCase)
|
if (bCase)
|
||||||
it = std::lower_bound(begin(), end(), s,
|
it = std::lower_bound(begin(), end(), str,
|
||||||
wxStringCompare(wxStrcmpCppWrapper));
|
wxStringCompare(wxStringCmp()));
|
||||||
else
|
else
|
||||||
it = std::lower_bound(begin(), end(), s,
|
it = std::lower_bound(begin(), end(), str,
|
||||||
wxStringCompare(wxStricmpCppWrapper));
|
wxStringCompare(wxStringCmpNoCase()));
|
||||||
|
|
||||||
if (it == end())
|
if (it == end())
|
||||||
return wxNOT_FOUND;
|
return wxNOT_FOUND;
|
||||||
|
|
||||||
if (bCase)
|
if (bCase)
|
||||||
{
|
{
|
||||||
if (wxStrcmp(it->c_str(), sz) != 0)
|
if (str.Cmp(*it) != 0)
|
||||||
return wxNOT_FOUND;
|
return wxNOT_FOUND;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (wxStricmp(it->c_str(), sz) != 0)
|
if (str.CmpNoCase(*it) != 0)
|
||||||
return wxNOT_FOUND;
|
return wxNOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
return it - begin();
|
return it - begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // wxUSE_STL
|
||||||
|
@@ -222,12 +222,12 @@ public:
|
|||||||
bool IsEmpty() const { return Entries().IsEmpty() && Groups().IsEmpty(); }
|
bool IsEmpty() const { return Entries().IsEmpty() && Groups().IsEmpty(); }
|
||||||
|
|
||||||
// find entry/subgroup (NULL if not found)
|
// find entry/subgroup (NULL if not found)
|
||||||
wxFileConfigGroup *FindSubgroup(const wxChar *szName) const;
|
wxFileConfigGroup *FindSubgroup(const wxString& name) const;
|
||||||
wxFileConfigEntry *FindEntry (const wxChar *szName) const;
|
wxFileConfigEntry *FindEntry (const wxString& name) const;
|
||||||
|
|
||||||
// delete entry/subgroup, return false if doesn't exist
|
// delete entry/subgroup, return false if doesn't exist
|
||||||
bool DeleteSubgroupByName(const wxChar *szName);
|
bool DeleteSubgroupByName(const wxString& name);
|
||||||
bool DeleteEntry(const wxChar *szName);
|
bool DeleteEntry(const wxString& name);
|
||||||
|
|
||||||
// create new entry/subgroup returning pointer to newly created element
|
// create new entry/subgroup returning pointer to newly created element
|
||||||
wxFileConfigGroup *AddSubgroup(const wxString& strName);
|
wxFileConfigGroup *AddSubgroup(const wxString& strName);
|
||||||
@@ -536,15 +536,16 @@ wxFileConfig::~wxFileConfig()
|
|||||||
|
|
||||||
void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
|
void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
|
||||||
{
|
{
|
||||||
const wxChar *pStart;
|
|
||||||
const wxChar *pEnd;
|
|
||||||
wxString strLine;
|
|
||||||
|
|
||||||
size_t nLineCount = buffer.GetLineCount();
|
size_t nLineCount = buffer.GetLineCount();
|
||||||
|
|
||||||
for ( size_t n = 0; n < nLineCount; n++ )
|
for ( size_t n = 0; n < nLineCount; n++ )
|
||||||
{
|
{
|
||||||
strLine = buffer[n];
|
wxString strLine = buffer[n];
|
||||||
|
// FIXME-UTF8: rewrite using iterators, without this buffer
|
||||||
|
wxWxCharBuffer buf(strLine.c_str());
|
||||||
|
const wxChar *pStart;
|
||||||
|
const wxChar *pEnd;
|
||||||
|
|
||||||
// add the line to linked list
|
// add the line to linked list
|
||||||
if ( bLocal )
|
if ( bLocal )
|
||||||
@@ -560,7 +561,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
|
|||||||
|
|
||||||
|
|
||||||
// skip leading spaces
|
// skip leading spaces
|
||||||
for ( pStart = strLine; wxIsspace(*pStart); pStart++ )
|
for ( pStart = buf; wxIsspace(*pStart); pStart++ )
|
||||||
;
|
;
|
||||||
|
|
||||||
// skip blank/comment lines
|
// skip blank/comment lines
|
||||||
@@ -1059,7 +1060,7 @@ bool wxFileConfig::Save(wxOutputStream& os, const wxMBConv& conv)
|
|||||||
bool wxFileConfig::RenameEntry(const wxString& oldName,
|
bool wxFileConfig::RenameEntry(const wxString& oldName,
|
||||||
const wxString& newName)
|
const wxString& newName)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( !wxStrchr(oldName, wxCONFIG_PATH_SEPARATOR),
|
wxASSERT_MSG( oldName.find(wxCONFIG_PATH_SEPARATOR) == wxString::npos,
|
||||||
_T("RenameEntry(): paths are not supported") );
|
_T("RenameEntry(): paths are not supported") );
|
||||||
|
|
||||||
// check that the entry exists
|
// check that the entry exists
|
||||||
@@ -1148,7 +1149,8 @@ bool wxFileConfig::DeleteAll()
|
|||||||
|
|
||||||
if ( m_fnLocalFile.IsOk() )
|
if ( m_fnLocalFile.IsOk() )
|
||||||
{
|
{
|
||||||
if ( m_fnLocalFile.FileExists() && wxRemove(m_fnLocalFile.GetFullPath()) == -1 )
|
if ( m_fnLocalFile.FileExists() &&
|
||||||
|
!wxRemoveFile(m_fnLocalFile.GetFullPath()) )
|
||||||
{
|
{
|
||||||
wxLogSysError(_("can't delete user configuration file '%s'"),
|
wxLogSysError(_("can't delete user configuration file '%s'"),
|
||||||
m_fnLocalFile.GetFullPath().c_str());
|
m_fnLocalFile.GetFullPath().c_str());
|
||||||
@@ -1548,7 +1550,7 @@ wxString wxFileConfigGroup::GetFullName() const
|
|||||||
|
|
||||||
// use binary search because the array is sorted
|
// use binary search because the array is sorted
|
||||||
wxFileConfigEntry *
|
wxFileConfigEntry *
|
||||||
wxFileConfigGroup::FindEntry(const wxChar *szName) const
|
wxFileConfigGroup::FindEntry(const wxString& name) const
|
||||||
{
|
{
|
||||||
size_t i,
|
size_t i,
|
||||||
lo = 0,
|
lo = 0,
|
||||||
@@ -1561,9 +1563,9 @@ wxFileConfigGroup::FindEntry(const wxChar *szName) const
|
|||||||
pEntry = m_aEntries[i];
|
pEntry = m_aEntries[i];
|
||||||
|
|
||||||
#if wxCONFIG_CASE_SENSITIVE
|
#if wxCONFIG_CASE_SENSITIVE
|
||||||
res = wxStrcmp(pEntry->Name(), szName);
|
res = pEntry->Name().compare(name);
|
||||||
#else
|
#else
|
||||||
res = wxStricmp(pEntry->Name(), szName);
|
res = pEntry->Name().CmpNoCase(name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( res > 0 )
|
if ( res > 0 )
|
||||||
@@ -1578,7 +1580,7 @@ wxFileConfigGroup::FindEntry(const wxChar *szName) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxFileConfigGroup *
|
wxFileConfigGroup *
|
||||||
wxFileConfigGroup::FindSubgroup(const wxChar *szName) const
|
wxFileConfigGroup::FindSubgroup(const wxString& name) const
|
||||||
{
|
{
|
||||||
size_t i,
|
size_t i,
|
||||||
lo = 0,
|
lo = 0,
|
||||||
@@ -1591,9 +1593,9 @@ wxFileConfigGroup::FindSubgroup(const wxChar *szName) const
|
|||||||
pGroup = m_aSubgroups[i];
|
pGroup = m_aSubgroups[i];
|
||||||
|
|
||||||
#if wxCONFIG_CASE_SENSITIVE
|
#if wxCONFIG_CASE_SENSITIVE
|
||||||
res = wxStrcmp(pGroup->Name(), szName);
|
res = pGroup->Name().compare(name);
|
||||||
#else
|
#else
|
||||||
res = wxStricmp(pGroup->Name(), szName);
|
res = pGroup->Name().CmpNoCase(name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( res > 0 )
|
if ( res > 0 )
|
||||||
@@ -1644,9 +1646,9 @@ wxFileConfigGroup *wxFileConfigGroup::AddSubgroup(const wxString& strName)
|
|||||||
delete several of them.
|
delete several of them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool wxFileConfigGroup::DeleteSubgroupByName(const wxChar *szName)
|
bool wxFileConfigGroup::DeleteSubgroupByName(const wxString& name)
|
||||||
{
|
{
|
||||||
wxFileConfigGroup * const pGroup = FindSubgroup(szName);
|
wxFileConfigGroup * const pGroup = FindSubgroup(name);
|
||||||
|
|
||||||
return pGroup ? DeleteSubgroup(pGroup) : false;
|
return pGroup ? DeleteSubgroup(pGroup) : false;
|
||||||
}
|
}
|
||||||
@@ -1765,9 +1767,9 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFileConfigGroup::DeleteEntry(const wxChar *szName)
|
bool wxFileConfigGroup::DeleteEntry(const wxString& name)
|
||||||
{
|
{
|
||||||
wxFileConfigEntry *pEntry = FindEntry(szName);
|
wxFileConfigEntry *pEntry = FindEntry(name);
|
||||||
if ( !pEntry )
|
if ( !pEntry )
|
||||||
{
|
{
|
||||||
// entry doesn't exist, nothing to do
|
// entry doesn't exist, nothing to do
|
||||||
@@ -1920,18 +1922,18 @@ void wxFileConfigEntry::SetValue(const wxString& strValue, bool bUser)
|
|||||||
int CompareEntries(wxFileConfigEntry *p1, wxFileConfigEntry *p2)
|
int CompareEntries(wxFileConfigEntry *p1, wxFileConfigEntry *p2)
|
||||||
{
|
{
|
||||||
#if wxCONFIG_CASE_SENSITIVE
|
#if wxCONFIG_CASE_SENSITIVE
|
||||||
return wxStrcmp(p1->Name(), p2->Name());
|
return p1->Name().compare(p2->Name());
|
||||||
#else
|
#else
|
||||||
return wxStricmp(p1->Name(), p2->Name());
|
return p1->Name().CmpNoCase(p2->Name());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int CompareGroups(wxFileConfigGroup *p1, wxFileConfigGroup *p2)
|
int CompareGroups(wxFileConfigGroup *p1, wxFileConfigGroup *p2)
|
||||||
{
|
{
|
||||||
#if wxCONFIG_CASE_SENSITIVE
|
#if wxCONFIG_CASE_SENSITIVE
|
||||||
return wxStrcmp(p1->Name(), p2->Name());
|
return p1->Name().compare(p2->Name());
|
||||||
#else
|
#else
|
||||||
return wxStricmp(p1->Name(), p2->Name());
|
return p1->Name().CmpNoCase(p2->Name());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -767,7 +767,7 @@ static wxString wxCreateTempImpl(
|
|||||||
path += _T("XXXXXX");
|
path += _T("XXXXXX");
|
||||||
|
|
||||||
// we need to copy the path to the buffer in which mkstemp() can modify it
|
// we need to copy the path to the buffer in which mkstemp() can modify it
|
||||||
wxCharBuffer buf( wxConvFile.cWX2MB( path ) );
|
wxCharBuffer buf(path.fn_str());
|
||||||
|
|
||||||
// cast is safe because the string length doesn't change
|
// cast is safe because the string length doesn't change
|
||||||
int fdTemp = mkstemp( (char*)(const char*) buf );
|
int fdTemp = mkstemp( (char*)(const char*) buf );
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
// the filter classes they use.
|
// the filter classes they use.
|
||||||
|
|
||||||
const wxFilterClassFactory *
|
const wxFilterClassFactory *
|
||||||
wxFilterClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type)
|
wxFilterClassFactory::Find(const wxString& protocol, wxStreamProtocolType type)
|
||||||
{
|
{
|
||||||
for (const wxFilterClassFactory *f = GetFirst(); f; f = f->GetNext())
|
for (const wxFilterClassFactory *f = GetFirst(); f; f = f->GetNext())
|
||||||
if (f->CanHandle(protocol, type))
|
if (f->CanHandle(protocol, type))
|
||||||
|
@@ -314,7 +314,7 @@ char wxFTP::GetResult()
|
|||||||
}
|
}
|
||||||
else // subsequent line of multiline reply
|
else // subsequent line of multiline reply
|
||||||
{
|
{
|
||||||
if ( wxStrncmp(line, code, LEN_CODE) == 0 )
|
if ( line.compare(0, LEN_CODE, code) == 0 )
|
||||||
{
|
{
|
||||||
if ( chMarker == _T(' ') )
|
if ( chMarker == _T(' ') )
|
||||||
{
|
{
|
||||||
@@ -378,7 +378,7 @@ bool wxFTP::SetTransferMode(TransferMode transferMode)
|
|||||||
|
|
||||||
if ( !DoSimpleCommand(_T("TYPE"), mode) )
|
if ( !DoSimpleCommand(_T("TYPE"), mode) )
|
||||||
{
|
{
|
||||||
wxLogError(_("Failed to set FTP transfer mode to %s."), (const wxChar*)
|
wxLogError(_("Failed to set FTP transfer mode to %s."),
|
||||||
(transferMode == ASCII ? _("ASCII") : _("binary")));
|
(transferMode == ASCII ? _("ASCII") : _("binary")));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -707,18 +707,20 @@ wxSocketBase *wxFTP::GetPassivePort()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wxChar *addrStart = wxStrchr(m_lastResult, _T('('));
|
size_t addrStart = m_lastResult.find(_T('('));
|
||||||
const wxChar *addrEnd = addrStart ? wxStrchr(addrStart, _T(')')) : NULL;
|
size_t addrEnd = (addrStart == wxString::npos)
|
||||||
if ( !addrEnd )
|
? wxString::npos
|
||||||
|
: m_lastResult.find(_T(')'), addrStart);
|
||||||
|
|
||||||
|
if ( addrEnd == wxString::npos )
|
||||||
{
|
{
|
||||||
m_lastError = wxPROTO_PROTERR;
|
m_lastError = wxPROTO_PROTERR;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the port number and address
|
// get the port number and address
|
||||||
int a[6];
|
int a[6];
|
||||||
wxString straddr(addrStart + 1, addrEnd);
|
wxString straddr(m_lastResult, addrStart + 1, addrEnd - (addrStart + 1));
|
||||||
wxSscanf(straddr, wxT("%d,%d,%d,%d,%d,%d"),
|
wxSscanf(straddr, wxT("%d,%d,%d,%d,%d,%d"),
|
||||||
&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
|
&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ wxHTTP::wxHeaderIterator wxHTTP::FindHeader(const wxString& header)
|
|||||||
wxHeaderIterator it = m_headers.begin();
|
wxHeaderIterator it = m_headers.begin();
|
||||||
for ( wxHeaderIterator en = m_headers.end(); it != en; ++it )
|
for ( wxHeaderIterator en = m_headers.end(); it != en; ++it )
|
||||||
{
|
{
|
||||||
if ( wxStricmp(it->first, header) == 0 )
|
if ( header.CmpNoCase(it->first) == 0 )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ wxHTTP::wxHeaderConstIterator wxHTTP::FindHeader(const wxString& header) const
|
|||||||
wxHeaderConstIterator it = m_headers.begin();
|
wxHeaderConstIterator it = m_headers.begin();
|
||||||
for ( wxHeaderConstIterator en = m_headers.end(); it != en; ++it )
|
for ( wxHeaderConstIterator en = m_headers.end(); it != en; ++it )
|
||||||
{
|
{
|
||||||
if ( wxStricmp(it->first, header) == 0 )
|
if ( header.CmpNoCase(it->first) == 0 )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,8 +274,8 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
|
|||||||
|
|
||||||
wxString buf;
|
wxString buf;
|
||||||
buf.Printf(wxT("%s %s HTTP/1.0\r\n"), request, path.c_str());
|
buf.Printf(wxT("%s %s HTTP/1.0\r\n"), request, path.c_str());
|
||||||
const wxWX2MBbuf pathbuf = wxConvLocal.cWX2MB(buf);
|
const wxWX2MBbuf pathbuf = buf.mb_str();
|
||||||
Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf));
|
Write(pathbuf, strlen(pathbuf));
|
||||||
SendHeaders();
|
SendHeaders();
|
||||||
Write("\r\n", 2);
|
Write("\r\n", 2);
|
||||||
|
|
||||||
@@ -407,7 +407,7 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path)
|
|||||||
inp_stream = new wxHTTPStream(this);
|
inp_stream = new wxHTTPStream(this);
|
||||||
|
|
||||||
if (!GetHeader(wxT("Content-Length")).empty())
|
if (!GetHeader(wxT("Content-Length")).empty())
|
||||||
inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
|
inp_stream->m_httpsize = wxAtoi(GetHeader(wxT("Content-Length")));
|
||||||
else
|
else
|
||||||
inp_stream->m_httpsize = (size_t)-1;
|
inp_stream->m_httpsize = (size_t)-1;
|
||||||
|
|
||||||
|
@@ -2231,7 +2231,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype, int ind
|
|||||||
|
|
||||||
if (stream.IsSeekable() && !handler->CanRead(stream))
|
if (stream.IsSeekable() && !handler->CanRead(stream))
|
||||||
{
|
{
|
||||||
wxLogError(_("Image file is not of type %s."), (const wxChar*) mimetype);
|
wxLogError(_("Image file is not of type %s."), mimetype);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -40,25 +40,18 @@
|
|||||||
// just add +1 to m_len in the ctor
|
// just add +1 to m_len in the ctor
|
||||||
wxStringInputStream::wxStringInputStream(const wxString& s)
|
wxStringInputStream::wxStringInputStream(const wxString& s)
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
: m_str(s), m_buf(wxMBConvUTF8().cWX2MB(s).release()), m_len(strlen(m_buf))
|
// FIXME-UTF8: use wxCharBufferWithLength if we have it
|
||||||
|
: m_str(s), m_buf(s.utf8_str()), m_len(strlen(m_buf))
|
||||||
#else
|
#else
|
||||||
: m_str(s), m_buf((char*)(const char*)s.c_str()), m_len(s.length())
|
: m_str(s), m_buf(s.mb_str()), m_len(s.length())
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxASSERT_MSG(m_buf != NULL, _T("Could not convert string to UTF8!"));
|
wxASSERT_MSG(m_buf.data() != NULL, _T("Could not convert string to UTF8!"));
|
||||||
#endif
|
#endif
|
||||||
m_pos = 0;
|
m_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxStringInputStream::~wxStringInputStream()
|
|
||||||
{
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
// Note: wx[W]CharBuffer uses malloc()/free()
|
|
||||||
free(m_buf);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// getlength
|
// getlength
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -126,7 +119,7 @@ size_t wxStringInputStream::OnSysRead(void *buffer, size_t size)
|
|||||||
size = sizeMax;
|
size = sizeMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(buffer, m_buf + m_pos, size);
|
memcpy(buffer, m_buf.data() + m_pos, size);
|
||||||
m_pos += size;
|
m_pos += size;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
|
@@ -476,10 +476,10 @@ size_t wxMBConvLibc::WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
|||||||
|
|
||||||
#ifdef __UNIX__
|
#ifdef __UNIX__
|
||||||
|
|
||||||
wxConvBrokenFileNames::wxConvBrokenFileNames(const wxChar *charset)
|
wxConvBrokenFileNames::wxConvBrokenFileNames(const wxString& charset)
|
||||||
{
|
{
|
||||||
if ( !charset || wxStricmp(charset, _T("UTF-8")) == 0
|
if ( wxStricmp(charset, _T("UTF-8")) == 0 ||
|
||||||
|| wxStricmp(charset, _T("UTF8")) == 0 )
|
wxStricmp(charset, _T("UTF8")) == 0 )
|
||||||
m_conv = new wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA);
|
m_conv = new wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA);
|
||||||
else
|
else
|
||||||
m_conv = new wxCSConv(charset);
|
m_conv = new wxCSConv(charset);
|
||||||
@@ -1588,7 +1588,7 @@ wxMBConvUTF32swap::FromWChar(char *dst, size_t dstLen,
|
|||||||
class wxMBConv_iconv : public wxMBConv
|
class wxMBConv_iconv : public wxMBConv
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxMBConv_iconv(const wxChar *name);
|
wxMBConv_iconv(const char *name);
|
||||||
virtual ~wxMBConv_iconv();
|
virtual ~wxMBConv_iconv();
|
||||||
|
|
||||||
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
|
virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
|
||||||
@@ -1603,7 +1603,7 @@ public:
|
|||||||
|
|
||||||
virtual wxMBConv *Clone() const
|
virtual wxMBConv *Clone() const
|
||||||
{
|
{
|
||||||
wxMBConv_iconv *p = new wxMBConv_iconv(m_name);
|
wxMBConv_iconv *p = new wxMBConv_iconv(m_name.ToAscii());
|
||||||
p->m_minMBCharWidth = m_minMBCharWidth;
|
p->m_minMBCharWidth = m_minMBCharWidth;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@@ -1641,7 +1641,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// make the constructor available for unit testing
|
// make the constructor available for unit testing
|
||||||
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_iconv( const wxChar* name )
|
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_iconv( const char* name )
|
||||||
{
|
{
|
||||||
wxMBConv_iconv* result = new wxMBConv_iconv( name );
|
wxMBConv_iconv* result = new wxMBConv_iconv( name );
|
||||||
if ( !result->IsOk() )
|
if ( !result->IsOk() )
|
||||||
@@ -1656,15 +1656,11 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_iconv( const wxChar* name )
|
|||||||
wxString wxMBConv_iconv::ms_wcCharsetName;
|
wxString wxMBConv_iconv::ms_wcCharsetName;
|
||||||
bool wxMBConv_iconv::ms_wcNeedsSwap = false;
|
bool wxMBConv_iconv::ms_wcNeedsSwap = false;
|
||||||
|
|
||||||
wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
|
wxMBConv_iconv::wxMBConv_iconv(const char *name)
|
||||||
: m_name(name)
|
: m_name(name)
|
||||||
{
|
{
|
||||||
m_minMBCharWidth = 0;
|
m_minMBCharWidth = 0;
|
||||||
|
|
||||||
// iconv operates with chars, not wxChars, but luckily it uses only ASCII
|
|
||||||
// names for the charsets
|
|
||||||
const wxCharBuffer cname(wxString(name).ToAscii());
|
|
||||||
|
|
||||||
// check for charset that represents wchar_t:
|
// check for charset that represents wchar_t:
|
||||||
if ( ms_wcCharsetName.empty() )
|
if ( ms_wcCharsetName.empty() )
|
||||||
{
|
{
|
||||||
@@ -1701,13 +1697,13 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
|
|||||||
wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
|
wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
|
||||||
nameXE.c_str());
|
nameXE.c_str());
|
||||||
|
|
||||||
m2w = iconv_open(nameXE.ToAscii(), cname);
|
m2w = iconv_open(nameXE.ToAscii(), name);
|
||||||
if ( m2w == ICONV_T_INVALID )
|
if ( m2w == ICONV_T_INVALID )
|
||||||
{
|
{
|
||||||
// try charset w/o bytesex info (e.g. "UCS4")
|
// try charset w/o bytesex info (e.g. "UCS4")
|
||||||
wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
|
wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""),
|
||||||
nameCS.c_str());
|
nameCS.c_str());
|
||||||
m2w = iconv_open(nameCS.ToAscii(), cname);
|
m2w = iconv_open(nameCS.ToAscii(), name);
|
||||||
|
|
||||||
// and check for bytesex ourselves:
|
// and check for bytesex ourselves:
|
||||||
if ( m2w != ICONV_T_INVALID )
|
if ( m2w != ICONV_T_INVALID )
|
||||||
@@ -1757,7 +1753,7 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
|
|||||||
}
|
}
|
||||||
else // we already have ms_wcCharsetName
|
else // we already have ms_wcCharsetName
|
||||||
{
|
{
|
||||||
m2w = iconv_open(ms_wcCharsetName.ToAscii(), cname);
|
m2w = iconv_open(ms_wcCharsetName.ToAscii(), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ms_wcCharsetName.empty() )
|
if ( ms_wcCharsetName.empty() )
|
||||||
@@ -1766,12 +1762,12 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
w2m = iconv_open(cname, ms_wcCharsetName.ToAscii());
|
w2m = iconv_open(name, ms_wcCharsetName.ToAscii());
|
||||||
if ( w2m == ICONV_T_INVALID )
|
if ( w2m == ICONV_T_INVALID )
|
||||||
{
|
{
|
||||||
wxLogTrace(TRACE_STRCONV,
|
wxLogTrace(TRACE_STRCONV,
|
||||||
wxT("\"%s\" -> \"%s\" works but not the converse!?"),
|
wxT("\"%s\" -> \"%s\" works but not the converse!?"),
|
||||||
ms_wcCharsetName.c_str(), cname.data());
|
ms_wcCharsetName.c_str(), name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1982,8 +1978,8 @@ size_t wxMBConv_iconv::GetMBNulLen() const
|
|||||||
#if wxUSE_UNICODE_UTF8
|
#if wxUSE_UNICODE_UTF8
|
||||||
bool wxMBConv_iconv::IsUTF8() const
|
bool wxMBConv_iconv::IsUTF8() const
|
||||||
{
|
{
|
||||||
return wxStricmp(m_name, _T("UTF-8")) == 0 ||
|
return wxStricmp(m_name, "UTF-8") == 0 ||
|
||||||
wxStricmp(m_name, _T("UTF8")) == 0;
|
wxStricmp(m_name, "UTF8") == 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1998,7 +1994,7 @@ bool wxMBConv_iconv::IsUTF8() const
|
|||||||
|
|
||||||
// from utils.cpp
|
// from utils.cpp
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
extern WXDLLIMPEXP_BASE long wxCharsetToCodepage(const wxChar *charset);
|
extern WXDLLIMPEXP_BASE long wxCharsetToCodepage(const char *charset);
|
||||||
extern WXDLLIMPEXP_BASE long wxEncodingToCodepage(wxFontEncoding encoding);
|
extern WXDLLIMPEXP_BASE long wxEncodingToCodepage(wxFontEncoding encoding);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2019,7 +2015,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
wxMBConv_win32(const wxChar* name)
|
wxMBConv_win32(const char* name)
|
||||||
{
|
{
|
||||||
m_CodePage = wxCharsetToCodepage(name);
|
m_CodePage = wxCharsetToCodepage(name);
|
||||||
m_minMBCharWidth = 0;
|
m_minMBCharWidth = 0;
|
||||||
@@ -3107,7 +3103,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
// temporarily just use wxEncodingConverter stuff,
|
// temporarily just use wxEncodingConverter stuff,
|
||||||
// so that it works while a better implementation is built
|
// so that it works while a better implementation is built
|
||||||
wxMBConv_wxwin(const wxChar* name)
|
wxMBConv_wxwin(const char* name)
|
||||||
{
|
{
|
||||||
if (name)
|
if (name)
|
||||||
m_enc = wxFontMapperBase::Get()->CharsetToEncoding(name, false);
|
m_enc = wxFontMapperBase::Get()->CharsetToEncoding(name, false);
|
||||||
@@ -3180,7 +3176,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// make the constructors available for unit testing
|
// make the constructors available for unit testing
|
||||||
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_wxwin( const wxChar* name )
|
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_wxwin( const char* name )
|
||||||
{
|
{
|
||||||
wxMBConv_wxwin* result = new wxMBConv_wxwin( name );
|
wxMBConv_wxwin* result = new wxMBConv_wxwin( name );
|
||||||
if ( !result->IsOk() )
|
if ( !result->IsOk() )
|
||||||
@@ -3205,13 +3201,13 @@ void wxCSConv::Init()
|
|||||||
m_deferred = true;
|
m_deferred = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCSConv::wxCSConv(const wxChar *charset)
|
wxCSConv::wxCSConv(const wxString& charset)
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
if ( charset )
|
if ( !charset.empty() )
|
||||||
{
|
{
|
||||||
SetName(charset);
|
SetName(charset.ToAscii());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
@@ -3268,11 +3264,11 @@ void wxCSConv::Clear()
|
|||||||
m_convReal = NULL;
|
m_convReal = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCSConv::SetName(const wxChar *charset)
|
void wxCSConv::SetName(const char *charset)
|
||||||
{
|
{
|
||||||
if (charset)
|
if (charset)
|
||||||
{
|
{
|
||||||
m_name = wxStrdup(charset);
|
m_name = strdup(charset);
|
||||||
m_deferred = true;
|
m_deferred = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3291,7 +3287,7 @@ wxMBConv *wxCSConv::DoCreate() const
|
|||||||
wxLogTrace(TRACE_STRCONV,
|
wxLogTrace(TRACE_STRCONV,
|
||||||
wxT("creating conversion for %s"),
|
wxT("creating conversion for %s"),
|
||||||
(m_name ? m_name
|
(m_name ? m_name
|
||||||
: (const wxChar*)wxFontMapperBase::GetEncodingName(m_encoding).c_str()));
|
: (const char*)wxFontMapperBase::GetEncodingName(m_encoding).mb_str()));
|
||||||
#endif // wxUSE_FONTMAP
|
#endif // wxUSE_FONTMAP
|
||||||
|
|
||||||
// check for the special case of ASCII or ISO8859-1 charset: as we have
|
// check for the special case of ASCII or ISO8859-1 charset: as we have
|
||||||
@@ -3318,14 +3314,13 @@ wxMBConv *wxCSConv::DoCreate() const
|
|||||||
if ( m_name )
|
if ( m_name )
|
||||||
#endif // !wxUSE_FONTMAP
|
#endif // !wxUSE_FONTMAP
|
||||||
{
|
{
|
||||||
wxString name(m_name);
|
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
wxFontEncoding encoding(m_encoding);
|
wxFontEncoding encoding(m_encoding);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !name.empty() )
|
if ( m_name )
|
||||||
{
|
{
|
||||||
wxMBConv_iconv *conv = new wxMBConv_iconv(name);
|
wxMBConv_iconv *conv = new wxMBConv_iconv(m_name);
|
||||||
if ( conv->IsOk() )
|
if ( conv->IsOk() )
|
||||||
return conv;
|
return conv;
|
||||||
|
|
||||||
@@ -3333,7 +3328,7 @@ wxMBConv *wxCSConv::DoCreate() const
|
|||||||
|
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
encoding =
|
encoding =
|
||||||
wxFontMapperBase::Get()->CharsetToEncoding(name, false);
|
wxFontMapperBase::Get()->CharsetToEncoding(m_name, false);
|
||||||
#endif // wxUSE_FONTMAP
|
#endif // wxUSE_FONTMAP
|
||||||
}
|
}
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
@@ -3344,7 +3339,7 @@ wxMBConv *wxCSConv::DoCreate() const
|
|||||||
if ( it->second.empty() )
|
if ( it->second.empty() )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wxMBConv_iconv *conv = new wxMBConv_iconv(it->second);
|
wxMBConv_iconv *conv = new wxMBConv_iconv(it->second.ToAscii());
|
||||||
if ( conv->IsOk() )
|
if ( conv->IsOk() )
|
||||||
return conv;
|
return conv;
|
||||||
|
|
||||||
@@ -3352,15 +3347,19 @@ wxMBConv *wxCSConv::DoCreate() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const wxChar** names = wxFontMapperBase::GetAllEncodingNames(encoding);
|
const wxChar** names = wxFontMapperBase::GetAllEncodingNames(encoding);
|
||||||
// CS : in case this does not return valid names (eg for MacRoman) encoding
|
// CS : in case this does not return valid names (eg for MacRoman)
|
||||||
// got a 'failure' entry in the cache all the same, although it just has to
|
// encoding got a 'failure' entry in the cache all the same,
|
||||||
// be created using a different method, so only store failed iconv creation
|
// although it just has to be created using a different method, so
|
||||||
// attempts (or perhaps we shoulnd't do this at all ?)
|
// only store failed iconv creation attempts (or perhaps we
|
||||||
|
// shoulnd't do this at all ?)
|
||||||
if ( names[0] != NULL )
|
if ( names[0] != NULL )
|
||||||
{
|
{
|
||||||
for ( ; *names; ++names )
|
for ( ; *names; ++names )
|
||||||
{
|
{
|
||||||
wxMBConv_iconv *conv = new wxMBConv_iconv(*names);
|
// FIXME-UTF8: wxFontMapperBase::GetAllEncodingNames()
|
||||||
|
// will need changes that will obsolete this
|
||||||
|
wxString name(*names);
|
||||||
|
wxMBConv_iconv *conv = new wxMBConv_iconv(name.ToAscii());
|
||||||
if ( conv->IsOk() )
|
if ( conv->IsOk() )
|
||||||
{
|
{
|
||||||
gs_nameCache[encoding] = *names;
|
gs_nameCache[encoding] = *names;
|
||||||
@@ -3494,9 +3493,9 @@ wxMBConv *wxCSConv::DoCreate() const
|
|||||||
m_name ? m_name
|
m_name ? m_name
|
||||||
:
|
:
|
||||||
#if wxUSE_FONTMAP
|
#if wxUSE_FONTMAP
|
||||||
(const wxChar*)wxFontMapperBase::GetEncodingDescription(m_encoding).c_str()
|
(const char*)wxFontMapperBase::GetEncodingDescription(m_encoding).ToAscii()
|
||||||
#else // !wxUSE_FONTMAP
|
#else // !wxUSE_FONTMAP
|
||||||
(const wxChar*)wxString::Format(_("encoding %i"), m_encoding).c_str()
|
(const char*)wxString::Format(_("encoding %i"), m_encoding).ToAscii()
|
||||||
#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP
|
#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1156,29 +1156,25 @@ wxString wxFilterClassFactoryBase::PopExtension(const wxString& location) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxString::size_type wxFilterClassFactoryBase::FindExtension(
|
wxString::size_type wxFilterClassFactoryBase::FindExtension(
|
||||||
const wxChar *location) const
|
const wxString& location) const
|
||||||
{
|
{
|
||||||
size_t len = wxStrlen(location);
|
|
||||||
|
|
||||||
for (const wxChar *const *p = GetProtocols(wxSTREAM_FILEEXT); *p; p++)
|
for (const wxChar *const *p = GetProtocols(wxSTREAM_FILEEXT); *p; p++)
|
||||||
{
|
{
|
||||||
size_t l = wxStrlen(*p);
|
if ( location.EndsWith(*p) )
|
||||||
|
return location.length() - wxStrlen(*p);
|
||||||
if (l <= len && wxStrcmp(*p, location + len - l) == 0)
|
|
||||||
return len - l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxString::npos;
|
return wxString::npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFilterClassFactoryBase::CanHandle(const wxChar *protocol,
|
bool wxFilterClassFactoryBase::CanHandle(const wxString& protocol,
|
||||||
wxStreamProtocolType type) const
|
wxStreamProtocolType type) const
|
||||||
{
|
{
|
||||||
if (type == wxSTREAM_FILEEXT)
|
if (type == wxSTREAM_FILEEXT)
|
||||||
return FindExtension(protocol) != wxString::npos;
|
return FindExtension(protocol) != wxString::npos;
|
||||||
else
|
else
|
||||||
for (const wxChar *const *p = GetProtocols(type); *p; p++)
|
for (const wxChar *const *p = GetProtocols(type); *p; p++)
|
||||||
if (wxStrcmp(*p, protocol) == 0)
|
if (protocol == *p)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -829,8 +829,8 @@ wxTarNumber wxTarInputStream::GetHeaderNumber(int id) const
|
|||||||
|
|
||||||
if ((value = GetExtendedHeader(m_hdr->Name(id))) != wxEmptyString) {
|
if ((value = GetExtendedHeader(m_hdr->Name(id))) != wxEmptyString) {
|
||||||
wxTarNumber n = 0;
|
wxTarNumber n = 0;
|
||||||
const wxChar *p = value;
|
wxString::const_iterator p = value.begin();
|
||||||
while (*p == ' ')
|
while (*p == ' ' && p != value.end())
|
||||||
p++;
|
p++;
|
||||||
while (isdigit(*p))
|
while (isdigit(*p))
|
||||||
n = n * 10 + (*p++ - '0');
|
n = n * 10 + (*p++ - '0');
|
||||||
|
@@ -416,7 +416,8 @@ void wxTextOutputStream::WriteString(const wxString& string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxCharBuffer buffer = m_conv->cWC2MB(out, out.length(), &len);
|
// FIXME-UTF8: use wxCharBufferWithLength if/when we have it
|
||||||
|
wxCharBuffer buffer = m_conv->cWC2MB(out.wc_str(), out.length(), &len);
|
||||||
m_output.Write(buffer, len);
|
m_output.Write(buffer, len);
|
||||||
#else
|
#else
|
||||||
m_output.Write(out.c_str(), out.length() );
|
m_output.Write(out.c_str(), out.length() );
|
||||||
|
@@ -93,7 +93,10 @@ const wxChar* wxURI::Create(const wxString& uri)
|
|||||||
if (m_fields)
|
if (m_fields)
|
||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
return Parse(uri);
|
// FIXME-UTF8: rewrite ParseXXX() methods using iterators
|
||||||
|
// NB: using wxWxCharBuffer instead of just c_str() avoids keeping
|
||||||
|
// converted string in memory for longer than needed
|
||||||
|
return Parse(wxWxCharBuffer(uri.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -374,7 +377,7 @@ bool wxURI::IsReference() const
|
|||||||
// URI-reference = URI / relative
|
// URI-reference = URI / relative
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
const wxChar* wxURI::Parse(const wxChar* uri)
|
const wxChar* wxURI::Parse(const wxChar *uri)
|
||||||
{
|
{
|
||||||
uri = ParseScheme(uri);
|
uri = ParseScheme(uri);
|
||||||
uri = ParseAuthority(uri);
|
uri = ParseAuthority(uri);
|
||||||
@@ -389,7 +392,7 @@ const wxChar* wxURI::Parse(const wxChar* uri)
|
|||||||
// Individual parsers for each URI component
|
// Individual parsers for each URI component
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
const wxChar* wxURI::ParseScheme(const wxChar* uri)
|
const wxChar* wxURI::ParseScheme(const wxChar *uri)
|
||||||
{
|
{
|
||||||
wxASSERT(uri != NULL);
|
wxASSERT(uri != NULL);
|
||||||
|
|
||||||
|
@@ -1004,7 +1004,7 @@ size_t wxZipEntry::ReadLocal(wxInputStream& stream, wxMBConv& conv)
|
|||||||
size_t wxZipEntry::WriteLocal(wxOutputStream& stream, wxMBConv& conv) const
|
size_t wxZipEntry::WriteLocal(wxOutputStream& stream, wxMBConv& conv) const
|
||||||
{
|
{
|
||||||
wxString unixName = GetName(wxPATH_UNIX);
|
wxString unixName = GetName(wxPATH_UNIX);
|
||||||
const wxWX2MBbuf name_buf = conv.cWX2MB(unixName);
|
const wxWX2MBbuf name_buf = unixName.mb_str(conv);
|
||||||
const char *name = name_buf;
|
const char *name = name_buf;
|
||||||
if (!name) name = "";
|
if (!name) name = "";
|
||||||
wxUint16 nameLen = wx_truncate_cast(wxUint16, strlen(name));
|
wxUint16 nameLen = wx_truncate_cast(wxUint16, strlen(name));
|
||||||
@@ -1080,12 +1080,12 @@ size_t wxZipEntry::ReadCentral(wxInputStream& stream, wxMBConv& conv)
|
|||||||
size_t wxZipEntry::WriteCentral(wxOutputStream& stream, wxMBConv& conv) const
|
size_t wxZipEntry::WriteCentral(wxOutputStream& stream, wxMBConv& conv) const
|
||||||
{
|
{
|
||||||
wxString unixName = GetName(wxPATH_UNIX);
|
wxString unixName = GetName(wxPATH_UNIX);
|
||||||
const wxWX2MBbuf name_buf = conv.cWX2MB(unixName);
|
const wxWX2MBbuf name_buf = unixName.mb_str(conv);
|
||||||
const char *name = name_buf;
|
const char *name = name_buf;
|
||||||
if (!name) name = "";
|
if (!name) name = "";
|
||||||
wxUint16 nameLen = wx_truncate_cast(wxUint16, strlen(name));
|
wxUint16 nameLen = wx_truncate_cast(wxUint16, strlen(name));
|
||||||
|
|
||||||
const wxWX2MBbuf comment_buf = conv.cWX2MB(m_Comment);
|
const wxWX2MBbuf comment_buf = m_Comment.mb_str(conv);
|
||||||
const char *comment = comment_buf;
|
const char *comment = comment_buf;
|
||||||
if (!comment) comment = "";
|
if (!comment) comment = "";
|
||||||
wxUint16 commentLen = wx_truncate_cast(wxUint16, strlen(comment));
|
wxUint16 commentLen = wx_truncate_cast(wxUint16, strlen(comment));
|
||||||
@@ -1235,7 +1235,7 @@ wxZipEndRec::wxZipEndRec()
|
|||||||
|
|
||||||
bool wxZipEndRec::Write(wxOutputStream& stream, wxMBConv& conv) const
|
bool wxZipEndRec::Write(wxOutputStream& stream, wxMBConv& conv) const
|
||||||
{
|
{
|
||||||
const wxWX2MBbuf comment_buf = conv.cWX2MB(m_Comment);
|
const wxWX2MBbuf comment_buf = m_Comment.mb_str(conv);
|
||||||
const char *comment = comment_buf;
|
const char *comment = comment_buf;
|
||||||
if (!comment) comment = "";
|
if (!comment) comment = "";
|
||||||
wxUint16 commentLen = (wxUint16)strlen(comment);
|
wxUint16 commentLen = (wxUint16)strlen(comment);
|
||||||
|
@@ -82,8 +82,7 @@ wxAnimation& wxAnimation::operator=(const wxAnimation& that)
|
|||||||
bool wxAnimation::LoadFile(const wxString &name, wxAnimationType WXUNUSED(type))
|
bool wxAnimation::LoadFile(const wxString &name, wxAnimationType WXUNUSED(type))
|
||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
m_pixbuf = gdk_pixbuf_animation_new_from_file(
|
m_pixbuf = gdk_pixbuf_animation_new_from_file(name.fn_str(), NULL);
|
||||||
wxConvFileName->cWX2MB(name), NULL);
|
|
||||||
return IsOk();
|
return IsOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -148,7 +148,7 @@ wxDirDialog::wxDirDialog(wxWindow* parent, const wxString& title,
|
|||||||
|
|
||||||
if ( !defaultPath.empty() )
|
if ( !defaultPath.empty() )
|
||||||
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
|
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
|
||||||
wxConvFileName->cWX2MB(defaultPath) );
|
defaultPath.fn_str() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxGenericDirDialog::Create(parent, title, defaultPath, style, pos, sz, name);
|
wxGenericDirDialog::Create(parent, title, defaultPath, style, pos, sz, name);
|
||||||
@@ -192,7 +192,8 @@ void wxDirDialog::SetPath(const wxString& dir)
|
|||||||
{
|
{
|
||||||
if (wxDirExists(dir))
|
if (wxDirExists(dir))
|
||||||
{
|
{
|
||||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
|
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
|
||||||
|
dir.fn_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -204,7 +205,7 @@ wxString wxDirDialog::GetPath() const
|
|||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
wxGtkString str(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget)));
|
wxGtkString str(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget)));
|
||||||
return wxConvFileName->cMB2WX(str);
|
return wxString(str, *wxConvFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxGenericDirDialog::GetPath();
|
return wxGenericDirDialog::GetPath();
|
||||||
|
@@ -50,7 +50,7 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
|
|||||||
|
|
||||||
msg.Printf(
|
msg.Printf(
|
||||||
_("File '%s' already exists, do you really want to overwrite it?"),
|
_("File '%s' already exists, do you really want to overwrite it?"),
|
||||||
wxString(wxConvFileName->cMB2WX(filename)).c_str());
|
wxString(filename, *wxConvFileName));
|
||||||
|
|
||||||
wxMessageDialog dlg(dialog, msg, _("Confirm"),
|
wxMessageDialog dlg(dialog, msg, _("Confirm"),
|
||||||
wxYES_NO | wxICON_QUESTION);
|
wxYES_NO | wxICON_QUESTION);
|
||||||
@@ -318,7 +318,7 @@ wxString wxFileDialog::GetPath() const
|
|||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
wxGtkString str(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget)));
|
wxGtkString str(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(m_widget)));
|
||||||
return wxConvFileName->cMB2WX(str);
|
return wxString(str, *wxConvFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxGenericFileDialog::GetPath();
|
return wxGenericFileDialog::GetPath();
|
||||||
@@ -350,7 +350,7 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const
|
|||||||
GSList *gpaths = gpathsi;
|
GSList *gpaths = gpathsi;
|
||||||
while (gpathsi)
|
while (gpathsi)
|
||||||
{
|
{
|
||||||
wxString file(wxConvFileName->cMB2WX((gchar*) gpathsi->data));
|
wxString file((gchar*) gpathsi->data, *wxConvFileName);
|
||||||
paths.Add(file);
|
paths.Add(file);
|
||||||
g_free(gpathsi->data);
|
g_free(gpathsi->data);
|
||||||
gpathsi = gpathsi->next;
|
gpathsi = gpathsi->next;
|
||||||
@@ -382,7 +382,7 @@ void wxFileDialog::SetPath(const wxString& path)
|
|||||||
{
|
{
|
||||||
if (path.empty()) return;
|
if (path.empty()) return;
|
||||||
|
|
||||||
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(path));
|
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(m_widget), path.fn_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxGenericFileDialog::SetPath( path );
|
wxGenericFileDialog::SetPath( path );
|
||||||
@@ -394,7 +394,7 @@ void wxFileDialog::SetDirectory(const wxString& dir)
|
|||||||
{
|
{
|
||||||
if (wxDirExists(dir))
|
if (wxDirExists(dir))
|
||||||
{
|
{
|
||||||
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
|
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), dir.fn_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -406,7 +406,7 @@ wxString wxFileDialog::GetDirectory() const
|
|||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
wxGtkString str(gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(m_widget)));
|
wxGtkString str(gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(m_widget)));
|
||||||
return wxConvFileName->cMB2WX(str);
|
return wxString(str, *wxConvFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxGenericFileDialog::GetDirectory();
|
return wxGenericFileDialog::GetDirectory();
|
||||||
|
@@ -151,7 +151,7 @@ wxString wxHyperlinkCtrl::GetURL() const
|
|||||||
if ( UseNative() )
|
if ( UseNative() )
|
||||||
{
|
{
|
||||||
const gchar *str = gtk_link_button_get_uri(GTK_LINK_BUTTON(m_widget));
|
const gchar *str = gtk_link_button_get_uri(GTK_LINK_BUTTON(m_widget));
|
||||||
return wxConvFileName->cMB2WX(str);
|
return wxString(str, *wxConvFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxGenericHyperlinkCtrl::GetURL();
|
return wxGenericHyperlinkCtrl::GetURL();
|
||||||
|
@@ -55,14 +55,12 @@ static wxString GetGtkHotKey( const wxMenuItem& item );
|
|||||||
|
|
||||||
static wxString wxReplaceUnderscore( const wxString& title )
|
static wxString wxReplaceUnderscore( const wxString& title )
|
||||||
{
|
{
|
||||||
const wxChar *pc;
|
|
||||||
|
|
||||||
// GTK 1.2 wants to have "_" instead of "&" for accelerators
|
// GTK 1.2 wants to have "_" instead of "&" for accelerators
|
||||||
wxString str;
|
wxString str;
|
||||||
pc = title;
|
|
||||||
while (*pc != wxT('\0'))
|
for ( wxString::const_iterator pc = title.begin(); pc != title.end(); ++pc )
|
||||||
{
|
{
|
||||||
if ((*pc == wxT('&')) && (*(pc+1) == wxT('&')))
|
if ((*pc == wxT('&')) && (pc+1 != title.end()) && (*(pc+1) == wxT('&')))
|
||||||
{
|
{
|
||||||
// "&" is doubled to indicate "&" instead of accelerator
|
// "&" is doubled to indicate "&" instead of accelerator
|
||||||
++pc;
|
++pc;
|
||||||
@@ -83,7 +81,6 @@ static wxString wxReplaceUnderscore( const wxString& title )
|
|||||||
|
|
||||||
str << *pc;
|
str << *pc;
|
||||||
}
|
}
|
||||||
++pc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wxPrintf( wxT("before %s after %s\n"), title.c_str(), str.c_str() );
|
// wxPrintf( wxT("before %s after %s\n"), title.c_str(), str.c_str() );
|
||||||
|
@@ -275,7 +275,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
|||||||
radio_button_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON(rbtn) );
|
radio_button_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON(rbtn) );
|
||||||
|
|
||||||
label.Empty();
|
label.Empty();
|
||||||
for ( const wxChar *pc = choices[i]; *pc; pc++ )
|
for ( wxString::const_iterator pc = choices[i].begin();
|
||||||
|
pc != choices[i].end(); ++pc )
|
||||||
{
|
{
|
||||||
if ( *pc != wxT('&') )
|
if ( *pc != wxT('&') )
|
||||||
label += *pc;
|
label += *pc;
|
||||||
|
@@ -1444,7 +1444,7 @@ extern WXDLLIMPEXP_BASE long wxEncodingToCodepage(wxFontEncoding encoding)
|
|||||||
return (long) ret;
|
return (long) ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern long wxCharsetToCodepage(const wxChar *name)
|
extern long wxCharsetToCodepage(const char *name)
|
||||||
{
|
{
|
||||||
// first get the font encoding for this charset
|
// first get the font encoding for this charset
|
||||||
if ( !name )
|
if ( !name )
|
||||||
@@ -1463,7 +1463,7 @@ extern long wxCharsetToCodepage(const wxChar *name)
|
|||||||
#include "wx/msw/registry.h"
|
#include "wx/msw/registry.h"
|
||||||
|
|
||||||
// this should work if Internet Exploiter is installed
|
// this should work if Internet Exploiter is installed
|
||||||
extern long wxCharsetToCodepage(const wxChar *name)
|
extern long wxCharsetToCodepage(const char *name)
|
||||||
{
|
{
|
||||||
if (!name)
|
if (!name)
|
||||||
return GetACP();
|
return GetACP();
|
||||||
|
@@ -394,7 +394,7 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s
|
|||||||
if (image->GetImage().Ok())
|
if (image->GetImage().Ok())
|
||||||
{
|
{
|
||||||
wxString ext(image->GetImageBlock().GetExtension());
|
wxString ext(image->GetImageBlock().GetExtension());
|
||||||
wxString tempFilename(wxString::Format(wxT("image%d.%s"), sm_fileCounter, (const wxChar*) ext));
|
wxString tempFilename(wxString::Format(wxT("image%d.%s"), sm_fileCounter, ext));
|
||||||
wxMemoryFSHandler::AddFile(tempFilename, image->GetImage(), image->GetImageBlock().GetImageType());
|
wxMemoryFSHandler::AddFile(tempFilename, image->GetImage(), image->GetImageBlock().GetImageType());
|
||||||
|
|
||||||
m_imageLocations.Add(tempFilename);
|
m_imageLocations.Add(tempFilename);
|
||||||
@@ -420,7 +420,7 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s
|
|||||||
tempDir = wxFileName::GetTempDir();
|
tempDir = wxFileName::GetTempDir();
|
||||||
|
|
||||||
wxString ext(image->GetImageBlock().GetExtension());
|
wxString ext(image->GetImageBlock().GetExtension());
|
||||||
wxString tempFilename(wxString::Format(wxT("%s/image%d.%s"), (const wxChar*) tempDir, sm_fileCounter, (const wxChar*) ext));
|
wxString tempFilename(wxString::Format(wxT("%s/image%d.%s"), tempDir, sm_fileCounter, ext));
|
||||||
image->GetImageBlock().Write(tempFilename);
|
image->GetImageBlock().Write(tempFilename);
|
||||||
|
|
||||||
m_imageLocations.Add(tempFilename);
|
m_imageLocations.Add(tempFilename);
|
||||||
|
@@ -724,7 +724,7 @@ void wxRichTextStyleOrganiserDialog::OnDeleteClick( wxCommandEvent& WXUNUSED(eve
|
|||||||
{
|
{
|
||||||
wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel);
|
wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel);
|
||||||
wxString name(def->GetName());
|
wxString name(def->GetName());
|
||||||
if (wxYES == wxMessageBox(wxString::Format(_("Delete style %s?"), (const wxChar*) name), _("Delete Style"), wxYES_NO|wxICON_QUESTION, this))
|
if (wxYES == wxMessageBox(wxString::Format(_("Delete style %s?"), name), _("Delete Style"), wxYES_NO|wxICON_QUESTION, this))
|
||||||
{
|
{
|
||||||
m_stylesListBox->GetStyleListBox()->SetItemCount(0);
|
m_stylesListBox->GetStyleListBox()->SetItemCount(0);
|
||||||
|
|
||||||
|
@@ -573,7 +573,7 @@ bool wxRichTextXMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream&
|
|||||||
|
|
||||||
wxString s ;
|
wxString s ;
|
||||||
s.Printf(wxT("<?xml version=\"%s\" encoding=\"%s\"?>\n"),
|
s.Printf(wxT("<?xml version=\"%s\" encoding=\"%s\"?>\n"),
|
||||||
(const wxChar*) version, (const wxChar*) fileEncoding );
|
version, fileEncoding);
|
||||||
OutputString(stream, s, NULL, NULL);
|
OutputString(stream, s, NULL, NULL);
|
||||||
OutputString(stream, wxT("<richtext version=\"1.0.0.0\" xmlns=\"http://www.wxwidgets.org\">") , NULL, NULL);
|
OutputString(stream, wxT("<richtext version=\"1.0.0.0\" xmlns=\"http://www.wxwidgets.org\">") , NULL, NULL);
|
||||||
|
|
||||||
|
@@ -132,7 +132,7 @@ bool wxDirData::Read(wxString *filename)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
de_d_name = wxConvFileName->cMB2WC( de->d_name );
|
de_d_name = wxString(de->d_name, *wxConvFileName);
|
||||||
#else
|
#else
|
||||||
de_d_name = de->d_name;
|
de_d_name = de->d_name;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1367,14 +1367,15 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs,
|
|||||||
|
|
||||||
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
|
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
|
||||||
{
|
{
|
||||||
wxString strExtensions = m_manager->GetExtension(m_index[0]);
|
const wxString strExtensions = m_manager->GetExtension(m_index[0]);
|
||||||
extensions.Empty();
|
extensions.Empty();
|
||||||
|
|
||||||
// one extension in the space or comma-delimited list
|
// one extension in the space or comma-delimited list
|
||||||
wxString strExt;
|
wxString strExt;
|
||||||
for ( const wxChar *p = strExtensions; /* nothing */; p++ )
|
wxString::const_iterator end = strExtensions.end();
|
||||||
|
for ( wxString::const_iterator p = strExtensions.begin(); /* nothing */; ++p )
|
||||||
{
|
{
|
||||||
if ( *p == wxT(' ') || *p == wxT(',') || *p == wxT('\0') )
|
if ( p == end || *p == wxT(' ') || *p == wxT(',') )
|
||||||
{
|
{
|
||||||
if ( !strExt.empty() )
|
if ( !strExt.empty() )
|
||||||
{
|
{
|
||||||
@@ -1384,7 +1385,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
|
|||||||
//else: repeated spaces
|
//else: repeated spaces
|
||||||
// (shouldn't happen, but it's not that important if it does happen)
|
// (shouldn't happen, but it's not that important if it does happen)
|
||||||
|
|
||||||
if ( *p == wxT('\0') )
|
if ( p == end )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ( *p == wxT('.') )
|
else if ( *p == wxT('.') )
|
||||||
@@ -2488,8 +2489,7 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// is this something of the form foo=bar?
|
// is this something of the form foo=bar?
|
||||||
const wxChar *pEq = wxStrchr(curField, wxT('='));
|
if ( curField.find('=') != wxString::npos )
|
||||||
if ( pEq != NULL )
|
|
||||||
{
|
{
|
||||||
// split "LHS = RHS" in 2
|
// split "LHS = RHS" in 2
|
||||||
wxString lhs = curField.BeforeFirst(wxT('=')),
|
wxString lhs = curField.BeforeFirst(wxT('=')),
|
||||||
|
@@ -917,7 +917,8 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
|
|||||||
// get OS version
|
// get OS version
|
||||||
int major, minor;
|
int major, minor;
|
||||||
wxString release = wxGetCommandOutput(wxT("uname -r"));
|
wxString release = wxGetCommandOutput(wxT("uname -r"));
|
||||||
if ( release.empty() || wxSscanf(release, wxT("%d.%d"), &major, &minor) != 2 )
|
if ( release.empty() ||
|
||||||
|
wxSscanf(release.c_str(), wxT("%d.%d"), &major, &minor) != 2 )
|
||||||
{
|
{
|
||||||
// failed to get version string or unrecognized format
|
// failed to get version string or unrecognized format
|
||||||
major =
|
major =
|
||||||
@@ -1051,7 +1052,7 @@ bool wxGetDiskSpace(const wxString& path, wxDiskspaceSize_t *pTotal, wxDiskspace
|
|||||||
bool wxGetEnv(const wxString& var, wxString *value)
|
bool wxGetEnv(const wxString& var, wxString *value)
|
||||||
{
|
{
|
||||||
// wxGetenv is defined as getenv()
|
// wxGetenv is defined as getenv()
|
||||||
wxChar *p = wxGetenv(var);
|
char *p = wxGetenv(var);
|
||||||
if ( !p )
|
if ( !p )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@@ -558,8 +558,7 @@ static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData),
|
|||||||
// We must build conversion table for expat. The easiest way to do so
|
// We must build conversion table for expat. The easiest way to do so
|
||||||
// is to let wxCSConv convert as string containing all characters to
|
// is to let wxCSConv convert as string containing all characters to
|
||||||
// wide character representation:
|
// wide character representation:
|
||||||
wxString str(name, wxConvLibc);
|
wxCSConv conv(name);
|
||||||
wxCSConv conv(str.c_str());
|
|
||||||
char mbBuf[2];
|
char mbBuf[2];
|
||||||
wchar_t wcBuf[10];
|
wchar_t wcBuf[10];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@@ -82,7 +82,7 @@ public:
|
|||||||
|
|
||||||
static size_t GetNumber() { return ms_bars; }
|
static size_t GetNumber() { return ms_bars; }
|
||||||
|
|
||||||
const wxChar *GetName() const { return m_name; }
|
const wxChar *GetName() const { return m_name.c_str(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
|
@@ -639,7 +639,7 @@ void DateTimeTestCase::TestTimeFormat()
|
|||||||
|
|
||||||
// convert back
|
// convert back
|
||||||
wxDateTime dt2;
|
wxDateTime dt2;
|
||||||
const wxChar *result = dt2.ParseFormat(s, fmt);
|
const wxChar *result = dt2.ParseFormat(s.c_str(), fmt);
|
||||||
if ( !result )
|
if ( !result )
|
||||||
{
|
{
|
||||||
// converion failed - should it have?
|
// converion failed - should it have?
|
||||||
|
@@ -286,7 +286,7 @@ void FormatConverterTestCase::doTest(const wxChar *input,
|
|||||||
void FormatConverterTestCase::check(const wxString& input,
|
void FormatConverterTestCase::check(const wxString& input,
|
||||||
const wxString& expected)
|
const wxString& expected)
|
||||||
{
|
{
|
||||||
wxString result = wxConvertFormat(input);
|
wxString result = wxConvertFormat(input.wc_str());
|
||||||
wxString msg = _T("input: '") + input +
|
wxString msg = _T("input: '") + input +
|
||||||
_T("', result: '") + result +
|
_T("', result: '") + result +
|
||||||
_T("', expected: '") + expected + _T("'");
|
_T("', expected: '") + expected + _T("'");
|
||||||
|
@@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
static size_t GetNumber() { return ms_bars; }
|
static size_t GetNumber() { return ms_bars; }
|
||||||
|
|
||||||
const wxChar *GetName() const { return m_name; }
|
const wxChar *GetName() const { return m_name.c_str(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
|
@@ -120,7 +120,7 @@ private:
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ private:
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ private:
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
);
|
);
|
||||||
|
|
||||||
// use wxTextOutputStream to exercise wxMBConv interface
|
// use wxTextOutputStream to exercise wxMBConv interface
|
||||||
@@ -152,7 +152,7 @@ private:
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ private:
|
|||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
const char* utf8Buffer, // the same character sequence as multiBuffer, encoded as UTF-8
|
const char* utf8Buffer, // the same character sequence as multiBuffer, encoded as UTF-8
|
||||||
size_t utf8Bytes, // the byte length of the UTF-8 encoded character sequence
|
size_t utf8Bytes, // the byte length of the UTF-8 encoded character sequence
|
||||||
wxMBConv* converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
int sizeofNull // the number of bytes occupied by a terminating null in the converter's encoding
|
int sizeofNull // the number of bytes occupied by a terminating null in the converter's encoding
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ void MBConvTestCase::UTF7Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf7_iconv,
|
(const char*)welcome_utf7_iconv,
|
||||||
sizeof(welcome_utf7_iconv),
|
sizeof(welcome_utf7_iconv),
|
||||||
&wxConvUTF7,
|
wxConvUTF7,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
TestDecoder
|
TestDecoder
|
||||||
@@ -402,7 +402,7 @@ void MBConvTestCase::UTF7Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf7_wx,
|
(const char*)welcome_utf7_wx,
|
||||||
sizeof(welcome_utf7_wx),
|
sizeof(welcome_utf7_wx),
|
||||||
&wxConvUTF7,
|
wxConvUTF7,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
#if 0
|
#if 0
|
||||||
@@ -415,7 +415,7 @@ void MBConvTestCase::UTF7Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf7_iconv,
|
(const char*)welcome_utf7_iconv,
|
||||||
sizeof(welcome_utf7_iconv),
|
sizeof(welcome_utf7_iconv),
|
||||||
&wxConvUTF7,
|
wxConvUTF7,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
@@ -425,7 +425,7 @@ void MBConvTestCase::UTF7Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf7_wx,
|
(const char*)welcome_utf7_wx,
|
||||||
sizeof(welcome_utf7_wx),
|
sizeof(welcome_utf7_wx),
|
||||||
&wxConvUTF7,
|
wxConvUTF7,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,7 @@ void MBConvTestCase::UTF8Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf8,
|
(const char*)welcome_utf8,
|
||||||
sizeof(welcome_utf8),
|
sizeof(welcome_utf8),
|
||||||
&wxConvUTF8,
|
wxConvUTF8,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
TestEncoder
|
TestEncoder
|
||||||
@@ -447,7 +447,7 @@ void MBConvTestCase::UTF8Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf8,
|
(const char*)welcome_utf8,
|
||||||
sizeof(welcome_utf8),
|
sizeof(welcome_utf8),
|
||||||
&wxConvUTF8,
|
wxConvUTF8,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -461,7 +461,7 @@ void MBConvTestCase::UTF16LETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf16le,
|
(const char*)welcome_utf16le,
|
||||||
sizeof(welcome_utf16le),
|
sizeof(welcome_utf16le),
|
||||||
&convUTF16LE,
|
convUTF16LE,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
TestEncoder
|
TestEncoder
|
||||||
@@ -470,7 +470,7 @@ void MBConvTestCase::UTF16LETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf16le,
|
(const char*)welcome_utf16le,
|
||||||
sizeof(welcome_utf16le),
|
sizeof(welcome_utf16le),
|
||||||
&convUTF16LE,
|
convUTF16LE,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -484,7 +484,7 @@ void MBConvTestCase::UTF16BETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf16be,
|
(const char*)welcome_utf16be,
|
||||||
sizeof(welcome_utf16be),
|
sizeof(welcome_utf16be),
|
||||||
&convUTF16BE,
|
convUTF16BE,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
TestEncoder
|
TestEncoder
|
||||||
@@ -493,7 +493,7 @@ void MBConvTestCase::UTF16BETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf16be,
|
(const char*)welcome_utf16be,
|
||||||
sizeof(welcome_utf16be),
|
sizeof(welcome_utf16be),
|
||||||
&convUTF16BE,
|
convUTF16BE,
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -507,7 +507,7 @@ void MBConvTestCase::UTF32LETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf32le,
|
(const char*)welcome_utf32le,
|
||||||
sizeof(welcome_utf32le),
|
sizeof(welcome_utf32le),
|
||||||
&convUTF32LE,
|
convUTF32LE,
|
||||||
4
|
4
|
||||||
);
|
);
|
||||||
TestEncoder
|
TestEncoder
|
||||||
@@ -516,7 +516,7 @@ void MBConvTestCase::UTF32LETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf32le,
|
(const char*)welcome_utf32le,
|
||||||
sizeof(welcome_utf32le),
|
sizeof(welcome_utf32le),
|
||||||
&convUTF32LE,
|
convUTF32LE,
|
||||||
4
|
4
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -530,7 +530,7 @@ void MBConvTestCase::UTF32BETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf32be,
|
(const char*)welcome_utf32be,
|
||||||
sizeof(welcome_utf32be),
|
sizeof(welcome_utf32be),
|
||||||
&convUTF32BE,
|
convUTF32BE,
|
||||||
4
|
4
|
||||||
);
|
);
|
||||||
TestEncoder
|
TestEncoder
|
||||||
@@ -539,7 +539,7 @@ void MBConvTestCase::UTF32BETests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_utf32be,
|
(const char*)welcome_utf32be,
|
||||||
sizeof(welcome_utf32be),
|
sizeof(welcome_utf32be),
|
||||||
&convUTF32BE,
|
convUTF32BE,
|
||||||
4
|
4
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -553,7 +553,7 @@ void MBConvTestCase::CP932Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_cp932,
|
(const char*)welcome_cp932,
|
||||||
sizeof(welcome_cp932),
|
sizeof(welcome_cp932),
|
||||||
&convCP932,
|
convCP932,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
TestEncoder
|
TestEncoder
|
||||||
@@ -562,7 +562,7 @@ void MBConvTestCase::CP932Tests()
|
|||||||
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
sizeof(welcome_wchar_t)/sizeof(wchar_t),
|
||||||
(const char*)welcome_cp932,
|
(const char*)welcome_cp932,
|
||||||
sizeof(welcome_cp932),
|
sizeof(welcome_cp932),
|
||||||
&convCP932,
|
convCP932,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -743,7 +743,7 @@ void MBConvTestCase::TestCoder(
|
|||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
const char* utf8Buffer, // the same character sequence as multiBuffer, encoded as UTF-8
|
const char* utf8Buffer, // the same character sequence as multiBuffer, encoded as UTF-8
|
||||||
size_t utf8Bytes, // the byte length of the UTF-8 encoded character sequence
|
size_t utf8Bytes, // the byte length of the UTF-8 encoded character sequence
|
||||||
wxMBConv* converter, // the wxMBConv object thta can decode multiBuffer into a wide character sequence
|
wxMBConv& converter, // the wxMBConv object thta can decode multiBuffer into a wide character sequence
|
||||||
int sizeofNull // the number of bytes occupied by a terminating null in the converter's encoding
|
int sizeofNull // the number of bytes occupied by a terminating null in the converter's encoding
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -777,12 +777,12 @@ void MBConvTestCase::TestCoder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_wxwin( const wxChar* name );
|
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_wxwin( const char* name );
|
||||||
|
|
||||||
void MBConvTestCase::FontmapTests()
|
void MBConvTestCase::FontmapTests()
|
||||||
{
|
{
|
||||||
#ifdef wxUSE_FONTMAP
|
#ifdef wxUSE_FONTMAP
|
||||||
wxMBConv* converter = new_wxMBConv_wxwin( _T("CP1252") );
|
wxMBConv* converter = new_wxMBConv_wxwin("CP1252");
|
||||||
if ( !converter )
|
if ( !converter )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -792,7 +792,7 @@ void MBConvTestCase::FontmapTests()
|
|||||||
sizeof(CP1252),
|
sizeof(CP1252),
|
||||||
(const char*)CP1252_utf8,
|
(const char*)CP1252_utf8,
|
||||||
sizeof(CP1252_utf8),
|
sizeof(CP1252_utf8),
|
||||||
converter,
|
*converter,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
delete converter;
|
delete converter;
|
||||||
@@ -800,12 +800,12 @@ void MBConvTestCase::FontmapTests()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_iconv( const wxChar* name );
|
WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_iconv( const char* name );
|
||||||
|
|
||||||
void MBConvTestCase::IconvTests()
|
void MBConvTestCase::IconvTests()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ICONV
|
#ifdef HAVE_ICONV
|
||||||
wxMBConv* converter = new_wxMBConv_iconv( _T("CP932") );
|
wxMBConv* converter = new_wxMBConv_iconv("CP932");
|
||||||
if ( !converter )
|
if ( !converter )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -815,7 +815,7 @@ void MBConvTestCase::IconvTests()
|
|||||||
sizeof(welcome_cp932),
|
sizeof(welcome_cp932),
|
||||||
(const char*)welcome_utf8,
|
(const char*)welcome_utf8,
|
||||||
sizeof(welcome_utf8),
|
sizeof(welcome_utf8),
|
||||||
converter,
|
*converter,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
delete converter;
|
delete converter;
|
||||||
@@ -830,7 +830,7 @@ void MBConvTestCase::CP1252Tests()
|
|||||||
sizeof(CP1252),
|
sizeof(CP1252),
|
||||||
(const char*)CP1252_utf8,
|
(const char*)CP1252_utf8,
|
||||||
sizeof(CP1252_utf8),
|
sizeof(CP1252_utf8),
|
||||||
&convCP1252,
|
convCP1252,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -874,7 +874,7 @@ void MBConvTestCase::TestDecoder(
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -886,7 +886,7 @@ void MBConvTestCase::TestDecoder(
|
|||||||
memset( &inputCopy.data()[multiBytes], 0, sizeofNull );
|
memset( &inputCopy.data()[multiBytes], 0, sizeofNull );
|
||||||
|
|
||||||
// calculate the output size
|
// calculate the output size
|
||||||
size_t outputWritten = converter->MB2WC
|
size_t outputWritten = converter.MB2WC
|
||||||
(
|
(
|
||||||
0,
|
0,
|
||||||
(const char*)inputCopy.data(),
|
(const char*)inputCopy.data(),
|
||||||
@@ -902,7 +902,7 @@ void MBConvTestCase::TestDecoder(
|
|||||||
wxWCharBuffer outputBuffer(outputBufferChars);
|
wxWCharBuffer outputBuffer(outputBufferChars);
|
||||||
memset( outputBuffer.data(), UNINITIALIZED, outputBufferChars*sizeof(wchar_t) );
|
memset( outputBuffer.data(), UNINITIALIZED, outputBufferChars*sizeof(wchar_t) );
|
||||||
|
|
||||||
outputWritten = converter->MB2WC
|
outputWritten = converter.MB2WC
|
||||||
(
|
(
|
||||||
outputBuffer.data(),
|
outputBuffer.data(),
|
||||||
(const char*)inputCopy.data(),
|
(const char*)inputCopy.data(),
|
||||||
@@ -934,7 +934,7 @@ void MBConvTestCase::TestEncoder(
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter, // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
int sizeofNull // number of bytes occupied by terminating null in this encoding
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -946,7 +946,7 @@ void MBConvTestCase::TestEncoder(
|
|||||||
inputCopy.data()[wideChars] = 0;
|
inputCopy.data()[wideChars] = 0;
|
||||||
|
|
||||||
// calculate the output size
|
// calculate the output size
|
||||||
size_t outputWritten = converter->WC2MB
|
size_t outputWritten = converter.WC2MB
|
||||||
(
|
(
|
||||||
0,
|
0,
|
||||||
(const wchar_t*)inputCopy.data(),
|
(const wchar_t*)inputCopy.data(),
|
||||||
@@ -961,7 +961,7 @@ void MBConvTestCase::TestEncoder(
|
|||||||
wxCharBuffer outputBuffer(outputBufferSize);
|
wxCharBuffer outputBuffer(outputBufferSize);
|
||||||
memset( outputBuffer.data(), UNINITIALIZED, outputBufferSize );
|
memset( outputBuffer.data(), UNINITIALIZED, outputBufferSize );
|
||||||
|
|
||||||
outputWritten = converter->WC2MB
|
outputWritten = converter.WC2MB
|
||||||
(
|
(
|
||||||
outputBuffer.data(),
|
outputBuffer.data(),
|
||||||
(const wchar_t*)inputCopy.data(),
|
(const wchar_t*)inputCopy.data(),
|
||||||
@@ -1001,14 +1001,14 @@ void MBConvTestCase::TestStreamDecoder(
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// this isn't meant to test wxMemoryInputStream or wxTextInputStream
|
// this isn't meant to test wxMemoryInputStream or wxTextInputStream
|
||||||
// it's meant to test the way wxTextInputStream uses wxMBConv
|
// it's meant to test the way wxTextInputStream uses wxMBConv
|
||||||
// (which has exposed some problems with wxMBConv)
|
// (which has exposed some problems with wxMBConv)
|
||||||
wxMemoryInputStream memoryInputStream( multiBuffer, multiBytes );
|
wxMemoryInputStream memoryInputStream( multiBuffer, multiBytes );
|
||||||
wxTextInputStream textInputStream( memoryInputStream, wxT(""), *converter );
|
wxTextInputStream textInputStream( memoryInputStream, wxT(""), converter );
|
||||||
for ( size_t i = 0; i < wideChars; i++ )
|
for ( size_t i = 0; i < wideChars; i++ )
|
||||||
{
|
{
|
||||||
wxChar wc = textInputStream.GetChar();
|
wxChar wc = textInputStream.GetChar();
|
||||||
@@ -1027,7 +1027,7 @@ void MBConvTestCase::TestStreamEncoder(
|
|||||||
size_t wideChars, // the number of wide characters at wideBuffer
|
size_t wideChars, // the number of wide characters at wideBuffer
|
||||||
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
const char* multiBuffer, // a multibyte encoded character sequence that can be decoded by "converter"
|
||||||
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
size_t multiBytes, // the byte length of the multibyte character sequence that can be decoded by "converter"
|
||||||
wxMBConv* converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
wxMBConv& converter // the wxMBConv object that can decode multiBuffer into a wide character sequence
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// this isn't meant to test wxMemoryOutputStream or wxTextOutputStream
|
// this isn't meant to test wxMemoryOutputStream or wxTextOutputStream
|
||||||
@@ -1035,7 +1035,7 @@ void MBConvTestCase::TestStreamEncoder(
|
|||||||
// (which has exposed some problems with wxMBConv)
|
// (which has exposed some problems with wxMBConv)
|
||||||
wxMemoryOutputStream memoryOutputStream;
|
wxMemoryOutputStream memoryOutputStream;
|
||||||
// wxEOL_UNIX will pass \n \r unchanged
|
// wxEOL_UNIX will pass \n \r unchanged
|
||||||
wxTextOutputStream textOutputStream( memoryOutputStream, wxEOL_UNIX, *converter );
|
wxTextOutputStream textOutputStream( memoryOutputStream, wxEOL_UNIX, converter );
|
||||||
for ( size_t i = 0; i < wideChars; i++ )
|
for ( size_t i = 0; i < wideChars; i++ )
|
||||||
{
|
{
|
||||||
textOutputStream.PutChar( wideBuffer[i] );
|
textOutputStream.PutChar( wideBuffer[i] );
|
||||||
|
@@ -178,8 +178,9 @@ wxString RegExTestCase::Conv(const char *str)
|
|||||||
//
|
//
|
||||||
void RegExTestCase::parseFlags(const wxString& flags)
|
void RegExTestCase::parseFlags(const wxString& flags)
|
||||||
{
|
{
|
||||||
for (const wxChar *p = flags; *p; p++) {
|
for ( wxString::const_iterator p = flags.begin(); p != flags.end(); ++p )
|
||||||
switch (*p) {
|
{
|
||||||
|
switch ( (*p).GetValue() ) {
|
||||||
// noop
|
// noop
|
||||||
case '-': break;
|
case '-': break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user