Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
7f90d8ee
Commit
7f90d8ee
authored
Oct 02, 2008
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made things a bit more public for the sake of ProtoGen
parent
7fd62ffd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
7 deletions
+33
-7
FileDescriptor.cs
csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs
+6
-1
AssemblyInfo.cs
csharp/ProtocolBuffers/Properties/AssemblyInfo.cs
+6
-0
TextFormat.cs
csharp/ProtocolBuffers/TextFormat.cs
+1
-0
TextGenerator.cs
csharp/ProtocolBuffers/TextGenerator.cs
+20
-6
No files found.
csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs
View file @
7f90d8ee
...
...
@@ -175,7 +175,8 @@ namespace Google.ProtocolBuffers.Descriptors {
/// </summary>
/// <param name="proto">The protocol message form of the FileDescriptor.</param>
/// <param name="dependencies">FileDescriptors corresponding to all of the
/// file's dependencies, in the exact order listed in the .proto file</param>
/// file's dependencies, in the exact order listed in the .proto file. May be null,
/// in which case it is treated as an empty array.</param>
/// <exception cref="DescriptorValidationException">If <paramref name="proto"/> is not
/// a valid descriptor. This can occur for a number of reasons, such as a field
/// having an undefined type or because two messages were defined with the same name.</exception>
...
...
@@ -189,6 +190,10 @@ namespace Google.ProtocolBuffers.Descriptors {
// FieldDescriptor for an embedded message contains a pointer directly
// to the Descriptor for that message's type. We also detect undefined
// types in the linking step.
if
(
dependencies
==
null
)
{
dependencies
=
new
FileDescriptor
[
0
];
}
DescriptorPool
pool
=
new
DescriptorPool
(
dependencies
);
FileDescriptor
result
=
new
FileDescriptor
(
proto
,
dependencies
,
pool
);
...
...
csharp/ProtocolBuffers/Properties/AssemblyInfo.cs
View file @
7f90d8ee
...
...
@@ -55,3 +55,9 @@ using System.Runtime.CompilerServices;
"72f738140072bb69990bc4f98a21365de2c105e848974a3d210e938b0a56103c0662901efd6b78"
+
"0ee6dbe977923d46a8fda18fb25c65dd73b149a5cd9f3100668b56649932dadd8cf5be52eb1dce"
+
"ad5cedbf"
)]
[
assembly
:
InternalsVisibleTo
(
"ProtoGen,PublicKey="
+
"00240000048000009400000006020000002400005253413100040000010001006d739020e13bdc"
+
"038e86fa8aa5e1b13aae65d3ae79d622816c6067ab5b6955be50cc887130117582349208c13a55"
+
"5e09a6084558f989ccde66094f07822808d3a9b922b0e85b912070032e90bb35360be7efb7982b"
+
"702d7a5c6ed1e21d8ca587b4f4c9d2b81210d3641cc75f506cdfc628ac5453ff0a6886986c981d"
+
"12245bc7"
)]
csharp/ProtocolBuffers/TextFormat.cs
View file @
7f90d8ee
...
...
@@ -314,6 +314,7 @@ namespace Google.ProtocolBuffers {
internal
static
string
EscapeText
(
string
input
)
{
return
EscapeBytes
(
ByteString
.
CopyFromUtf8
(
input
));
}
/// <summary>
/// Escapes bytes in the format used in protocol buffer text format, which
/// is the same as the format used for C string literals. All bytes
...
...
csharp/ProtocolBuffers/TextGenerator.cs
View file @
7f90d8ee
...
...
@@ -20,9 +20,9 @@ using System.Text;
namespace
Google.ProtocolBuffers
{
/// <summary>
/// Helper class to control indentation
/// Helper class to control indentation
. Used for TextFormat and by ProtoGen.
/// </summary>
internal
sealed
class
TextGenerator
{
public
sealed
class
TextGenerator
{
/// <summary>
/// Writer to write formatted text to.
...
...
@@ -40,9 +40,10 @@ namespace Google.ProtocolBuffers {
readonly
StringBuilder
indent
=
new
StringBuilder
();
/// <summary>
/// Creates a generator writing to the given writer.
/// Creates a generator writing to the given writer. The writer
/// is not closed by this class.
/// </summary>
internal
TextGenerator
(
TextWriter
writer
)
{
public
TextGenerator
(
TextWriter
writer
)
{
this
.
writer
=
writer
;
}
...
...
@@ -51,20 +52,33 @@ namespace Google.ProtocolBuffers {
/// will be inserted at the beginning of each line of text. Indent() may
/// be called multiple times to produce deeper indents.
/// </summary>
internal
void
Indent
()
{
public
void
Indent
()
{
indent
.
Append
(
" "
);
}
/// <summary>
/// Reduces the current indent level by two spaces.
/// </summary>
internal
void
Outdent
()
{
public
void
Outdent
()
{
if
(
indent
.
Length
==
0
)
{
throw
new
InvalidOperationException
(
"Too many calls to Outdent()"
);
}
indent
.
Length
-=
2
;
}
public
void
WriteLine
(
string
text
)
{
Print
(
text
);
Print
(
"\n"
);
}
public
void
WriteLine
(
string
format
,
params
object
[]
args
)
{
WriteLine
(
string
.
Format
(
format
,
args
));
}
public
void
WriteLine
()
{
WriteLine
(
""
);
}
/// <summary>
/// Prints the given text to the output stream, indenting at line boundaries.
/// </summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment