summaryrefslogtreecommitdiffstats
path: root/squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-08 23:01:08 +0200
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-08 23:01:08 +0200
commit083228a10dffcaa77b1d0035c29013c6802befd4 (patch)
tree4d8ba1ce8501f044d10135e836e6f956f1b99fa4 /squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp
parentAdded a lilypad finisher (diff)
downloadcuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.gz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.bz2
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.lz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.xz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.zst
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.zip
Diffstat (limited to 'squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp')
-rw-r--r--squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp b/squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp
deleted file mode 100644
index 4a0bd2a9b..000000000
--- a/squirrel_3_0_1_stable/sqplus/SqPlusOCharBuf.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-
-#include "sqplus.h"
-#include "SqPlusOCharBuf.h"
-
-#include <wchar.h>
-
-// Conversion functions, between char* string and wchar_t* strings.
-
-int ol_strlen(const wchar_t* pwc){ return (int)wcslen(pwc); }
-int ol_buflen(const wchar_t* pwc){ return (int)wcslen(pwc); }
-int ol_charlen(const wchar_t* pwc){ return 1; }
-//int ol_charlen(const wchar_t pwc){ return 1; }
-int ol_char(const wchar_t* pwc){ return (int)*pwc; }
-bool ol_writechar(wchar_t*& pwc, int ch){ *pwc=(wchar_t)ch; pwc++; return true; }
-
-int ol_buflen(const char* pc){ return (int)strlen(pc); }
-
-#if SQPLUS_USE_LATIN1==1
- // Convert to 8-bit LATIN1 char set. The only thing to do is convert chars out of range to '?'
- int ol_strlen(const char* pc){ return (int)strlen(pc); }
- int ol_charlen(const char* pc){ return 1; }
- //int ol_charlen(int pc){ return 1; }
- int ol_char(const char* pc){ return (int)*(unsigned char*)pc; }
- bool ol_writechar(char*& pc, int ch){ *pc=(char)(ch>255?'?':ch); pc++; return true; }
-#else
- #include "SqPlusUtf8.h"
- // Convert to 8-Bit UTF8 encoding. Some more work here.
- int ol_strlen(const char* pc){ return sqplus_utf8_strlen(pc); }
- int ol_charlen(const char* pc){ return sqplus_utf8_len_first(pc); }
- //int ol_charlen(int ch){ char buf[8]; return sqplus_wchar_to_utf8(buf,ch,8); }
- int ol_char(const char* pc){ int chr=-1; sqplus_utf8_to_wchar(&chr,pc); return chr; }
- bool ol_writechar(char*& pc, int ch) {
- int l=sqplus_wchar_to_utf8(pc,ch,8);
- if(l>0){
- pc += l;
- return true;
- }
- else return false;
- }
-#endif
-
-
-#ifdef SQUNICODE
- // SQChar is wchar_t, convert to/from to either Latin1 or UTF8
- SQDefCharBuf CH2SQ( const char* ps ){
- return SQDefCharBuf(ps);
- }
- SQOthCharBuf SQ2CH( const wchar_t* pws ){
- return SQOthCharBuf(pws);
- }
-#else
- // SQChar is char, convert to/from wchar_t
- SQDefCharBuf WC2SQ( const wchar_t* pws ){
- return SQDefCharBuf(pws);
- }
- SQOthCharBuf SQ2WC( const char* ps ){
- return SQOthCharBuf(ps);
- }
-#endif
-
-