csharp_names.h

This section contains reference documentation for working with protocol buffer classes in C++.

#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.
std::string
GetFileNamespace(const FileDescriptor * descriptor)
Requires: more...
std::string
GetClassName(const Descriptor * descriptor)
Requires: more...
std::string
GetReflectionClassName(const FileDescriptor * descriptor)
Requires: more...
std::string
GetOutputFile(const FileDescriptor * descriptor, const std::string file_extension, const bool generate_directories, const std::string base_namespace, std::string * error)
Generates output file name for given file descriptor. more...

std::string csharp::GetFileNamespace(
        const FileDescriptor * descriptor)

Requires:

descriptor != NULL

Returns:

The namespace to use for given file descriptor.

std::string csharp::GetClassName(
        const Descriptor * descriptor)

Requires:

descriptor != NULL

Returns:

The fully-qualified C# class name.

std::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.

std::string csharp::GetOutputFile(
        const FileDescriptor * descriptor,
        const std::string file_extension,
        const bool generate_directories,
        const std::string base_namespace,
        std::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.