สมาชิก
CcInfo
CcInfo CcInfo(compilation_context=None, linking_context=None, debug_context=None)
CcInfo
พารามิเตอร์
| พารามิเตอร์ | คำอธิบาย |
|---|---|
compilation_context
|
CompilationContext; or None;
ค่าเริ่มต้น = ไม่มีCompilationContext
|
linking_context
|
LinkingContext; or None;
ค่าเริ่มต้น = ไม่มีLinkingContext
|
debug_context
|
DebugContext; or None;
ค่าเริ่มต้น = ไม่มีDebugContext
|
compilation_context
CompilationContext CcInfo.compilation_context
CompilationContext
linking_context
LinkingContext CcInfo.linking_context
LinkingContext
to_json
string CcInfo.to_json()
---incompatible_struct_has_no_methods ใช้ธงนี้เพื่อยืนยันว่าโค้ดของคุณเข้ากันได้กับการนำออกในเร็วๆ นี้ สร้างสตริง JSON จากพารามิเตอร์ Struct วิธีนี้ใช้งานได้เฉพาะเมื่อองค์ประกอบ Struct ทั้งหมด (เกิดซ้ำ) เป็นสตริง, ints, บูลีน, Struct อื่นๆ, รายการประเภทเหล่านี้ หรือพจนานุกรมที่มีคีย์สตริงและค่าในประเภทเหล่านี้ ระบบจะใช้อักขระหลีกกับเครื่องหมายคำพูดและบรรทัดใหม่ในสตริง ตัวอย่าง:
struct(key=123).to_json()
# {"key":123}
struct(key=True).to_json()
# {"key":true}
struct(key=[1, 2, 3]).to_json()
# {"key":[1,2,3]}
struct(key='text').to_json()
# {"key":"text"}
struct(key=struct(inner_key='text')).to_json()
# {"key":{"inner_key":"text"}}
struct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()
# {"key":[{"inner_key":1},{"inner_key":2}]}
struct(key=struct(inner_key=struct(inner_inner_key='text'))).to_json()
# {"key":{"inner_key":{"inner_inner_key":"text"}}}
เลิกใช้งานแล้ว ให้ใช้ json.encode(x) หรือ json.encode_indent(x) แทน ซึ่งใช้ได้กับค่าอื่นที่ไม่ใช่ Struct และไม่ทําให้เนมสเปซของช่อง Struct เสียไป
to_proto
string CcInfo.to_proto()
---incompatible_struct_has_no_methods ใช้ธงนี้เพื่อยืนยันว่าโค้ดของคุณเข้ากันได้กับการนำออกในเร็วๆ นี้ สร้าง SMS จากพารามิเตอร์ Struct วิธีนี้ใช้งานได้เฉพาะเมื่อองค์ประกอบ Struct ทั้งหมด (เกิดซ้ำ) เป็นสตริง, ints, บูลีน, Struct อื่นๆ หรือ dicts หรือรายการในประเภทเหล่านี้ ระบบจะใช้อักขระหลีกกับเครื่องหมายคำพูดและบรรทัดใหม่ในสตริง คีย์โครงสร้างจะทำซ้ำตามลำดับที่จัดเรียง ตัวอย่าง:
struct(key=123).to_proto()
# key: 123
struct(key=True).to_proto()
# key: true
struct(key=[1, 2, 3]).to_proto()
# key: 1
# key: 2
# key: 3
struct(key='text').to_proto()
# key: "text"
struct(key=struct(inner_key='text')).to_proto()
# key {
# inner_key: "text"
# }
struct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()
# key {
# inner_key: 1
# }
# key {
# inner_key: 2
# }
struct(key=struct(inner_key=struct(inner_inner_key='text'))).to_proto()
# key {
# inner_key {
# inner_inner_key: "text"
# }
# }
struct(foo={4: 3, 2: 1}).to_proto()
# foo: {
# key: 4
# value: 3
# }
# foo: {
# key: 2
# value: 1
# }
เลิกใช้งานแล้ว: ใช้ protocol.encode_text(x) แทน