csharp_names.h

#include <google/protobuf/compiler/csharp/csharp_names.h>
namespace google::protobuf::compiler::csharp

Provides a mechanism for mapping a descriptor to the fully-qualified name of the corresponding C# class.

Classes in this file

File Members

These definitions are not part of any class.
string
GetFileNamespace(const FileDescriptor * descriptor)
Requires: more...
string
GetClassName(const Descriptor * descriptor)
Requires: more...
string
GetReflectionClassName(const FileDescriptor * descriptor)
Requires: more...
string
GetOutputFile(const google::protobuf::FileDescriptor * descriptor, const string file_extension, const bool generate_directories, const string base_namespace, string * error)
Generates output file name for given file descriptor. more...

string csharp::GetFileNamespace(
        const FileDescriptor * descriptor)

Requires:

descriptor != NULL
Returns:
The namespace to use for given file descriptor.

string csharp::GetClassName(
        const Descriptor * descriptor)

Requires:

descriptor != NULL
Returns:
The fully-qualified C# class name.

string csharp::GetReflectionClassName(
        const FileDescriptor * descriptor)

Requires:

descriptor != NULL
Returns:
The fully-qualified name of the C# class that provides
access to the file descriptor. Proto compiler generates
such class for each .proto file processed.

string csharp::GetOutputFile(
        const google::protobuf::FileDescriptor * descriptor,
        const string file_extension,
        const bool generate_directories,
        const string base_namespace,
        string * error)

Generates output file name for given file descriptor.

If generate_directories is true, the output file will be put under directory corresponding to file's namespace. base_namespace can be used to strip some of the top level directories. E.g. for file with namespace "Bar.Foo" and base_namespace="Bar", the resulting file will be put under directory "Foo" (and not "Bar/Foo").

Requires:

descriptor != NULL
error != NULL
 Returns:
The file name to use as output file for given file descriptor. In case
of failure, this function will return empty string and error parameter
will contain the error message.