Skip to content

Commit

Permalink
Merge pull request ServiceStack#82 from danmiser/master
Browse files Browse the repository at this point in the history
MonoTouch integration
  • Loading branch information
mythz committed Feb 29, 2012
2 parents 6ebd159 + cbcd442 commit 84f853e
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 4 deletions.
36 changes: 36 additions & 0 deletions src/ServiceStack.Text.MonoTouch/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ServiceStack.Text.MonoTouch")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ServiceStack.Text.MonoTouch")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8af04880-eee5-41ff-b962-7a7fcefa3ebf")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
255 changes: 255 additions & 0 deletions src/ServiceStack.Text.MonoTouch/ServiceStack.Text.MonoTouch.csproj
@@ -0,0 +1,255 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9A3F2C71-F6BE-491F-86F7-01708C2263BE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ServiceStack.Text.MonoTouch</RootNamespace>
<AssemblyName>ServiceStack.Text.MonoTouch</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MONOTOUCH</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\ServiceStack.Text\AssemblyUtils.cs">
<Link>AssemblyUtils.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DateTimeSerializer.cs">
<Link>Common\DateTimeSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeArray.cs">
<Link>Common\DeserializeArray.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeBuiltin.cs">
<Link>Common\DeserializeBuiltin.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeCollection.cs">
<Link>Common\DeserializeCollection.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeDictionary.cs">
<Link>Common\DeserializeDictionary.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeListWithElements.cs">
<Link>Common\DeserializeListWithElements.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeSpecializedCollections.cs">
<Link>Common\DeserializeSpecializedCollections.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeType.cs">
<Link>Common\DeserializeType.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeRef.cs">
<Link>Common\DeserializeTypeRef.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeRefJson.cs">
<Link>Common\DeserializeTypeRefJson.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeRefJsv.cs">
<Link>Common\DeserializeTypeRefJsv.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeUtils.cs">
<Link>Common\DeserializeTypeUtils.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\ITypeSerializer.cs">
<Link>Common\ITypeSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\JsDelegates.cs">
<Link>Common\JsDelegates.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\JsReader.cs">
<Link>Common\JsReader.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\JsState.cs">
<Link>Common\JsState.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\JsWriter.cs">
<Link>Common\JsWriter.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\ParseUtils.cs">
<Link>Common\ParseUtils.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\StaticParseMethod.cs">
<Link>Common\StaticParseMethod.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\WriteDictionary.cs">
<Link>Common\WriteDictionary.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\WriteLists.cs">
<Link>Common\WriteLists.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Common\WriteType.cs">
<Link>Common\WriteType.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Controller\CommandProcessor.cs">
<Link>Controller\CommandProcessor.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Controller\PathInfo.cs">
<Link>Controller\PathInfo.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\CsvConfig.cs">
<Link>CsvConfig.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\CsvSerializer.cs">
<Link>CsvSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\CsvStreamExtensions.cs">
<Link>CsvStreamExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\CsvWriter.cs">
<Link>CsvWriter.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\DateTimeExtensions.cs">
<Link>DateTimeExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Env.cs">
<Link>Env.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\ITracer.cs">
<Link>ITracer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\ITypeSerializer.Generic.cs">
<Link>ITypeSerializer.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\JsConfig.cs">
<Link>JsConfig.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\JsonObject.cs">
<Link>JsonObject.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\JsonSerializer.cs">
<Link>JsonSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\JsonSerializer.Generic.cs">
<Link>JsonSerializer.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Json\JsonReader.Generic.cs">
<Link>Json\JsonReader.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Json\JsonTypeSerializer.cs">
<Link>Json\JsonTypeSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Json\JsonUtils.cs">
<Link>Json\JsonUtils.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Json\JsonWriter.Generic.cs">
<Link>Json\JsonWriter.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\JsvFormatter.cs">
<Link>JsvFormatter.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Jsv\JsvDeserializeType.cs">
<Link>Jsv\JsvDeserializeType.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Jsv\JsvReader.Generic.cs">
<Link>Jsv\JsvReader.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Jsv\JsvSerializer.Generic.cs">
<Link>Jsv\JsvSerializer.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Jsv\JsvTypeSerializer.cs">
<Link>Jsv\JsvTypeSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Jsv\JsvWriter.Generic.cs">
<Link>Jsv\JsvWriter.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\ListExtensions.cs">
<Link>ListExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\MapExtensions.cs">
<Link>MapExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Marc\Link.cs">
<Link>Marc\Link.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Marc\ObjectAccessor.cs">
<Link>Marc\ObjectAccessor.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Marc\TypeAccessor.cs">
<Link>Marc\TypeAccessor.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\QueryStringSerializer.cs">
<Link>QueryStringSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\ReflectionExtensions.cs">
<Link>ReflectionExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Reflection\StaticAccessors.cs">
<Link>Reflection\StaticAccessors.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\StreamExtensions.cs">
<Link>StreamExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\StringExtensions.cs">
<Link>StringExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Support\AssemblyTypeDefinition.cs">
<Link>Support\AssemblyTypeDefinition.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Support\DoubleConverter.cs">
<Link>Support\DoubleConverter.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Support\TypePair.cs">
<Link>Support\TypePair.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\TextExtensions.cs">
<Link>TextExtensions.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\Tracer.cs">
<Link>Tracer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\TranslateListWithElements.cs">
<Link>TranslateListWithElements.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\TypeConfig.cs">
<Link>TypeConfig.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\TypeSerializer.cs">
<Link>TypeSerializer.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\TypeSerializer.Generic.cs">
<Link>TypeSerializer.Generic.cs</Link>
</Compile>
<Compile Include="..\ServiceStack.Text\XmlSerializer.cs">
<Link>XmlSerializer.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
20 changes: 20 additions & 0 deletions src/ServiceStack.Text.MonoTouch/ServiceStack.Text.MonoTouch.sln
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.Text.MonoTouch", "ServiceStack.Text.MonoTouch.csproj", "{9A3F2C71-F6BE-491F-86F7-01708C2263BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
5 changes: 3 additions & 2 deletions src/ServiceStack.Text/Common/DeserializeBuiltin.cs
Expand Up @@ -56,9 +56,10 @@ private static ParseStringDelegate GetParseFn()
return value => DateTimeSerializer.ParseShortestXsdDateTime(value);
if (typeof(T) == typeof(TimeSpan))
return value => TimeSpan.Parse(value);
if (typeof(T) == typeof(System.Data.Linq.Binary))
#if !MONOTOUCH
if (typeof(T) == typeof(System.Data.Linq.Binary))
return value => new System.Data.Linq.Binary(Convert.FromBase64String(value));

#endif
if (typeof(T) == typeof(char))
{
char cValue;
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceStack.Text/Common/DeserializeType.cs
Expand Up @@ -11,14 +11,14 @@
//

#if !XBOX && !MONOTOUCH && !SILVERLIGHT
using System.Linq;
using System.Reflection.Emit;
#endif

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.Serialization;
using System.Linq;

namespace ServiceStack.Text.Common
{
Expand Down
4 changes: 3 additions & 1 deletion src/ServiceStack.Text/Common/JsWriter.cs
Expand Up @@ -129,7 +129,9 @@ public JsWriter()
{ typeof(Uri), Serializer.WriteObjectString },
{ typeof(Type), WriteType },
{ typeof(Exception), Serializer.WriteException },
{ typeof(System.Data.Linq.Binary), Serializer.WriteLinqBinary },
#if !MONOTOUCH
{ typeof(System.Data.Linq.Binary), Serializer.WriteLinqBinary },
#endif
};
}

Expand Down
2 changes: 2 additions & 0 deletions src/ServiceStack.Text/Json/JsonTypeSerializer.cs
Expand Up @@ -255,7 +255,9 @@ public void WriteEnumFlags(TextWriter writer, object enumFlagValue)

public void WriteLinqBinary(TextWriter writer, object linqBinaryValue)
{
#if !MONOTOUCH
WriteRawString(writer, Convert.ToBase64String(((System.Data.Linq.Binary)linqBinaryValue).ToArray()));
#endif
}

public ParseStringDelegate GetParseFn<T>()
Expand Down
2 changes: 2 additions & 0 deletions src/ServiceStack.Text/Jsv/JsvTypeSerializer.cs
Expand Up @@ -198,7 +198,9 @@ public void WriteEnumFlags(TextWriter writer, object enumFlagValue)

public void WriteLinqBinary(TextWriter writer, object linqBinaryValue)
{
#if !MONOTOUCH
WriteRawString(writer, Convert.ToBase64String(((System.Data.Linq.Binary)linqBinaryValue).ToArray()));
#endif
}

public object EncodeMapKey(object value)
Expand Down

0 comments on commit 84f853e

Please sign in to comment.