forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathITypeSerializer.Generic.cs
More file actions
57 lines (51 loc) · 1.45 KB
/
Copy pathITypeSerializer.Generic.cs
File metadata and controls
57 lines (51 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// https://github.com/ServiceStack/ServiceStack.Text
// ServiceStack.Text: .NET C# POCO JSON, JSV and CSV Text Serializers.
//
// Authors:
// Demis Bellot ([email protected])
//
// Copyright 2012 ServiceStack Ltd.
//
// Licensed under the same terms of ServiceStack: new BSD license.
//
using System;
using System.IO;
namespace ServiceStack.Text
{
public interface ITypeSerializer<T>
{
/// <summary>
/// Determines whether this serializer can create the specified type from a string.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>
/// <c>true</c> if this instance [can create from string] the specified type; otherwise, <c>false</c>.
/// </returns>
bool CanCreateFromString(Type type);
/// <summary>
/// Parses the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
T DeserializeFromString(string value);
/// <summary>
/// Deserializes from reader.
/// </summary>
/// <param name="reader">The reader.</param>
/// <returns></returns>
T DeserializeFromReader(TextReader reader);
/// <summary>
/// Serializes to string.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
string SerializeToString(T value);
/// <summary>
/// Serializes to writer.
/// </summary>
/// <param name="value">The value.</param>
/// <param name="writer">The writer.</param>
void SerializeToWriter(T value, TextWriter writer);
}
}