Skip to content

lixinqi/cfg

Repository files navigation

Introduction

Given proto file demo.proto:

message Bar {
  optional string nickname = 1 [default = "undefined-nickname"];
}

message Foo {
  optional string name = 1 [default="unnamed"];
  required Bar bar = 2;
}

This project enables you manipulating native c++ object by python code

import demo
foo = demo.Foo()
print("---------[ default value ]--------")
print("foo.name():", foo.name())
print("foo.bar().nickname():", foo.bar().nickname())
print("---------[ set value ]--------")
foo.set_name("Jonathan")
foo.mutable_bar().set_nickname("Jonty")
print("foo.name():", foo.name())
print("foo.bar().nickname():", foo.bar().nickname())

Try

  sh demo.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published