ข้อมูลสําเนา

รายงานปัญหา ดูแหล่งที่มา

ผู้ให้บริการสำหรับการคอมไพล์และลิงก์ C++ นอกจากนี้ยังเป็นผู้ให้บริการทำเครื่องหมายที่ระบุกฎ C++ ว่าสามารถใช้กฎที่มีกับผู้ให้บริการรายนี้ หากไม่ได้กำหนดให้กฎอิงตาม C++ กฎควรรวม CcInfo ไว้ในผู้ให้บริการอื่น

สมาชิก

CcInfo

CcInfo CcInfo(compilation_context=None, linking_context=None, debug_context=None)

ตัวสร้าง CcInfo

พารามิเตอร์

พารามิเตอร์ คำอธิบาย
compilation_context CompilationContext หรือ None ค่าเริ่มต้นคือ None
คือ CompilationContext
linking_context LinkingContext หรือ None ค่าเริ่มต้นคือ None
LinkingContext
debug_context DebugContext หรือ None ค่าเริ่มต้นคือ None
DebugContext

compilation_context

CompilationContext CcInfo.compilation_context

แสดง CompilationContext

linking_context

LinkingContext CcInfo.linking_context

แสดง LinkingContext

to_json

string CcInfo.to_json()

เลิกใช้งานแล้ว API นี้เลิกใช้งานแล้วและจะถูกนำออกเร็วๆ นี้ โปรดอย่าพึ่งพาสิ่งนี้ ถูกปิดใช้กับ ---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()

เลิกใช้งานแล้ว API นี้เลิกใช้งานแล้วและจะถูกนำออกเร็วๆ นี้ โปรดอย่าพึ่งพาสิ่งนี้ ถูกปิดใช้กับ ---incompatible_struct_has_no_methods ใช้แฟล็กนี้เพื่อยืนยันว่าโค้ดเข้ากันได้กับการนําออกที่กำลังจะเกิดขึ้น
สร้าง SMS จากพารามิเตอร์ Struct วิธีการนี้จะใช้งานได้ก็ต่อเมื่อองค์ประกอบ Struct ทั้งหมด (แบบเรียกซ้ำ) เป็นสตริง, ints, บูลีน, Struct หรือคำสั่งอื่นๆ หรือรายการประเภทเหล่านี้ เครื่องหมายคำพูดและบรรทัดใหม่ในสตริงจะใช้อักขระหลีก คีย์โครงสร้างจะทำซ้ำตามลำดับที่จัดเรียง ตัวอย่าง:
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
# }

เลิกใช้งาน: ใช้ proto.encode_text(x) แทน