Difference between revisions of "TLTools"
m |
(Noted a potential problem) |
||
Line 5: | Line 5: | ||
==TLibCompress== | ==TLibCompress== | ||
− | Can zip and unzip strings, reducing their size. A good way to save bandwidth when sending strings across a network. | + | Can zip and unzip strings, reducing their size. A good way to save bandwidth when sending strings across a network. Please note: Do not write compressed strings to a file, since they can't be read correctly by Love 0.7.0 due to a file-reading bug. |
* ''TLibCompress.CompressLZW(string)'' returns a zipped string | * ''TLibCompress.CompressLZW(string)'' returns a zipped string | ||
* ''TLibCompress.UncompressLZW(string)'' returns an unzipped version of a zipped string | * ''TLibCompress.UncompressLZW(string)'' returns an unzipped version of a zipped string | ||
Line 12: | Line 12: | ||
[http://github.com/Taehl/TLTools TLTools] on [[Github]] | [http://github.com/Taehl/TLTools TLTools] on [[Github]] | ||
{{#set:LOVE Version=Any}} | {{#set:LOVE Version=Any}} | ||
− | {{#set:Description=[[Serialization]] and [[Compression]] | + | {{#set:Description=[[Serialization]] and [[Compression]] tools written in pure Lua}} |
{{#set:License=LGPLv2.1}} | {{#set:License=LGPLv2.1}} | ||
{{#set:Author=User:Taehl}} | {{#set:Author=User:Taehl}} | ||
[[Category:Libraries]] | [[Category:Libraries]] |
Revision as of 02:37, 14 January 2011
TSerial
Converts tables into strings. That way you can save tables to files, or send them across a network. Currently only supports tables with keys that are strings or numbers, and values that are strings, numbers, tables, or booleans.
- TSerialize(table) returns a string of the Lua code which will recreate the table.
- To deserialize, use loadstring("table="..serial)().
TLibCompress
Can zip and unzip strings, reducing their size. A good way to save bandwidth when sending strings across a network. Please note: Do not write compressed strings to a file, since they can't be read correctly by Love 0.7.0 due to a file-reading bug.
- TLibCompress.CompressLZW(string) returns a zipped string
- TLibCompress.UncompressLZW(string) returns an unzipped version of a zipped string