diff options
author | csharptest <roger@csharptest.net> | 2011-05-20 12:18:14 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2011-05-20 12:18:14 -0500 |
commit | 10871cc8ddbf57dda938c1fd0df012a95f015f4a (patch) | |
tree | 5e14567063916f74e4d5709ea9d3de712ccd1090 | |
parent | 51eb1b405c852d1efc1dd3ca2d7e29fc0a8b67be (diff) | |
download | protobuf-10871cc8ddbf57dda938c1fd0df012a95f015f4a.tar.gz protobuf-10871cc8ddbf57dda938c1fd0df012a95f015f4a.tar.bz2 protobuf-10871cc8ddbf57dda938c1fd0df012a95f015f4a.zip |
Removed more uses of InternalsVisibleTo, made more stuff public :)
-rw-r--r-- | src/ProtocolBuffers/CodedInputStream.cs | 8 | ||||
-rw-r--r-- | src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs | 9 | ||||
-rw-r--r-- | src/ProtocolBuffers/InvalidProtocolBufferException.cs | 2 | ||||
-rw-r--r-- | src/ProtocolBuffers/NameHelpers.cs | 2 | ||||
-rw-r--r-- | src/ProtocolBuffers/Properties/AssemblyInfo.cs | 15 | ||||
-rw-r--r-- | src/ProtocolBuffers/TextFormat.cs | 26 |
6 files changed, 26 insertions, 36 deletions
diff --git a/src/ProtocolBuffers/CodedInputStream.cs b/src/ProtocolBuffers/CodedInputStream.cs index 922957f2..8b4c860b 100644 --- a/src/ProtocolBuffers/CodedInputStream.cs +++ b/src/ProtocolBuffers/CodedInputStream.cs @@ -66,7 +66,7 @@ namespace Google.ProtocolBuffers { internal const int DefaultRecursionLimit = 64; internal const int DefaultSizeLimit = 64 << 20; // 64MB - internal const int BufferSize = 4096; + public const int BufferSize = 4096; /// <summary> /// The total number of bytes read before the current buffer. The @@ -489,8 +489,10 @@ namespace Google.ProtocolBuffers { /// CodedInputStream buffers its input. /// </summary> /// <param name="input"></param> - /// <returns></returns> - internal static uint ReadRawVarint32(Stream input) { + /// <returns></returns>
+ [CLSCompliant(false)]
+ public static uint ReadRawVarint32(Stream input)
+ { int result = 0; int offset = 0; for (; offset < 32; offset += 7) { diff --git a/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs b/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs index b0bf5de1..0c933583 100644 --- a/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs +++ b/src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs @@ -39,15 +39,16 @@ namespace Google.ProtocolBuffers.Descriptors { /// Defined specifically for the <see cref="FieldType" /> enumeration, /// this allows each field type to specify the mapped type and wire type. /// </summary> + [CLSCompliant(false)] [AttributeUsage(AttributeTargets.Field)] - internal sealed class FieldMappingAttribute : Attribute { - internal FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) { + public sealed class FieldMappingAttribute : Attribute { + public FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) { MappedType = mappedType; WireType = wireType; } - internal MappedType MappedType { get; private set; } - internal WireFormat.WireType WireType { get; private set; } + public MappedType MappedType { get; private set; } + public WireFormat.WireType WireType { get; private set; } /// <summary> diff --git a/src/ProtocolBuffers/InvalidProtocolBufferException.cs b/src/ProtocolBuffers/InvalidProtocolBufferException.cs index 3888cbc6..f3ebb5f6 100644 --- a/src/ProtocolBuffers/InvalidProtocolBufferException.cs +++ b/src/ProtocolBuffers/InvalidProtocolBufferException.cs @@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers { : base(message) { } - internal static InvalidProtocolBufferException TruncatedMessage() { + public static InvalidProtocolBufferException TruncatedMessage() { return new InvalidProtocolBufferException( "While parsing a protocol message, the input ended unexpectedly " + "in the middle of a field. This could mean either than the " + diff --git a/src/ProtocolBuffers/NameHelpers.cs b/src/ProtocolBuffers/NameHelpers.cs index ddaf1a3f..59a0e12c 100644 --- a/src/ProtocolBuffers/NameHelpers.cs +++ b/src/ProtocolBuffers/NameHelpers.cs @@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers { /// Attempts to strip a suffix from a string, returning whether /// or not the suffix was actually present. /// </summary> - internal static bool StripSuffix(ref string text, string suffix) { + public static bool StripSuffix(ref string text, string suffix) { if (text.EndsWith(suffix)) { text = text.Substring(0, text.Length - suffix.Length); return true; diff --git a/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/src/ProtocolBuffers/Properties/AssemblyInfo.cs index 0ec29fb1..c45391cf 100644 --- a/src/ProtocolBuffers/Properties/AssemblyInfo.cs +++ b/src/ProtocolBuffers/Properties/AssemblyInfo.cs @@ -68,19 +68,4 @@ using System.Runtime.CompilerServices; [assembly: AssemblyFileVersion("2.3.0.277")]
#endif
-[assembly: InternalsVisibleTo("Google.ProtocolBuffers.Test,PublicKey=" + Google.ProtocolBuffers.Properties.KnownKeys.PublishedKey)]
-[assembly: InternalsVisibleTo("Google.ProtocolBuffersLite.Test,PublicKey=" + Google.ProtocolBuffers.Properties.KnownKeys.PublishedKey)]
-
[assembly: CLSCompliant(true)]
-
-namespace Google.ProtocolBuffers.Properties
-{
- class KnownKeys
- {
- public const string PublishedKey = @"00240000048000009400000006020000002400005253413100040000110000003b4611704c5379" +
- "39c3e0fbe9447dd6fa5462507f9dd4fd9fbf0712457e415b037da6d2c4eb5d2c7d29c86380af68" +
- "7cf400401bb183f2a70bd3b631c1fcb7db8aa66c766694a9fb53fa765df6303104da8c978f3b6d" +
- "53909cd30685b8bc9922c726cd82b5995e9e2cfca6df7a2d189d851492e49f4b76f269ce6dfd08" +
- "c34a7d98";
- }
-}
diff --git a/src/ProtocolBuffers/TextFormat.cs b/src/ProtocolBuffers/TextFormat.cs index 27bef8f4..885152db 100644 --- a/src/ProtocolBuffers/TextFormat.cs +++ b/src/ProtocolBuffers/TextFormat.cs @@ -225,23 +225,25 @@ namespace Google.ProtocolBuffers { } } - internal static ulong ParseUInt64(string text) { + [CLSCompliant(false)] + public static ulong ParseUInt64(string text) { return (ulong) ParseInteger(text, false, true); } - internal static long ParseInt64(string text) { + public static long ParseInt64(string text) { return ParseInteger(text, true, true); - } - - internal static uint ParseUInt32(string text) { + }
+
+ [CLSCompliant(false)] + public static uint ParseUInt32(string text) { return (uint) ParseInteger(text, false, false); } - internal static int ParseInt32(string text) { + public static int ParseInt32(string text) { return (int) ParseInteger(text, true, false); } - internal static float ParseFloat(string text) { + public static float ParseFloat(string text) { switch (text) { case "-inf": case "-infinity": @@ -261,7 +263,7 @@ namespace Google.ProtocolBuffers { } } - internal static double ParseDouble(string text) { + public static double ParseDouble(string text) { switch (text) { case "-inf": case "-infinity": @@ -363,7 +365,7 @@ namespace Google.ProtocolBuffers { /// Unescapes a text string as escaped using <see cref="EscapeText(string)" />. /// Two-digit hex escapes (starting with "\x" are also recognised. /// </summary> - internal static string UnescapeText(string input) { + public static string UnescapeText(string input) { return UnescapeBytes(input).ToStringUtf8(); } @@ -372,7 +374,7 @@ namespace Google.ProtocolBuffers { /// The string is first encoded as UTF-8, then each byte escaped individually. /// The returned value is guaranteed to be entirely ASCII. /// </summary> - internal static string EscapeText(string input) { + public static string EscapeText(string input) { return EscapeBytes(ByteString.CopyFromUtf8(input)); } @@ -385,7 +387,7 @@ namespace Google.ProtocolBuffers { /// using 3-digit octal sequences. /// The returned value is guaranteed to be entirely ASCII. /// </summary> - internal static String EscapeBytes(ByteString input) { + public static String EscapeBytes(ByteString input) { StringBuilder builder = new StringBuilder(input.Length); foreach (byte b in input) { switch (b) { @@ -418,7 +420,7 @@ namespace Google.ProtocolBuffers { /// <summary> /// Performs string unescaping from C style (octal, hex, form feeds, tab etc) into a byte string. /// </summary> - internal static ByteString UnescapeBytes(string input) { + public static ByteString UnescapeBytes(string input) { byte[] result = new byte[input.Length]; int pos = 0; for (int i = 0; i < input.Length; i++) { |