Commit 10871cc8 authored by csharptest's avatar csharptest Committed by rogerk

Removed more uses of InternalsVisibleTo, made more stuff public :)

parent 51eb1b40
...@@ -66,7 +66,7 @@ namespace Google.ProtocolBuffers { ...@@ -66,7 +66,7 @@ namespace Google.ProtocolBuffers {
internal const int DefaultRecursionLimit = 64; internal const int DefaultRecursionLimit = 64;
internal const int DefaultSizeLimit = 64 << 20; // 64MB internal const int DefaultSizeLimit = 64 << 20; // 64MB
internal const int BufferSize = 4096; public const int BufferSize = 4096;
/// <summary> /// <summary>
/// The total number of bytes read before the current buffer. The /// The total number of bytes read before the current buffer. The
...@@ -489,8 +489,10 @@ namespace Google.ProtocolBuffers { ...@@ -489,8 +489,10 @@ namespace Google.ProtocolBuffers {
/// CodedInputStream buffers its input. /// CodedInputStream buffers its input.
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
internal static uint ReadRawVarint32(Stream input) { [CLSCompliant(false)]
public static uint ReadRawVarint32(Stream input)
{
int result = 0; int result = 0;
int offset = 0; int offset = 0;
for (; offset < 32; offset += 7) { for (; offset < 32; offset += 7) {
......
...@@ -39,15 +39,16 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -39,15 +39,16 @@ namespace Google.ProtocolBuffers.Descriptors {
/// Defined specifically for the <see cref="FieldType" /> enumeration, /// Defined specifically for the <see cref="FieldType" /> enumeration,
/// this allows each field type to specify the mapped type and wire type. /// this allows each field type to specify the mapped type and wire type.
/// </summary> /// </summary>
[CLSCompliant(false)]
[AttributeUsage(AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Field)]
internal sealed class FieldMappingAttribute : Attribute { public sealed class FieldMappingAttribute : Attribute {
internal FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) { public FieldMappingAttribute(MappedType mappedType, WireFormat.WireType wireType) {
MappedType = mappedType; MappedType = mappedType;
WireType = wireType; WireType = wireType;
} }
internal MappedType MappedType { get; private set; } public MappedType MappedType { get; private set; }
internal WireFormat.WireType WireType { get; private set; } public WireFormat.WireType WireType { get; private set; }
/// <summary> /// <summary>
......
...@@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers { ...@@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers {
: base(message) { : base(message) {
} }
internal static InvalidProtocolBufferException TruncatedMessage() { public static InvalidProtocolBufferException TruncatedMessage() {
return new InvalidProtocolBufferException( return new InvalidProtocolBufferException(
"While parsing a protocol message, the input ended unexpectedly " + "While parsing a protocol message, the input ended unexpectedly " +
"in the middle of a field. This could mean either than the " + "in the middle of a field. This could mean either than the " +
......
...@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers { ...@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers {
/// Attempts to strip a suffix from a string, returning whether /// Attempts to strip a suffix from a string, returning whether
/// or not the suffix was actually present. /// or not the suffix was actually present.
/// </summary> /// </summary>
internal static bool StripSuffix(ref string text, string suffix) { public static bool StripSuffix(ref string text, string suffix) {
if (text.EndsWith(suffix)) { if (text.EndsWith(suffix)) {
text = text.Substring(0, text.Length - suffix.Length); text = text.Substring(0, text.Length - suffix.Length);
return true; return true;
......
...@@ -68,19 +68,4 @@ using System.Runtime.CompilerServices; ...@@ -68,19 +68,4 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyFileVersion("2.3.0.277")] [assembly: AssemblyFileVersion("2.3.0.277")]
#endif #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)] [assembly: CLSCompliant(true)]
namespace Google.ProtocolBuffers.Properties
{
class KnownKeys
{
public const string PublishedKey = @"00240000048000009400000006020000002400005253413100040000110000003b4611704c5379" +
"39c3e0fbe9447dd6fa5462507f9dd4fd9fbf0712457e415b037da6d2c4eb5d2c7d29c86380af68" +
"7cf400401bb183f2a70bd3b631c1fcb7db8aa66c766694a9fb53fa765df6303104da8c978f3b6d" +
"53909cd30685b8bc9922c726cd82b5995e9e2cfca6df7a2d189d851492e49f4b76f269ce6dfd08" +
"c34a7d98";
}
}
...@@ -225,23 +225,25 @@ namespace Google.ProtocolBuffers { ...@@ -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); return (ulong) ParseInteger(text, false, true);
} }
internal static long ParseInt64(string text) { public static long ParseInt64(string text) {
return ParseInteger(text, true, true); 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); return (uint) ParseInteger(text, false, false);
} }
internal static int ParseInt32(string text) { public static int ParseInt32(string text) {
return (int) ParseInteger(text, true, false); return (int) ParseInteger(text, true, false);
} }
internal static float ParseFloat(string text) { public static float ParseFloat(string text) {
switch (text) { switch (text) {
case "-inf": case "-inf":
case "-infinity": case "-infinity":
...@@ -261,7 +263,7 @@ namespace Google.ProtocolBuffers { ...@@ -261,7 +263,7 @@ namespace Google.ProtocolBuffers {
} }
} }
internal static double ParseDouble(string text) { public static double ParseDouble(string text) {
switch (text) { switch (text) {
case "-inf": case "-inf":
case "-infinity": case "-infinity":
...@@ -363,7 +365,7 @@ namespace Google.ProtocolBuffers { ...@@ -363,7 +365,7 @@ namespace Google.ProtocolBuffers {
/// Unescapes a text string as escaped using <see cref="EscapeText(string)" />. /// Unescapes a text string as escaped using <see cref="EscapeText(string)" />.
/// Two-digit hex escapes (starting with "\x" are also recognised. /// Two-digit hex escapes (starting with "\x" are also recognised.
/// </summary> /// </summary>
internal static string UnescapeText(string input) { public static string UnescapeText(string input) {
return UnescapeBytes(input).ToStringUtf8(); return UnescapeBytes(input).ToStringUtf8();
} }
...@@ -372,7 +374,7 @@ namespace Google.ProtocolBuffers { ...@@ -372,7 +374,7 @@ namespace Google.ProtocolBuffers {
/// The string is first encoded as UTF-8, then each byte escaped individually. /// The string is first encoded as UTF-8, then each byte escaped individually.
/// The returned value is guaranteed to be entirely ASCII. /// The returned value is guaranteed to be entirely ASCII.
/// </summary> /// </summary>
internal static string EscapeText(string input) { public static string EscapeText(string input) {
return EscapeBytes(ByteString.CopyFromUtf8(input)); return EscapeBytes(ByteString.CopyFromUtf8(input));
} }
...@@ -385,7 +387,7 @@ namespace Google.ProtocolBuffers { ...@@ -385,7 +387,7 @@ namespace Google.ProtocolBuffers {
/// using 3-digit octal sequences. /// using 3-digit octal sequences.
/// The returned value is guaranteed to be entirely ASCII. /// The returned value is guaranteed to be entirely ASCII.
/// </summary> /// </summary>
internal static String EscapeBytes(ByteString input) { public static String EscapeBytes(ByteString input) {
StringBuilder builder = new StringBuilder(input.Length); StringBuilder builder = new StringBuilder(input.Length);
foreach (byte b in input) { foreach (byte b in input) {
switch (b) { switch (b) {
...@@ -418,7 +420,7 @@ namespace Google.ProtocolBuffers { ...@@ -418,7 +420,7 @@ namespace Google.ProtocolBuffers {
/// <summary> /// <summary>
/// Performs string unescaping from C style (octal, hex, form feeds, tab etc) into a byte string. /// Performs string unescaping from C style (octal, hex, form feeds, tab etc) into a byte string.
/// </summary> /// </summary>
internal static ByteString UnescapeBytes(string input) { public static ByteString UnescapeBytes(string input) {
byte[] result = new byte[input.Length]; byte[] result = new byte[input.Length];
int pos = 0; int pos = 0;
for (int i = 0; i < input.Length; i++) { for (int i = 0; i < input.Length; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment