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

pull/288/head
csharptest 14 years ago committed by rogerk
parent 51eb1b405c
commit 10871cc8dd
  1. 6
      src/ProtocolBuffers/CodedInputStream.cs
  2. 9
      src/ProtocolBuffers/Descriptors/FieldMappingAttribute.cs
  3. 2
      src/ProtocolBuffers/InvalidProtocolBufferException.cs
  4. 2
      src/ProtocolBuffers/NameHelpers.cs
  5. 15
      src/ProtocolBuffers/Properties/AssemblyInfo.cs
  6. 22
      src/ProtocolBuffers/TextFormat.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
@ -490,7 +490,9 @@ namespace Google.ProtocolBuffers {
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
internal static uint ReadRawVarint32(Stream input) {
[CLSCompliant(false)]
public static uint ReadRawVarint32(Stream input)
{
int result = 0;
int offset = 0;
for (; offset < 32; offset += 7) {

@ -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>

@ -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 " +

@ -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;

@ -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";
}
}

@ -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++) {

Loading…
Cancel
Save