 |
Download latest version
here
Version 1.59 - 14 May 2012
- Tweaked code so it'll compile under Clarion 5.5 (AppendA
instead of Append internally.)
Version 1.58 - 25 April 2012
- Changed Z_ equates so as not to clash with equates
defined in Draw.
Version 1.57 - 17 April 2012
-
Added Gzip and
Gunzip methods.
Requires the ZLIBWAPI.DLL (you will need to
distribute this DLL with your application).
-
New parameter added to
Split method,
to allow for lines to be clipped before adding them to the
Lines Queue.
Version 1.56 - 20 February 2012
- Added:
SplitEvery method, which splits the string into
substrings based on the passed length and stores each
substring in the lines property.
Version 1.55 - 15 February 2012
- Added new method -
CleanfileName.
- Changed
Append method so pClip parameter is overloaded. Now has
the ability to suppress the Separator if the NewValue is
blank.
Version 1.54 - 12 January 2012
- Added optional pSep parameter to
Append
method.
- Added optional parameters pClip and pSep to
Prepend
method.
- Added optional parameter pWholeWord to
Instring
method.
Version 1.53 - 4 January 2012
Version 1.52 - 22 November 2011
- Fixed: The
Random
function not correctly supporting the st:AlphaFirst flag for
strings longer than a single character.
- The
WordStart,
WordEnd
and
Squeeze methods now support a Type parameter
that allows the type of text (and hence the manner in which
the methods operate) to be specified.
Version 1.51 - 9 November 2011
- Renamed: Internal property "length" renamed to "_length"
so it will not inadvertently be used when the user means to
call the .Length() method.
Version 1.50 - 16 September 2011
Required for CryptoNite 1.1.8 and up
- Added: Str
returns the stored string
- Added: Str
(string newValue) stores the contents of the string and
returns the string.
- Added: Str
(*string newValue) stores the contents of the string and
returns the string.
- Added: SetSlice
sets the value of a substring within the stored string.
- Added: Insert
Inserts a passed string into the stored string at the
specified position.
- Added: Quote
adds the specified "quotes" to the stored (wraps the
string in the passed quotes).
- Added: UnQuote
removes quotation marks (or the specified values) from
the start and end of the string.
- Added: FindChar
fast brute force find a single character.
- Added: FindChars
fast brute force find for a substring.
- Added:
ColorToHex converts a Clarion RGB color stored
in a long to a hex string (which can be used in CSS,
HTML etc.).
- Added:
ColorFromHex converts a string containing the
hexadecimal representation of the color to a long
containing a standard RGB Clarion color.
- Added: Added color conversion
code to the stdemo example app.
- Added: UrlEncode
method URL (percent) encodes the passed string
- Added: UrlDecode
methods decodes the passed URL (percent) encoded string.
- Added: New
Encoding/Decoding tab to the example. Demonstrates URL
encoding and decoding and Base64 encoding and decoding.
- Fixed: A boundary index out of range error
in Replace
when a match is made against the whole string.
Version 1.45 - 20 August 2011
Required for CryptoNite 1.1.8 and up
- Fixed: GPF in
ToUpper
in some versions of C6 as a result of the Module
statement within the method.
- Updated: The
Replace
method is now five times faster for multi-character
replacement.
- Fixed: Problems with
Replace when the pEnd parameter is used.
- Updated: Removed debug
output from
SaveFile.
- Updated: Added the auto
attribute to local variables in the new
ReverseBytes method.
- Added: Checking for
passed lengths less than one in the
SetLength
method.
- Fixed: Potential GPF in
WrapText when the string is too short to be
wrapped.
- Fixed: Potential GPF in
Replace when an invalid string to search
for was passed, such as ''.
- Fixed: Potential GPF in
FileNameOnly if a zero length string was
passed, or if the method was called to extract the file
name from the stored string and no value had been set.
Version 1.44 - 20 August 2011
Required for CryptoNite 1.1.8 and up
- Fixed: Removed debug
code that was saving a temp file when calling the
AnsiToUtf16 method.
Version 1.43 - 19 August 2011
Required for CryptoNite 1.1.8 and up
- Fixed:
Append
method causing conflicts in Clarion 6.1 9033 with the
built in Append (as with C55 the
AppendA method is available rather than
Append).
- Added: An encoding
parameter to the
ToAnsi
method. This allows the encoding to be specified in the
call to ToAnsi, rather than setting the .encoding
property of the object before calling ToAnsi.
- Added:
SwitchEndian method reverse the byte order
in a long.
- Added:
BigEndian
- converts a little endian four byte integer to a big
endian.
- Added:
LittleEndian - converts a big endian four
byte integer to little endian.
- Fixed: Example code in
the documentation for WordStart and
WordEnd was using Sub
rather than Slice to return the string
value found.
- Updated: Calling
Split with an empty string
will result in an empty Lines queue.
- Fixed: Potential GPF in
Split function
when used with a pQuoteStart parameter.
- Fixed: Potential GPF in
Split function as
the result of an incorrect string slice.
- Added:
ReverseByteOrder method. Reverses the byte
order of the stored string (the entire string is
reversed so '123456ABC'
would become 'CBA654321').
- Added: New documentation
and corrected example code for the
Crop
method.
- Updated: Documentation
for
SaveFile
- Updated: Documentation
for
LoadFile
- Updated: Documentation
for Slice
- Updated: Documentation
for the .encoding
property.
- Updated: Documentation
for
ToUnicode
- Updated: Documentation
for
ToAnsi
- Updated: Documentation
for
AnsiToUtf16
- Updated: Documentation
for
Utf16ToAnsi
- Updated: Documentation
for
Utf8To16
- Updated: Documentation
for
Utf16To8
- Updated: Documentation
for
Utf8ToAnsi
- Updated: Documentation
for
AnsiToUtf8
- Updated: Documentation
for
ByteToHex
- Updated: Documentation
for
HexToByte
- Updated: Documentation
for
LongToHex
Version 1.42 - 02 August 2011
Required for CryptoNite 1.1.8 and up
- Fixed:
WordStart
method not allowing a startPos equal to the string
length.
- Updated: Removed unused
local variable from
SaveFile
and
WordEnd
- Updated: Fixed incorrect
spelling in comment
- Fixed:
After
method not correctly returning an empty string when the
search string was located at the very end of the string.
- Updated: Changed all
internal call to
Len
to call
LengthA
directly instead for slightly improved efficiency.
- Updated: The
documentation for the
Count
method to include the new
softClip parameter.
- Updated: The default
value of the softClip
parameter for the
Count
method to True. Note that this does not change the
behavior of the method, the change of the new parameter
default value is for clarity.
Version 1.41 - 27 July 2011
Required for CryptoNite 1.1.8 and up
- Updated:
Documentation for the
RemoveAttributes method.
- Updated:
Documentation for the
Replace
method.
- Added: Documentation for
the
GetBytes methods.
- Added: Documentation for
the
SetBytes methods.
- Added: Documentation for
the
FromBytes methods.
- Added: Document for the
ToBytes methods.
- Added:
GetWord
Procedure(long pWordNumber,long startPos = 1, bool
htmlEnc=false), string, virtual. Returns a string
containing the word at the passed position.
- Added:
Clip
Procedure(), virtual. Clips the string (removes trailing
white space).
- Added:
Trim
Procedure(), virtual. Trims the string (removes white
space from the start and the end of the string).
- Added:
Squeeze
Procedure(bool htmlEnc=false), virtual. Removes excess
white space (each word in the string is separated by a
single space).
- Added:
ContainsADigit Procedure(), bool, virtual.
Returns True if the string contains at least one digit
character ('0' to '9')
- Added:
IsAllDigits Procedure(), bool, virtual.
Returns True if the string contains all digit characters
('0' to '9')
- Updated: Optimized the
SetValue method
- Fixed: The
SetBlob method was not returning a value on
success
- Updated: Removed
extraneous string slice in
ToBlob
- Updated: Removed
extraneous length assignment in
Base64Encode
- Updated: Added the Auto
attribute to values that did not require automatic
initialization to improve performance throughout
- Updated: Removed unused
local variables from methods
- Updated: Removed
extraneous if statement from
PathOnly
- Updated: Refactored
SetLength
- Updated: Refactored
Replace
- Updated: Refactored
Count to
optimize performance
- Added: The
Count method now
supports "soft" clipping using the softClip parameter.
This allows the search to overlap the passed pEnd if the
start of the string is within the bounds passed. This
defaults to False (clipping is "hard" and the word must
be entirely within the pStart and pEnd bounds passed to
be counted).
- Updated: Refactored the
LoadFile method and set the path length
to the new st:MAX_PATH equate
- Updated: Refactored the
SaveFile method and set the path length
to the new st:MAX_PATH equate
- Updated: Removed
extraneous local string variable and local assignment
from
FormatMessage
- Updated: Removed debug
Trace statements from
AnsiToUtf16, removed unused locals
- Updated: Refactored
BaseToDec, optimized it and added
bounds checking
- Updated: Refactored
StrCpy to remove extraneous checks and
slicing.
- Fixed: Lower bounds
checking bug in
WordStart (allowed a startPos of 0 rather than
1 to be passed)
- Updated: Refactored and
optimized
WordEnd.
- Fixed:
WordEnd not correctly
handling apostrophes because of the order that
whitespace checks were being done
- Updated: Removed
extraneous call to Length() from
CountWords
- Fixed: Changed
Length()
to
LengthA() in
RemoveAttributes to maintain C55
compatibility.
- Updated: Documentation
for the
Split method
- Fixed: Missing anchors
in the documentation.
- Many thanks to Geoff Robinson for
feedback and contributions to StringTheory, including
bug fixes, improvements and new methods!
Version 1.40 - 18 July 2011
Required for CryptoNite 1.1.8 and up
Version 1.39 - 07 June 2011
Required for CryptoNite 1.1.8 and up
Version 1.38 - 06 June 2011
Required for CryptoNite 1.1.8 and up
- Fixed: Bug in the
Between and
FindBetween methods that was searching the
wrong range.
- Fixed: Potential for an
infinite loop when using the pRecursive parameter of the
Replace method where the string being
replace was a substring of the replacement string and
the pCount parameter was not used to limit the number of
replacements performance.
- Fixed: The pCount
parameter of the
Replace
method not working correctly (only a single
instances was replaced when pCount was specified).
- Added: Examples of
Between and
FindBetween to the example application.
- Added:
Between
and
FindBetween to the class documentation.
- Added:
CountWords
method - count the number of words in the string.
- Added:
WordStart
and
WordEnd methods that return the start and
end of the next word in the string given a start
position.
Version 1.37 - 03 June 2011
Required for CryptoNite 1.1.8 and up
- New: Added methods to
allow binary storage of a wide variety of data types.
This allows data to be stored and retrieved as bytes.
For example when encrypting a long or a decimal, the
data can be stored as bytes for encryption and then
retrieved as bytes after decryption:
-
ToBytes and
FromBytes
store and retrieve data using a string to and from:
byte, short, ushort, long, ulong, sreal, real,
decimal, cstring, string
-
SetBytes and
GetBytes
store the passed data in the StringTheory object as
bytes and retrieve the original values for the
following data types: byte, short, ushort, long,
ulong, sreal, real, decimal, cstring, string
- Generic methods to allow storage and retrieval
of ANY data types
-
SetBytes Procedure (*? pVal,
string pType), bool, proc, virtual
-
GetBytes
Procedure (*? pVal,
string pType), bool, proc, virtual
- Updated: Further
optimization to the
Replace method for
single character searches.
- Added: pRecursive parameter to the
Replace
method. When set to True the replace is done in a
recursive manner - so the start position is repeated to
allow replacements within the newly replaced text.
- Added:
FindBetween method.
Identical to the
Between method except that the passed pStart and pEnd parameters are updated with the start
and the end positions of the string being returned.
Version 1.36 - 5 May 2011
- Update: Template
changes for Clarion 8 support.
Version 1.35 - 15 April 2011
Required for CryptoNite 1.15 and up
- Fixed: The Replace method was not
handling case insensitive find/replace for single
character replacements.
- Changed: The Instring method pEnd
parameter now specifies the end of the "slice" if the
string to search. Previously pEnd was actually
specifying the final start position of any string
located, so a string could be found that started before
pEnd, but ended after it. pStart and pEnd now specify
the start and end of the string to search, and default
to the start and end of the string passed if not
specified.
Version 1.34 - 15 April 2011
Required for CryptoNite 1.15 and up
- Updated for SafeUpdate 2.0.
This is the minimum version
required for SafeUpdate 2.0.
Version 1.33 - 29 March 2011
Required for CryptoNite 1.12 and up
- Fixed: The Replace method was
ignoring the pStart and pEnd parameters when doing a
single character replacement.
- Added: Additional bounds checking to the
Replace method for the starting position.
Version 1.32 - 19 January 2011
Required for CryptoNite 1.12 and up
- Fixed: Template error - missing #EndTab statement
Version 1.31 - 18 January 2011
Required for CryptoNite 1.04 and up
- Fixed: The Crop method not cropping the string when
the pEnd parameter was omitted
Version 1.30 - 21 December 2010
Required for CryptoNite 1.04
- Fixed: GPF when converting ANSI to UTF-8.
- Important: The Ansi to Unicode conversion methods
now take pointers to strings rather than cstrings. This
is primarily because the strings being passed do not
need to be terminated, and the null terminate would
differ in length for different Unicode encodings, which
can cause issues when the string is then stored as a
Clarion cstring. This does not affect the use of the
ToUnicode and ToAnsi methods, however will affect
directly calls to the other conversion. methods
including Utf8ToAnsi, AnsiToUtf8, AnsiToUtf16,
Utf16ToAnsi, Utf8To16, Utf16To8, apiUtf8ToAnsi and
apiAnsiToUtf8. You should adjust your code accordingly.
- Fixed: Error in the history where a section of the
CryptoNite history had been included.
- Fixed: Missing history in the docs.
- Updated the example application to explicitly set
the encoding when converting between UTF-8 and ANSI.
When ToUnicode is called the StringTheory.encoding
property is set, so when ToAnsi is called the method can
determine the type of encoding, convert it and set
.encoding to st:EncodeAnsi. When Unicode text is
initially stored or loaded from a file the .encoding
property is not set, so for example calling ToAnsi()
would have no effect unless .encoding is first set to
st:EncodeUtf8 or st:EncodeUtf16.
Version 1.29 - 10 December 2010
Required for CryptoNite 1.11
- Changed: Removed the automatic
derivation of methods by the template.
- Fixed: Template derivation
preventing the MD5 functionality from being disabled
- Fixed: Duplicate symbols with
NetTalk 5.
- Fixed: GPF in the
ToAnsi
and ToUnicode wrapper methods.
- Added:
ByteToHex
Procedure (byte pByte). Converts a byte to a two
character string that contains the hexidecimal
equivelent of the byte value. For example a byte that
contains 255 would return 'ff'.
- Added:
HexToString
Procedure (*string hexData). This method returns a
pointer to a string that contains the original value of
the hex encoded input.
- Added:
FromHex
Procedure. This method converts a hex encoded string
back to the original value.
- Added:
StrCpy
procedure. This performs a safe string copy from a
source string to a destination string. Handles strings
of any length, and truncates the data stored in the
destination string if the source string contains more
data than the destination can store.
Version 1.28 - 27 November 2010
- New:
-
WrapText
- performs word wrapping to wrap the text to a fixed
width by breaking lines as close the the specified
width as possible. Lines are only broken on white
space (tabs and spaces). The default wrap width is
80 characters.
- Updated the example with the new WrapText method
- Fixed
-
DecToBase - for bases below 10 the
returned string could be truncated for larger
numbers (maximum return length was 10).
- Compile error on the WrapText method, which had
not been implemented.
Version 1.27 - 27 October 2010
Required for CryptoNite 1.03
- New Class methods:
- New class properties
-
encoding
- Text encoding - Ansi, UTf-8 or Utf16
-
widechars - When a string is converted
to UTF-16, this is set to the number of wide chars
the string contains
- Renamed methods:
- Fixed memory leak in
Utf8ToAnsi and
AnsiToUtf8 (previously named apiUtf8ToAnsi
and apiAnsiToUtf8)
- Updated version history for 1.26 to
include descriptions of the new methods, and links to
the method documentation
- Added new methods from 1.26 and
1.27 to the
class documentation.
- Fixed: The "noCase" option for find
and replace in the demo wasn't being passed to the
Replace method.
- Fixed: Between now
allows spaces to be passed as the delimiters.
Version 1.26 - 15 June 2010
Required for CryptoNite 1.02
- Correct 1.25 release date in the version history
- Added new methods:
-
DecToBase Procedure (long num,
long base=16, long lowerCase=1), string, virtual
Converts a decimal number to a number using the
specified base (such as Hexadecimal - base 16).
- BaseToDec Procedure (string
num, long base=16), long, virtual
Converts the passed number stored in a string to a
decimal.
- ByteToHex Procedure (byte
pByte), string, virtual
Returns a string that contains the hexadecimal
equivilent of the passed byte.
- LongToHex Procedure (long
pLong), string, virtual
Converts a long of 4 bytes to hex. Returns a string
that contains the hex of each byte in big endian
order (the most significant byte first).
- StringToHex Procedure (*string
binData), *string, virtual
Returns a string that contains the hexadecimal
equivilent of each byte in the passed string (which
is treated as binary data).
For example:
'Hello World' would be
encoded to:
'48656c6c6f20576f726c64'
- ToHex Procedure (), virtual
Converts the stored string to a hex string - each
bytes is converted to two characters representing
the hexidecimal equivilent.
For example:
'Hello World' would be
encoded to:
'48656c6c6f20576f726c64'
Version 1.25 - 22 September June 2010
- Initial Release of the stand alone StringTheory
- Changes from prior versions included in OddJob:
- Fixed Between() method including the left hand
delimiter in the returned string.
- Additional handling of boundary cases in the
Replace() method.
- Fixed a bug in the Replace method, when the
string being replaced is the end of the text being
searched.
Version 1.24 and prior (not available as a stand alone product) - 15 June 2010
- Added bounds checking and corrected unhandled
boundary cases for the following methods:
- Replace (handles
replacement from the start and end of the
string, where the resultant string is empty,
where the resultant string is a single character
etc.)
- PathOnly (handles the case
where the path contains only a forward or back
slash)
- Split (handles if a "line"
is blank)
- ToBlob (handles the string
being assigned to the blob being empty, or being
a single character)
- Verified that Between and Before are both safe.
- Added optional clip parameter
to StringTheory Append method.
- Updated docs for the StringTheory SetValue method
- Added handling to SetValue for
passing zero length strings (the StringTheory value is
disposed of and the Length methods will return zero).
- New StringTheory methods:
- Before - returns the portion of the
string that occurs before the specified string
seperator.
- After - returns the portion of the
string that occurs after the specified string seperator.
- Between - returns the portion
of the string that occurs between the two specified
string seperators.
- Base64Encode/Base64Decode
- Base64 encode and decode either a passed
string, or the value stored by the StringTheory object.
- MD5 - Create an MD5 hash of the
string.
- New string delimiter processing methods:
- Split - splits the string into
sub strings, which are stored in the .lines
property. Optionally allows the "line" start and end
delimeters to be specified.
- Join - joins the all the lines
(after the string has been slit using Split, and
optionally wraps each line in the specified
delimiters).
- Slice - returns a string containing
the data between the specified start and end characters
(a "slice").
- Crop - Crops the stored value
using the pass start and end parameters.
- Sub - returns a sub-string of
the specified length, starting at the specified
character.
- Fixed the ClipLen method infinitely loop as it was
calling itself rather than calling ClipLength().
- Fixed the Base64Encode method adding extra spaces in
the encoded string.
- Added: FromBlob method, stores the
contents of the passed BLOB in the StringTheory object.
- Added ToBlob method, saves the
contents of the string into the passed BLOB.
- Fixed: the PathOnly method, which
was returning a blank string.
- Optimised: the Replace method in the
case where both strings are a single character
- Fixed: Replace to allow an empty
replacement string to be specified (which removes the
searched for string)
- Fixed: FileNameFromPath method.
|
 |