Commit graph

70 commits

Author SHA1 Message Date
Kevin Eady
7ad3db992e
move checking of utf-8 chars to both platforms 2020-01-18 00:28:20 +01:00
Kevin Eady
6fe3b2111d windows: add utf8 checks to lower/upper 2020-01-17 20:15:34 +01:00
turleypol
d004f9d2a6 fixed uncaught exeption (which only a static analyser finds and likely never occurs) 2020-01-09 21:43:43 +01:00
turleypol
b450c4a782 optimized a few more things in string class 2019-09-07 15:27:56 +02:00
turleypol
04437fbcd7 optimized windows version of upper/lower a bit 2019-09-07 14:26:39 +02:00
turleypol
6a62981c85 changed getBytePosition param to pointer to clarify usage and
sideeffects.
ConstString no more assumes tainted source, tus file loading now also
sanitizes data.
Removed duplicate usage of isValidUnicode, sanitize methods also test
it.
2019-09-02 21:37:45 +02:00
turleypol
8b085e86ef dont assume a tainted string by default
cfgfiles (which includes savefiles, datafiles) get sanizized on read,
filemod::readfile, xml module, sql handled
old ascii speech packets handled
2019-01-12 17:14:05 +01:00
turleypol
04066c309d moved unicode sanitize functions to clib as a preparation to sanitize
only once
renamed mklower/mkupper to make it clear that it should only be used
for pure ascii texts
compiler triggers only once a warning about invalid unicode file
2019-01-12 11:46:30 +01:00
turleypol
8c7ed986a9 CAsc(Z)/CChr(Z) use utf16, if CChr() cannot represent it with a single
number return an error.
Fixed problem with RequestInput using the unicode version
Updated em file comments
2019-01-04 13:18:53 +01:00
turleypol
f4ae345155 If a unicode string is detected as param sysmsg etc module functions
automatically use the unicode replacement
2019-01-03 22:14:10 +01:00
turleypol
3257cda6ab cleanup of cliloc unicode functions 2019-01-03 17:21:55 +01:00
turleypol
cc27bb611f removed last usage of convertUCtoArray 2019-01-03 11:00:46 +01:00
turleypol
ae56e5063e fixed more warnings 2019-01-03 00:27:01 +01:00
turleypol
55538a2fae added utf8 read method, seems OSI couldnt decide which format they
use...
2019-01-02 13:36:59 +01:00
turleypol
f01f9cf72b convert from utf16 directly handles endianess 2019-01-01 17:33:09 +01:00
turleypol
a6c7a471a1 simplified string api, converted requestinputuc return packet 2019-01-01 15:47:27 +01:00
turleypol
ab89708107 completly converted all uses of convertArrayToUC, so all
functions/methods now accept arrays and strings
2018-12-31 16:25:34 +01:00
turleypol
366f7e7122 Merge remote-tracking branch 'upstream/master'
* upstream/master: (45 commits)
  renamed mobile syshook to character used unique_ptr for all syshooks
  added docs
  code simplification, deprecate warning for uoclient.cfg MethodScript entry
  party and guild ref support docs and testing left?
  custom methods for client and account references
  fixed line length
  syshooks for npc/mobiles
  first round for scripted object class methods
  Fixed formatting error.
  Added new return option to consume ammunition hook which allows the hook to make the core continue with the usual ammunition checks.
  Fix critical bug in FindObjtypeInContainer()
  fixed compiler warning
  fixed linesize
  windows fixes
  Added cmake option to run clang-tidy used everywhere nullptr
  Changed classes to be final if possible, removed override macro
  Added additional documentation.
  next..
  clang 7 is currently untrusted... next try 6 ;)
  fixed new clang warnings, new compiler version on travis (lets see how many commits are needed till it works)
  ...

Conflicts:
	.travis.yml
	pol-core/bscript/impstr.h
	pol-core/clib/cfgfile.cpp
	pol-core/pol/module/npcmod.cpp
2018-10-14 14:00:33 +02:00
turleypol
a5e6206164 Added cmake option to run clang-tidy
used everywhere nullptr
2018-10-09 16:36:35 +02:00
turleypol
ee10d76ec4 started with unimod 2018-06-25 19:31:01 +02:00
turleypol
72889beabf part II 2018-06-25 19:31:00 +02:00
turleypol
ecbe6ab4b9 silence I kill you 2018-06-25 19:31:00 +02:00
turleypol
e22f037979 invalid utf8 will be assumed to be iso8859 (with the hope that this is
correct in most of the cases)
2018-06-25 19:31:00 +02:00
turleypol
2ea0a7bb55 runecl no more tries to log to pol files
sanitize strings on construction (if external)
use faster unsafe utf methods
2018-06-25 19:31:00 +02:00
turleypol
ad695899dd optimized memoryallocations if resulting string after conversion has
the same size.
2018-06-25 19:31:00 +02:00
turleypol
940693bde1 no extra null terminator for windows case convertion 2018-06-25 19:31:00 +02:00
turleypol
f668e4876d try to fix windows upper/lower case conversion 2018-06-25 19:31:00 +02:00
turleypol
6e50fcd7a2 sanitize strings during compilation
shameless copy of bodoms unicode test plus a few additions/modifications
2018-06-25 19:31:00 +02:00
turleypol
a064901a4f use template deduction for different wchar_t sizes 2018-06-25 19:31:00 +02:00
turleypol
c50188b142 fixed a few more functions, cleanup 2018-06-25 19:31:00 +02:00
turleypol
a3cf0e8fef fix windows build 2018-06-25 19:31:00 +02:00
turleypol
431411f9bc lower/uppercase in unicode 2018-06-25 19:31:00 +02:00
turleypol
84afea1bc1 unicode: find and compare 2018-06-25 19:31:00 +02:00
turleypol
890f803a20 removed some unused methods 2018-06-25 19:31:00 +02:00
turleypol
bc78a3a349 fixed strreplace, substr
made some constructors private
2018-06-25 19:30:59 +02:00
turleypol
f3d92ad172 more utf8 support 2018-06-25 19:30:59 +02:00
turleypol
af5d3f38d7 utf8 work in progress 2018-06-25 19:30:59 +02:00
turleypol
239295f236 added options to enable clang/gcc sanitizer
fixed a few errors in runecl/ecompile code
2018-04-26 10:42:19 +02:00
turleypol
dbb25bdb62
Include and buildsystem cleanup (#45)
Include cleanup
Reworked buildsystem (Linux only)
Removed dynamic libs, Linux now again uses static linking (like windows)
2018-01-29 21:55:48 +01:00
turleypol
ef2108c9f7 New objecttype Boolean.
create via basic::Boolean(1/0)
only == != ! operators are implemented.
2018-01-05 20:04:01 +01:00
turley
65231f9bfd use faster overload for string find with single characters 2016-12-15 13:34:06 +01:00
turley
feb77cb02c restoring stream format state 2016-12-09 20:21:42 +01:00
turley
189cad3479 Formating everything
Authors are not forced to use the clang-format setting, but should
atleast be inspired by the style.
The only thing which is now not allowed are tabs for ident/alignment!
2016-02-19 19:26:35 +01:00
turley
ed7b16b233 normalized lineendings 2016-02-11 22:54:43 +01:00
Gabriele Tozzi
fd24da5cd1 Documentation: reformatting some comment blocks 2016-01-25 01:17:56 +01:00
Gabriele Tozzi
530790c8f8 Comparison operators refactor: better handle weird cases, cleaning
- obj.isLesserThan() and obj.ieEqual() are now replaced by < and ==
- Removed obsolete isLT(), isLE(), isGT(), isGE()
- Also implemented comparison operators for BObjectImp
- These operators may now be fully overriden in child classes
- Default implementations are derived from == and < operators
- As a general rule (that fit into "undefined" behavior":
-- Objects are == if having the same address
-- Objects are < based on their type ID, except of Error and Uninit
   that always are < everything else.
-- Objects are supposed to implement their own < and fall back to
   base class. If not implemented, as a last fallback, the object's
   address in memory is used to do the comparison
- Added test case for comparison operators
2016-01-24 22:22:45 +01:00
Gabriele Tozzi
e63f2b7969 Merge branch 'stable' 2015-12-26 13:59:37 +01:00
Gabriele Tozzi
68623f34e6 Fixed: Bug in String.format()
String tags were not correctly processed.
"{name} you hit level {level}".format(struct{name:="Jane Doe", level:=4})
now correctly formats as "Jane Doe you hit level 4" instead of
"Jane Doe you hit level <invalid index: #2>"
2015-12-26 13:55:57 +01:00
Thomas Volkert
f32001a63d Avoid compiler warnings 2015-11-01 01:04:29 +01:00
turley
c755d44e75 Added: array.cycle([count])
will move array backwards or forwards in-place as it were a conveyor belt.
{1, 2, 3}.cycle()
Will make it:
{3, 1, 2}
Accepts a negative value as a shift to move different direction
Changed: string.format()
Now actually faster than string concatenation in eScript
Fixes a bug where {:d} formating could cause an arbitrary number shown instead of a real value
tag errors are slightly more intuitive and compact.
Note: Patches submitted by andenixa
2015-07-27 19:17:49 +02:00