ServiceStack.Text
Utils to load types
Find the type from the name supplied
[typeName] or [typeName, assemblyName]
The top-most interface of the given type, if any.
Find type if it exists
The type if it exists
If AlwaysUseUtc is set to true then convert all DateTime to UTC.
Repairs an out-of-spec XML date/time string which incorrectly uses a space instead of a 'T' to separate the date from the time.
These string are occasionally generated by SQLite and can cause errors in OrmLite when reading these columns from the DB.
The XML date/time string to repair
The repaired string. If no repairs were made, the original string is returned.
WCF Json format: /Date(unixts+0000)/
WCF Json format: /Date(unixts+0000)/
Get the type(string) constructor if exists
The type.
micro optimizations: using flags instead of value.IndexOfAny(EscapeChars)
Class to hold
A fast, standards-based, serialization-issue free DateTime serailizer.
Determines whether this serializer can create the specified type from a string.
The type.
true if this instance [can create from string] the specified type; otherwise, false.
Parses the specified value.
The value.
Deserializes from reader.
The reader.
Serializes to string.
The value.
Serializes to writer.
The value.
The writer.
Sets which format to use when serializing TimeSpans
if the is configured
to take advantage of specification,
to support user-friendly serialized formats, ie emitting camelCasing for JSON
and parsing member names and enum values in a case-insensitive manner.
if the is configured
to support web-friendly serialized formats, ie emitting lowercase_underscore_casing for JSON
Define how property names are mapped during deserialization
Gets or sets a value indicating if the framework should throw serialization exceptions
or continue regardless of deserialization errors. If the framework
will throw; otherwise, it will parse as many fields as possible. The default is .
Gets or sets a value indicating if the framework should always convert to UTC format instead of local time.
Gets or sets a value indicating if the framework should always assume is in UTC format if Kind is Unspecified.
Gets or sets whether we should append the Utc offset when we serialize Utc dates. Defaults to no.
Only supported for when the JsConfig.DateHandler == JsonDateHandler.TimestampOffset
Gets or sets a value indicating if unicode symbols should be serialized as "\uXXXX".
If set to true, Interface types will be prefered over concrete types when serializing.
Sets the maximum depth to avoid circular dependencies
Set this to enable your own type construction provider.
This is helpful for integration with IoC containers where you need to call the container constructor.
Return null if you don't know how to construct the type and the parameterless constructor will be used.
If set to true, Interface types will be prefered over concrete types when serializing.
Always emit type info for this type. Takes precedence over ExcludeTypeInfo
Never emit type info for this type
if the is configured
to take advantage of specification,
to support user-friendly serialized formats, ie emitting camelCasing for JSON
and parsing member names and enum values in a case-insensitive manner.
Define custom serialization fn for BCL Structs
Define custom raw serialization fn
Define custom serialization hook
Define custom deserialization fn for BCL Structs
Define custom raw deserialization fn for objects
Exclude specific properties of this type from being serialized
Opt-in flag to set some Value Types to be treated as a Ref Type
Whether there is a fn (raw or otherwise)
The property names on target types must match property names in the JSON source
The property names on target types may not match the property names in the JSON source
Uses the xsd format like PT15H10M20S
Uses the standard .net ToString method of the TimeSpan class
Get JSON string value converted to T
Get JSON string value
Get unescaped string value
Get unescaped string value
Write JSON Array, Object, bool or number values as raw string
Get JSON string value
Creates an instance of a Type from a string value
Parses the specified value.
The value.
Shortcut escape when we're sure value doesn't contain any escaped chars
Given a character as utf32, returns the equivalent string provided that the character
is legal json.
micro optimizations: using flags instead of value.IndexOfAny(EscapeChars)
Implement the serializer using a more static approach
Implement the serializer using a more static approach
Pretty Thread-Safe cache class from:
http://code.google.com/p/dapper-dot-net/source/browse/Dapper/SqlMapper.cs
This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example),
and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE**
equality. The type is fully thread-safe.
Implement the serializer using a more static approach
@jonskeet: Collection of utility methods which operate on streams.
r285, February 26th 2009: http://www.yoda.arachsys.com/csharp/miscutil/
Reads the given stream up to the end, returning the data as a byte
array.
Reads the given stream up to the end, returning the data as a byte
array, using the given buffer size.
Reads the given stream up to the end, returning the data as a byte
array, using the given buffer for transferring data. Note that the
current contents of the buffer is ignored, so the buffer needn't
be cleared beforehand.
Copies all the data from one stream into another.
Copies all the data from one stream into another, using a buffer
of the given size.
Copies all the data from one stream into another, using the given
buffer for transferring data. Note that the current contents of
the buffer is ignored, so the buffer needn't be cleared beforehand.
Reads exactly the given number of bytes from the specified stream.
If the end of the stream is reached before the specified amount
of data is read, an exception is thrown.
Reads into a buffer, filling it completely.
Reads exactly the given number of bytes from the specified stream,
into the given buffer, starting at position 0 of the array.
Reads exactly the given number of bytes from the specified stream,
into the given buffer, starting at position 0 of the array.
Same as ReadExactly, but without the argument checks.
Converts from base: 0 - 62
The source.
From.
To.
Skip the encoding process for 'safe strings'
A class to allow the conversion of doubles to string representations of
their exact decimal values. The implementation aims for readability over
efficiency.
Courtesy of @JonSkeet
http://www.yoda.arachsys.com/csharp/DoubleConverter.cs
How many digits are *after* the decimal point
Constructs an arbitrary decimal expansion from the given long.
The long must not be negative.
Multiplies the current expansion by the given amount, which should
only be 2 or 5.
Shifts the decimal point; a negative value makes
the decimal expansion bigger (as fewer digits come after the
decimal place) and a positive value makes the decimal
expansion smaller.
Removes leading/trailing zeroes from the expansion.
Converts the value to a proper decimal string representation.
Creates an instance of a Type from a string value
Determines whether the specified type is convertible from string.
The type.
true if the specified type is convertible from string; otherwise, false.
Parses the specified value.
The value.
Parses the specified type.
The type.
The value.
Useful extension method to get the Dictionary[string,string] representation of any POCO type.
Recursively prints the contents of any POCO object in a human-friendly, readable format
Print Dump to Console.WriteLine
Print string.Format to Console.WriteLine
Parses the specified value.
The value.