24 #include <google/protobuf/descriptor.h>
26 #include "../../codec.h"
28 int main(
int argc,
char* argv[])
30 std::cerr <<
"**** analyze_dccl is deprecated. You should consider using the newer 'dccl' tool "
31 "instead (dccl --analyze -f some_dccl.proto -I /path/to/proto) **** "
36 std::cerr <<
"usage: analyze_dccl some_dccl.proto [include_path (0-n)]" << std::endl;
40 dccl::dlog.
connect(dccl::logger::WARN_PLUS, &std::cerr);
46 const google::protobuf::FileDescriptor* file_desc =
52 std::cout <<
"read in: " << argv[1] << std::endl;
53 for (
int i = 0, n = file_desc->message_type_count(); i < n; ++i)
55 const google::protobuf::Descriptor* desc = file_desc->message_type(i);
63 catch (std::exception& e)
65 std::cerr <<
"Not a valid DCCL message: " << desc->full_name() <<
"\n"
66 << e.what() << std::endl;
71 std::cerr <<
"No descriptor with name " << file_desc->message_type(i)->full_name()
72 <<
" found!" << std::endl;
76 std::cout <<
dccl << std::endl;
80 std::cerr <<
"failed to read in: " << argv[1] << std::endl;
Dynamic Compact Control Language namespace.
The Dynamic CCL enCODer/DECoder. This is the main class you will use to load, encode and decode DCCL ...
static const google::protobuf::FileDescriptor * load_from_proto_file(const std::string &protofile_absolute_path)
Load a message from a .proto file on the disk. enable_compilation() must be called first.
void connect(int verbosity_mask, Slot slot)
Connect the output of one or more given verbosities to a slot (function pointer or similar)
static void enable_compilation()
Enable on the fly compilation of .proto files on the local disk. Must be called before load_from_prot...
static void add_include_path(const std::string &path)
Add a path for searching for import messages when loading .proto files using load_from_proto_file()