Files
wxWidgets/utils/HelpGen/src/wx_extra_imps.cpp
Vadim Zeitlin 59734eb597 1. Parser improvements
a) const and virtual methods are parsed correctly (not static yet)
 b) "const" which is part of the return type is not swallowed

2. HelpGen improvements: -o outputdir parameter added to the cmd line,
   "//---------" kind comments discarded now.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1999-02-15 23:07:37 +00:00

81 lines
1.8 KiB
C++

////////////////////
//
// craeted by Alex
//
////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include <memory.h>
#ifndef WX_PRECOMP
#include "wx/defs.h"
#endif
char *
copystring (const char *s)
{
if (s == NULL) s = "";
size_t len = strlen (s) + 1;
char *news = new char[len];
memcpy (news, s, len); // Should be the fastest
return news;
}
#ifdef __WXMSW__
// from filefn.cpp
void WXDLLEXPORT wxSplitPath(const char *pszFileName,
wxString *pstrPath,
wxString *pstrName,
wxString *pstrExt)
{
wxCHECK_RET( pszFileName, _("NULL file name in wxSplitPath") );
const char *pDot = strrchr(pszFileName, wxFILE_SEP_EXT);
const char *pSepUnix = strrchr(pszFileName, wxFILE_SEP_PATH_UNIX);
const char *pSepDos = strrchr(pszFileName, wxFILE_SEP_PATH_DOS);
// take the last of the two
size_t nPosUnix = pSepUnix ? pSepUnix - pszFileName : 0;
size_t nPosDos = pSepDos ? pSepDos - pszFileName : 0;
if ( nPosDos > nPosUnix )
nPosUnix = nPosDos;
// size_t nLen = Strlen(pszFileName);
if ( pstrPath )
*pstrPath = wxString(pszFileName, nPosUnix);
if ( pDot ) {
size_t nPosDot = pDot - pszFileName;
if ( pstrName )
*pstrName = wxString(pszFileName + nPosUnix + 1, nPosDot - nPosUnix);
if ( pstrExt )
*pstrExt = wxString(pszFileName + nPosDot + 1);
}
else {
if ( pstrName )
*pstrName = wxString(pszFileName + nPosUnix + 1);
if ( pstrExt )
pstrExt->Empty();
}
}
wxLocale *wxGetLocale()
{
return NULL;
}
const char *wxLocale::GetString(const char *szOrigString,
const char *) const
{
return szOrigString;
}
#else // !MSW
const char *wxGetTranslation(const char *str)
{
return str;
}
#endif // MSW