#include <wx/filename.h>#include <wx/utils.h>#include <wx/datetime.h>#include <math.h>#include "vrmlwriter.h"Go to the source code of this file.
Defines | |
| #define | CTL_CHARS 31 |
| #define | SINGLE_QUOTE 39 |
Functions | |
| static char * | VRMLName (const char *name) |
| static char * | VRMLName (const wxString &string) |
| #define CTL_CHARS 31 |
Definition at line 22 of file vrmlwriter.cpp.
| #define SINGLE_QUOTE 39 |
Definition at line 23 of file vrmlwriter.cpp.
| static char* VRMLName | ( | const wxString & | string | ) | [static] |
Definition at line 57 of file vrmlwriter.cpp.
00058 { 00059 return VRMLName((const char*)string.mb_str(wxConvUTF8)); 00060 }
| static char* VRMLName | ( | const char * | name | ) | [static] |
Definition at line 25 of file vrmlwriter.cpp.
00026 { 00027 static char buffer[256]; 00028 int seqnum = 0; 00029 char* cPtr; 00030 int firstCharacter = 1; 00031 00032 strncpy(buffer, name, 256); 00033 cPtr = buffer; 00034 while(*cPtr) { 00035 if( *cPtr <= CTL_CHARS || 00036 *cPtr == ' ' || 00037 *cPtr == SINGLE_QUOTE || 00038 *cPtr == '"' || 00039 *cPtr == '\\' || 00040 *cPtr == '{' || 00041 *cPtr == '}' || 00042 *cPtr == ',' || 00043 *cPtr == '.' || 00044 *cPtr == '[' || 00045 *cPtr == ']' || 00046 *cPtr == '-' || 00047 *cPtr == '#' || 00048 *cPtr >= 127 || 00049 (firstCharacter && (*cPtr >= '0' && *cPtr <= '9'))) *cPtr = '_'; 00050 firstCharacter = 0; 00051 cPtr++; 00052 } 00053 00054 return buffer; 00055 }
1.5.5