├── cs
├── nuget
│ ├── empty
│ └── .dir-locals.el
├── build
│ ├── internal
│ │ ├── bond.snk
│ │ └── DevVersions.cs
│ └── nuget
│ │ ├── Bond.CSharp.props
│ │ ├── Bond.Compiler.CSharp.props
│ │ ├── Bond.CSharp.targets
│ │ ├── Bond.Compiler.CSharp.targets
│ │ └── cps
│ │ └── ProjectItemsSchema.xaml
├── test
│ ├── codegen
│ │ ├── no-warnings
│ │ │ └── simple.bond
│ │ ├── output-no-slash
│ │ │ └── simple.bond
│ │ └── default-ignore-output
│ │ │ ├── simple.bond
│ │ │ ├── bin
│ │ │ └── should-not-be-compiled.bond
│ │ │ ├── obj
│ │ │ ├── should-not-be-compiled.bond
│ │ │ ├── debug
│ │ │ │ └── netstandard1.0
│ │ │ │ │ └── should-not-be-compiled.bond
│ │ │ └── retail
│ │ │ │ └── netstandard1.0
│ │ │ │ └── should-not-be-compiled.bond
│ │ │ ├── README.md
│ │ │ ├── ConsumeCodegen.cs
│ │ │ └── default-ignore-output.csproj
│ ├── core
│ │ ├── import dir with spaces
│ │ │ └── dir1
│ │ │ │ └── dir2
│ │ │ │ └── Bond File With Spaces.bond
│ │ ├── Partial.cs
│ │ ├── NamespaceConflictBond.bond
│ │ ├── Containers.bond
│ │ ├── ReadOnly.bond
│ │ ├── NamespaceConflict.bond
│ │ ├── ImmutableCollections.bond
│ │ ├── XmlSerializationTests.cs
│ │ └── JsonSerializationTests.cs
│ └── internal
│ │ └── RequiredFieldsTest.cs
├── .gitignore
└── src
│ ├── io
│ ├── properties
│ │ └── AssemblyInfo.cs
│ └── IO.csproj
│ ├── json
│ ├── properties
│ │ └── AssemblyInfo.cs
│ └── protocols
│ │ └── IJsonReader.cs
│ ├── core
│ ├── expressions
│ │ └── ISerializerGenerator.cs
│ ├── io
│ │ └── ICloneable.cs
│ ├── protocols
│ │ └── Exceptions.cs
│ └── ISchemaField.cs
│ ├── attributes
│ └── Attributes.csproj
│ └── reflection
│ └── reflection.csproj
├── cpp
├── .gitignore
├── test
│ ├── core
│ │ ├── security.h
│ │ ├── cmdargs.h
│ │ ├── apply_tests.h
│ │ ├── basic_tests.h
│ │ ├── json_tests.h
│ │ ├── maybe_tests.h
│ │ ├── bonded_tests.h
│ │ ├── exception_tests.h
│ │ ├── metadata_tests.h
│ │ ├── protocol_test.h
│ │ ├── validate_tests.h
│ │ ├── mafia_compat_tests.h
│ │ ├── skip_tests.h
│ │ ├── scope_test1.bond
│ │ ├── security.bond
│ │ ├── imports
│ │ │ └── dir1
│ │ │ │ └── dir2
│ │ │ │ └── import_test2.bond
│ │ ├── scope_test2.bond
│ │ ├── import_test1.bond
│ │ ├── unit_test_limits.h
│ │ ├── precompiled.h
│ │ └── main.cpp
│ ├── CMakeLists.txt
│ └── compat
│ │ └── core
│ │ └── compat.h
├── inc
│ └── bond
│ │ ├── core
│ │ ├── containers.h
│ │ ├── customize.h
│ │ ├── detail
│ │ │ ├── nonassignable.h
│ │ │ ├── value_extern.h
│ │ │ └── once.h
│ │ ├── box.h
│ │ ├── scalar_interface.h
│ │ ├── cmdargs.h
│ │ └── select_protocol_fwd.h
│ │ ├── protocol
│ │ └── detail
│ │ │ └── rapidjson_utils.h
│ │ └── ext
│ │ └── capped_allocator_fwd.h
└── src
│ └── bond
│ ├── protocol
│ └── detail
│ │ └── rapidjson_utils.cpp
│ └── core
│ ├── value.cpp
│ └── select_protocol.cpp
├── java
├── core
│ ├── .idea
│ │ ├── .name
│ │ ├── encodings.xml
│ │ ├── dictionaries
│ │ │ └── bond.xml
│ │ ├── vcs.xml
│ │ ├── modules.xml
│ │ ├── compiler.xml
│ │ └── gradle.xml
│ ├── src
│ │ ├── test
│ │ │ ├── resources
│ │ │ │ └── alphabet.txt
│ │ │ └── bond
│ │ │ │ ├── bonded.bond
│ │ │ │ ├── imports
│ │ │ │ └── dir1
│ │ │ │ │ └── dir2
│ │ │ │ │ └── common.bond
│ │ │ │ └── equality.bond
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── bondlib
│ │ │ ├── TwoPassProtocolWriter.java
│ │ │ ├── BondSerializable.java
│ │ │ ├── StructMetadata.java
│ │ │ ├── InvalidBondDataException.java
│ │ │ └── StreamNotCloneableException.java
│ ├── settings.gradle
│ └── CMakeLists.txt
├── gradle-plugin
│ ├── .idea
│ │ ├── .name
│ │ ├── encodings.xml
│ │ ├── vcs.xml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ ├── compiler.xml
│ │ └── gradle.xml
│ ├── settings.gradle
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── META-INF
│ │ │ │ └── gradle-plugins
│ │ │ │ └── org.bondlib.gradle.properties
│ │ │ └── groovy
│ │ │ └── org
│ │ │ └── bondlib
│ │ │ └── gradle
│ │ │ ├── BondPlugin.groovy
│ │ │ ├── BondProdCodegen.groovy
│ │ │ └── BondTestCodegen.groovy
│ ├── CMakeLists.txt
│ └── README.md
├── compat
│ ├── settings.gradle
│ ├── .idea
│ │ ├── encodings.xml
│ │ ├── vcs.xml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ ├── compiler.xml
│ │ └── gradle.xml
│ └── CMakeLists.txt
├── json
│ ├── settings.gradle
│ └── .idea
│ │ ├── vcs.xml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ ├── compiler.xml
│ │ └── gradle.xml
├── .gitignore
└── CMakeLists.txt
├── compiler
├── tests
│ ├── generated
│ │ ├── empty_concatenated.java
│ │ ├── empty_types.cpp
│ │ ├── generics_types.cpp
│ │ ├── alloc_ctors
│ │ │ ├── empty_types.cpp
│ │ │ ├── generics_types.cpp
│ │ │ ├── empty_reflection.h
│ │ │ ├── import_types.cpp
│ │ │ ├── maybe_blob_types.cpp
│ │ │ ├── alias_key_types.cpp
│ │ │ ├── empty_types.h
│ │ │ ├── inheritance_types.cpp
│ │ │ ├── bond_meta_types.cpp
│ │ │ └── field_modifiers_types.cpp
│ │ ├── allocator
│ │ │ ├── empty_types.cpp
│ │ │ ├── generics_types.cpp
│ │ │ ├── empty_reflection.h
│ │ │ ├── maybe_blob_types.cpp
│ │ │ ├── import_types.cpp
│ │ │ ├── alias_key_types.cpp
│ │ │ ├── empty_types.h
│ │ │ ├── inheritance_types.cpp
│ │ │ ├── bond_meta_types.cpp
│ │ │ └── field_modifiers_types.cpp
│ │ ├── scoped_allocator
│ │ │ ├── empty_types.cpp
│ │ │ ├── generics_types.cpp
│ │ │ ├── empty_reflection.h
│ │ │ ├── import_types.cpp
│ │ │ ├── maybe_blob_types.cpp
│ │ │ ├── alias_key_types.cpp
│ │ │ ├── empty_types.h
│ │ │ ├── inheritance_types.cpp
│ │ │ ├── bond_meta_types.cpp
│ │ │ └── field_modifiers_types.cpp
│ │ ├── type_aliases
│ │ │ ├── empty_types.cpp
│ │ │ ├── generics_types.cpp
│ │ │ ├── empty_reflection.h
│ │ │ ├── import_types.cpp
│ │ │ ├── maybe_blob_types.cpp
│ │ │ ├── alias_key_types.cpp
│ │ │ ├── empty_types.h
│ │ │ ├── inheritance_types.cpp
│ │ │ ├── bond_meta_types.cpp
│ │ │ └── field_modifiers_types.cpp
│ │ ├── empty_reflection.h
│ │ ├── maybe_blob_types.cpp
│ │ ├── import_types.cpp
│ │ ├── alias_key_types.cpp
│ │ ├── schemadef
│ │ │ ├── example.SomeStruct.json
│ │ │ ├── maybe_blob.Foo.json
│ │ │ ├── attributes.Foo.json
│ │ │ ├── nullable_alias.foo.json
│ │ │ ├── field_modifiers.Foo.json
│ │ │ └── inheritance.Foo.json
│ │ ├── empty_types.cs
│ │ ├── collection-interfaces
│ │ │ └── empty_types.cs
│ │ ├── empty_types.h
│ │ ├── inheritance_types.cpp
│ │ ├── bond_meta_types.cpp
│ │ ├── constructor-parameters
│ │ │ ├── empty_struct_types.cs
│ │ │ └── collection-interfaces
│ │ │ │ └── empty_struct_types.cs
│ │ └── field_modifiers_types.cpp
│ ├── schema
│ │ ├── empty.bond
│ │ ├── empty_struct.bond
│ │ ├── empty.json
│ │ ├── imports
│ │ │ └── dir1
│ │ │ │ └── dir2
│ │ │ │ └── empty.bond
│ │ ├── maybe_blob.bond
│ │ ├── example.bond
│ │ ├── namespace_basic_types.bond
│ │ ├── generics.bond
│ │ ├── inheritance.bond
│ │ ├── field_modifiers.bond
│ │ ├── bond_meta.bond
│ │ ├── alias_key.bond
│ │ ├── error
│ │ │ ├── int_out_of_range.bond
│ │ │ ├── service_invalid_base_type_param.bond
│ │ │ ├── aliases_default.bond
│ │ │ ├── service_invalid_base_struct.bond
│ │ │ ├── struct_nothing.bond
│ │ │ ├── enum_no_default.bond
│ │ │ └── duplicate_service_method.bond
│ │ ├── nullable_alias.bond
│ │ ├── metadata_edge_cases.bond
│ │ ├── import.bond
│ │ ├── service_attributes.bond
│ │ ├── service_inheritance.bond
│ │ ├── attributes.bond
│ │ ├── generic_service.bond
│ │ ├── complex_types.bond
│ │ ├── aliases.bond
│ │ ├── basic_types.bond
│ │ ├── basic_types_nsmapped.bond
│ │ ├── bond_meta.json
│ │ ├── field_modifiers.json
│ │ ├── custom_alias_with_allocator.bond
│ │ ├── custom_alias_without_allocator.bond
│ │ ├── immutable_collections.bond
│ │ ├── alias_with_allocator.bond
│ │ ├── attributes.json
│ │ ├── schemadef.bond
│ │ ├── streaming.bond
│ │ ├── example.json
│ │ ├── inheritance.json
│ │ └── complex_inheritance.bond
│ ├── .gitignore
│ ├── .gitattributes
│ └── Tests
│ │ └── Codegen
│ │ └── Util.hs
├── .gitignore
├── Setup.hs
└── stack.yaml.lock
├── doc
├── .gitignore
├── .pandoc
│ └── templates
│ │ └── cmdargs.html
├── src
│ ├── logos
│ │ ├── bond-logo-64x64-white.png
│ │ ├── bond-logo-743x543-white.png
│ │ ├── bond-logo-743x743-white.png
│ │ ├── bond-logo-64x64-transparent.png
│ │ ├── bond-logo-743x543-transparent.png
│ │ └── bond-logo-743x743-transparent.png
│ └── reference_index.md
└── doxygen
│ ├── bond_reference.css
│ └── doxygen.cmake
├── python
├── CMakeLists.txt
└── test
│ ├── CMakeLists.txt
│ ├── compat
│ ├── compat.cpp
│ └── compat.cmake
│ └── core
│ ├── CMakeLists.txt
│ └── unit_test.cpp
├── tools
├── ci-scripts
│ └── linux
│ │ ├── image-cleanup
│ │ ├── .pylintrc
│ │ ├── collector
│ │ │ ├── __init__.py
│ │ │ └── config.py
│ │ ├── .gitignore
│ │ └── mypy.ini
│ │ ├── build_cpp-core.zsh
│ │ ├── build_cpp-common.zsh
│ │ └── build_hs.zsh
└── syntax
│ ├── SublimeText3
│ └── Readme.md
│ ├── Notepad-plus-plus
│ └── README.md
│ └── VsCode
│ ├── .vscode
│ └── launch.json
│ ├── bond.configuration.json
│ ├── package.json
│ └── README.md
├── examples
├── python
│ ├── core
│ │ ├── CMakeLists.txt
│ │ └── extension
│ │ │ ├── extension.bond
│ │ │ ├── CMakeLists.txt
│ │ │ └── extension.cpp
│ └── CMakeLists.txt
├── cpp
│ ├── core
│ │ ├── trace
│ │ │ └── CMakeLists.txt
│ │ ├── variadic
│ │ │ └── CMakeLists.txt
│ │ ├── merge
│ │ │ ├── CMakeLists.txt
│ │ │ └── merge.bond
│ │ ├── import
│ │ │ ├── CMakeLists.txt
│ │ │ └── import.bond
│ │ ├── generics
│ │ │ ├── CMakeLists.txt
│ │ │ ├── generics.bond
│ │ │ └── generics.cpp
│ │ ├── transform
│ │ │ ├── CMakeLists.txt
│ │ │ └── transform.bond
│ │ ├── attributes
│ │ │ ├── CMakeLists.txt
│ │ │ └── attributes.bond
│ │ ├── marshaling
│ │ │ ├── CMakeLists.txt
│ │ │ └── marshaling.bond
│ │ ├── generic_tree
│ │ │ ├── CMakeLists.txt
│ │ │ └── generic_tree.bond
│ │ ├── inheritance
│ │ │ ├── CMakeLists.txt
│ │ │ └── inheritance.bond
│ │ ├── schema_view
│ │ │ ├── CMakeLists.txt
│ │ │ ├── schema_view.bond
│ │ │ └── schema_view.cpp
│ │ ├── simple_json
│ │ │ ├── CMakeLists.txt
│ │ │ └── simple_json.bond
│ │ ├── serialization
│ │ │ ├── CMakeLists.txt
│ │ │ └── serialization.bond
│ │ ├── access_control
│ │ │ ├── CMakeLists.txt
│ │ │ └── access_control.bond
│ │ ├── move_semantics
│ │ │ ├── CMakeLists.txt
│ │ │ └── move_semantics.bond
│ │ ├── runtime_schema
│ │ │ ├── CMakeLists.txt
│ │ │ └── runtime_schema.bond
│ │ ├── nothing_default
│ │ │ ├── CMakeLists.txt
│ │ │ └── nothing_default.bond
│ │ ├── runtime_binding
│ │ │ ├── CMakeLists.txt
│ │ │ └── runtime_binding.bond
│ │ ├── protocol_versions
│ │ │ ├── CMakeLists.txt
│ │ │ └── protocol_versions.bond
│ │ ├── record_streaming
│ │ │ ├── CMakeLists.txt
│ │ │ └── record_streaming.bond
│ │ ├── compile_time_schema
│ │ │ ├── CMakeLists.txt
│ │ │ └── compile_time_schema.bond
│ │ ├── modifying_transform
│ │ │ ├── CMakeLists.txt
│ │ │ └── modifying_transform.bond
│ │ ├── protocol_transcoding
│ │ │ ├── CMakeLists.txt
│ │ │ └── protocol_transcoding.bond
│ │ ├── polymorphic_container
│ │ │ ├── CMakeLists.txt
│ │ │ └── polymorphic_container.bond
│ │ ├── output_stream_allocator
│ │ │ ├── CMakeLists.txt
│ │ │ └── output_stream_allocator.bond
│ │ ├── polymorphic_container_visitor
│ │ │ ├── CMakeLists.txt
│ │ │ └── polymorphic_container_visitor.bond
│ │ ├── string_ref
│ │ │ ├── string_ref.bond
│ │ │ └── CMakeLists.txt
│ │ ├── time_alias
│ │ │ ├── time_alias.bond
│ │ │ └── CMakeLists.txt
│ │ ├── enumerations
│ │ │ ├── CMakeLists.txt
│ │ │ └── enumerations.bond
│ │ ├── container_of_pointers
│ │ │ ├── container_of_pointers.bond
│ │ │ └── CMakeLists.txt
│ │ ├── dll
│ │ │ ├── dllexample_dynlink.h
│ │ │ └── dll.bond
│ │ ├── scoped_allocator
│ │ │ ├── scoped_alloc.bond
│ │ │ └── CMakeLists.txt
│ │ ├── static_library
│ │ │ ├── lib
│ │ │ │ └── static_library.bond
│ │ │ └── CMakeLists.txt
│ │ ├── capped_allocator
│ │ │ ├── capped_allocator.bond
│ │ │ └── CMakeLists.txt
│ │ ├── static_array
│ │ │ ├── CMakeLists.txt
│ │ │ ├── static_array.bond
│ │ │ └── static_array.cpp
│ │ ├── multiprecision
│ │ │ ├── multiprecision.bond
│ │ │ └── CMakeLists.txt
│ │ └── bf
│ │ │ └── bf_test.cmake
│ └── CMakeLists.txt
├── CMakeLists.txt
├── codegen
│ └── read-only
│ │ ├── .gitignore
│ │ └── rocs.cabal
├── java
│ ├── .gitignore
│ └── core
│ │ ├── imports
│ │ └── src
│ │ │ └── main
│ │ │ └── bond
│ │ │ ├── common
│ │ │ ├── common.bond
│ │ │ └── protocol
│ │ │ │ └── header.bond
│ │ │ └── schema.bond
│ │ ├── record_streaming
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── record_streaming.bond
│ │ └── build.gradle
│ │ ├── blob
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── schema.bond
│ │ └── build.gradle
│ │ ├── serialization
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── serialization.bond
│ │ └── build.gradle
│ │ ├── protocol_versions
│ │ └── src
│ │ │ └── main
│ │ │ └── bond
│ │ │ └── protocol_versions.bond
│ │ ├── inheritance
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── inheritance.bond
│ │ └── build.gradle
│ │ ├── generics
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── generics.bond
│ │ └── build.gradle
│ │ ├── untagged_protocols
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── schema.bond
│ │ └── build.gradle
│ │ ├── runtime_schema
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── schema.bond
│ │ └── build.gradle
│ │ ├── enumerations
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── enumerations.bond
│ │ └── build.gradle
│ │ ├── nothing_default
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── nothing_default.bond
│ │ └── build.gradle
│ │ ├── schema_view
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── schema_view.bond
│ │ └── build.gradle
│ │ ├── generic_tree
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── bond
│ │ │ │ └── generic_tree.bond
│ │ └── build.gradle
│ │ └── polymorphic_container
│ │ ├── src
│ │ └── main
│ │ │ └── bond
│ │ │ └── schema.bond
│ │ └── build.gradle
└── cs
│ ├── core
│ ├── import
│ │ ├── common
│ │ │ ├── common.bond
│ │ │ └── protocol
│ │ │ │ └── header.bond
│ │ └── schema.bond
│ ├── stream
│ │ └── schema.bond
│ ├── marshaling
│ │ └── schema.bond
│ ├── serializer
│ │ └── schema.bond
│ ├── simple_json
│ │ └── schema.bond
│ ├── simple_xml
│ │ └── schema.bond
│ ├── record_streaming
│ │ └── record_streaming.bond
│ ├── decimal
│ │ └── schema.bond
│ ├── date_time
│ │ └── schema.bond
│ ├── serialization
│ │ └── schema.bond
│ ├── blob
│ │ └── schema.bond
│ ├── container_alias
│ │ └── schema.bond
│ ├── protocol_versions
│ │ └── protocol_versions.bond
│ ├── protocol_transcoding
│ │ └── schema.bond
│ ├── inheritance
│ │ └── inheritance.bond
│ ├── untagged_protocols
│ │ └── schema.bond
│ ├── generics
│ │ └── schema.bond
│ ├── cloning
│ │ └── schema.bond
│ ├── runtime_schema
│ │ └── schema.bond
│ ├── guid
│ │ └── schema.bond
│ ├── enumerations
│ │ ├── enumerations.bond
│ │ └── program.cs
│ ├── nothing_default
│ │ └── nothing_default.bond
│ ├── schema_view
│ │ └── schema_view.bond
│ ├── polymorphic_container
│ │ └── schema.bond
│ ├── generic_tree
│ │ └── generic_tree.bond
│ └── immutable_collections
│ │ └── schema.bond
│ └── .gitignore
├── test
└── compat
│ └── core
│ ├── data
│ ├── compat.fast.dat
│ ├── compat.schema.dat
│ ├── compat.simple.dat
│ ├── compat.compact.dat
│ ├── compat.compact2.dat
│ └── compat.simple2.dat
│ └── schemas
│ ├── compat2.bond
│ └── compat_no_generics.bond
├── .gitmodules
├── cmake
├── RunPythonTest.cmake
├── FindJavaBuildTools.cmake
├── NoDebug.cmake
├── FindStack.cmake
├── Folders.cmake
└── Compiler.cmake
├── .gitignore
├── SECURITY.md
├── CONTRIBUTING.md
└── NuGet.Config
/cs/nuget/empty:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cpp/.gitignore:
--------------------------------------------------------------------------------
1 | generated
2 |
--------------------------------------------------------------------------------
/java/core/.idea/.name:
--------------------------------------------------------------------------------
1 | bond
--------------------------------------------------------------------------------
/java/gradle-plugin/.idea/.name:
--------------------------------------------------------------------------------
1 | bond-gradle
--------------------------------------------------------------------------------
/compiler/tests/generated/empty_concatenated.java:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/doc/.gitignore:
--------------------------------------------------------------------------------
1 | # generated html
2 | html
3 |
--------------------------------------------------------------------------------
/compiler/tests/schema/empty.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
--------------------------------------------------------------------------------
/python/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory (test)
2 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/image-cleanup/.pylintrc:
--------------------------------------------------------------------------------
1 | [BASIC]
2 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/image-cleanup/collector/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/python/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory (extension)
2 |
--------------------------------------------------------------------------------
/java/compat/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'compat'
2 |
3 |
--------------------------------------------------------------------------------
/java/core/src/test/resources/alphabet.txt:
--------------------------------------------------------------------------------
1 | ABCDEFGHIJKLMNOPQRSTUVWXYZ
--------------------------------------------------------------------------------
/java/json/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'bond-json'
2 |
3 |
--------------------------------------------------------------------------------
/java/gradle-plugin/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'bond-gradle'
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/trace/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (trace trace.cpp)
2 |
--------------------------------------------------------------------------------
/examples/python/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subfolder (core "examples/python/core")
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/variadic/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (variadic variadic.cpp)
2 |
--------------------------------------------------------------------------------
/examples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory (cpp)
2 | add_python_subdirectory (python)
3 |
--------------------------------------------------------------------------------
/examples/cpp/core/merge/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (merge merge.bond merge.cpp)
2 |
--------------------------------------------------------------------------------
/compiler/tests/schema/empty_struct.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Empty
4 | {
5 | }
6 |
--------------------------------------------------------------------------------
/examples/cpp/core/import/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (import import.bond import.cpp)
2 |
--------------------------------------------------------------------------------
/compiler/tests/schema/empty.json:
--------------------------------------------------------------------------------
1 | {"namespaces":[{"name":["tests"]}],"imports":[],"declarations":[]}
--------------------------------------------------------------------------------
/compiler/tests/schema/imports/dir1/dir2/empty.bond:
--------------------------------------------------------------------------------
1 | namespace empty
2 |
3 | struct Empty { }
4 |
--------------------------------------------------------------------------------
/examples/cpp/core/generics/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (generics generics.bond generics.cpp)
2 |
--------------------------------------------------------------------------------
/cs/build/internal/bond.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/cs/build/internal/bond.snk
--------------------------------------------------------------------------------
/examples/cpp/core/transform/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (transform transform.bond transform.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/attributes/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (attributes attributes.bond attributes.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/marshaling/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (marshaling marshaling.bond marshaling.cpp)
2 |
--------------------------------------------------------------------------------
/cpp/test/core/security.h:
--------------------------------------------------------------------------------
1 |
2 | class SecurityTest
3 | {
4 | public:
5 | static void Initialize();
6 | };
7 |
--------------------------------------------------------------------------------
/examples/cpp/core/generic_tree/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (generic_tree generic_tree.bond generic_tree.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/inheritance/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (inheritance inheritance.bond inheritance.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/schema_view/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (schema_view schema_view.bond schema_view.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/simple_json/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (simple_json simple_json.bond simple_json.cpp)
2 |
--------------------------------------------------------------------------------
/compiler/tests/schema/maybe_blob.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Foo
4 | {
5 | 0: blob b = nothing;
6 | }
7 |
--------------------------------------------------------------------------------
/doc/.pandoc/templates/cmdargs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/examples/codegen/read-only/.gitignore:
--------------------------------------------------------------------------------
1 | # Cabal build artifacts
2 | dist
3 | .cabal-sandbox
4 | cabal.sandbox.config
5 |
--------------------------------------------------------------------------------
/examples/cpp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (NOT BOND_SKIP_CORE_TESTS)
2 | add_subfolder (core "examples/core")
3 | endif()
4 |
--------------------------------------------------------------------------------
/examples/cpp/core/serialization/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (serialization serialization.bond serialization.cpp)
2 |
--------------------------------------------------------------------------------
/compiler/.gitignore:
--------------------------------------------------------------------------------
1 | # Cabal build artifacts
2 | dist/
3 | .cabal-sandbox/
4 | cabal.sandbox.config
5 | .stack-work/
6 |
--------------------------------------------------------------------------------
/cpp/test/core/cmdargs.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class CmdArgs
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/examples/cpp/core/access_control/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (access_control access_control.bond access_control.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/move_semantics/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (move_semantics move_semantics.bond move_semantics.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/runtime_schema/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (runtime_schema runtime_schema.bond runtime_schema.cpp)
2 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/build_cpp-core.zsh:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 |
3 | set -eux
4 | source "$BUILD_SCRIPTS/build_cpp-common.zsh"
5 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/image-cleanup/.gitignore:
--------------------------------------------------------------------------------
1 | # Python pre-compiled stuff
2 | .mypy_cache/
3 | __pycache__/
4 | *.pyc
5 |
--------------------------------------------------------------------------------
/compiler/Setup.hs:
--------------------------------------------------------------------------------
1 | module Main (main) where
2 |
3 | import Distribution.Simple
4 |
5 | main :: IO ()
6 | main = defaultMain
7 |
--------------------------------------------------------------------------------
/cpp/test/core/apply_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class ApplyTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/cpp/test/core/basic_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class BasicTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/cpp/test/core/json_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class JSONTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/cpp/test/core/maybe_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class MaybeTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/doc/src/logos/bond-logo-64x64-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/doc/src/logos/bond-logo-64x64-white.png
--------------------------------------------------------------------------------
/examples/cpp/core/nothing_default/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (nothing_default nothing_default.bond nothing_default.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/runtime_binding/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (runtime_binding runtime_binding.bond runtime_binding.cpp)
2 |
--------------------------------------------------------------------------------
/test/compat/core/data/compat.fast.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/test/compat/core/data/compat.fast.dat
--------------------------------------------------------------------------------
/test/compat/core/data/compat.schema.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/test/compat/core/data/compat.schema.dat
--------------------------------------------------------------------------------
/test/compat/core/data/compat.simple.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/test/compat/core/data/compat.simple.dat
--------------------------------------------------------------------------------
/cpp/test/core/bonded_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class BondedTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/doc/src/logos/bond-logo-743x543-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/doc/src/logos/bond-logo-743x543-white.png
--------------------------------------------------------------------------------
/doc/src/logos/bond-logo-743x743-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/doc/src/logos/bond-logo-743x743-white.png
--------------------------------------------------------------------------------
/examples/cpp/core/protocol_versions/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (protocol_versions protocol_versions.bond protocol_versions.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/record_streaming/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (record_streaming record_streaming.bond record_streaming.cpp)
2 |
--------------------------------------------------------------------------------
/test/compat/core/data/compat.compact.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/test/compat/core/data/compat.compact.dat
--------------------------------------------------------------------------------
/test/compat/core/data/compat.compact2.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/test/compat/core/data/compat.compact2.dat
--------------------------------------------------------------------------------
/test/compat/core/data/compat.simple2.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/test/compat/core/data/compat.simple2.dat
--------------------------------------------------------------------------------
/compiler/tests/schema/example.bond:
--------------------------------------------------------------------------------
1 | namespace example.some
2 |
3 | struct SomeStruct
4 | {
5 | 0: int32 someField = 123;
6 | }
7 |
--------------------------------------------------------------------------------
/compiler/tests/schema/namespace_basic_types.bond:
--------------------------------------------------------------------------------
1 | namespace tests2
2 |
3 | struct OtherBasicTypes
4 | {
5 | 0: bool _bool;
6 | }
7 |
--------------------------------------------------------------------------------
/cpp/test/core/exception_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class ExceptionTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/cpp/test/core/metadata_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class MetadataTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/cpp/test/core/protocol_test.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class ProtocolTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
9 |
--------------------------------------------------------------------------------
/cpp/test/core/validate_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class ValidateTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "thirdparty/rapidjson"]
2 | path = thirdparty/rapidjson
3 | url = https://github.com/Tencent/rapidjson.git
4 |
--------------------------------------------------------------------------------
/cs/test/codegen/no-warnings/simple.bond:
--------------------------------------------------------------------------------
1 | namespace CodegenTest.NoWarnings;
2 |
3 | struct SimpleType
4 | {
5 | 0: int32 _int32;
6 | }
7 |
--------------------------------------------------------------------------------
/doc/src/logos/bond-logo-64x64-transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/doc/src/logos/bond-logo-64x64-transparent.png
--------------------------------------------------------------------------------
/examples/cpp/core/compile_time_schema/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (compile_time_schema compile_time_schema.bond compile_time_schema.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/modifying_transform/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (modifying_transform modifying_transform.bond modifying_transform.cpp)
2 |
--------------------------------------------------------------------------------
/compiler/tests/.gitignore:
--------------------------------------------------------------------------------
1 | generated/*_apply.*
2 | generated/allocator/*_apply.*
3 | generated/apply/*_types.*
4 | generated/apply/*_reflection.*
5 |
--------------------------------------------------------------------------------
/cpp/test/core/mafia_compat_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class MafiaCompatTest
4 | {
5 | public:
6 | static void Initialize();
7 | };
8 |
9 |
--------------------------------------------------------------------------------
/cs/test/codegen/output-no-slash/simple.bond:
--------------------------------------------------------------------------------
1 | namespace CodegenTest.OutputNoSlash;
2 |
3 | struct SimpleType
4 | {
5 | 0: int32 _int32;
6 | }
7 |
--------------------------------------------------------------------------------
/cs/test/core/import dir with spaces/dir1/dir2/Bond File With Spaces.bond:
--------------------------------------------------------------------------------
1 | namespace UnitTest
2 |
3 | struct EnsureSpacesInPathsWork
4 | {
5 | }
6 |
--------------------------------------------------------------------------------
/doc/src/logos/bond-logo-743x543-transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/doc/src/logos/bond-logo-743x543-transparent.png
--------------------------------------------------------------------------------
/doc/src/logos/bond-logo-743x743-transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/bond/HEAD/doc/src/logos/bond-logo-743x743-transparent.png
--------------------------------------------------------------------------------
/examples/cpp/core/protocol_transcoding/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (protocol_transcoding protocol_transcoding.bond protocol_transcoding.cpp)
2 |
--------------------------------------------------------------------------------
/examples/java/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | build/
3 |
4 | .gradle/
5 | gradle/
6 | gradlew
7 | gradlew.bat
8 |
9 | *.iml
10 | .idea/
11 | out/
12 |
--------------------------------------------------------------------------------
/java/gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.bondlib.gradle.properties:
--------------------------------------------------------------------------------
1 | implementation-class = org.bondlib.gradle.BondPlugin
2 |
--------------------------------------------------------------------------------
/examples/cpp/core/polymorphic_container/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (polymorphic_container polymorphic_container.bond polymorphic_container.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cs/core/import/common/common.bond:
--------------------------------------------------------------------------------
1 | namespace Examples.Common
2 |
3 | enum Priority
4 | {
5 | Low;
6 | Normal;
7 | High;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cpp/core/output_stream_allocator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (output_stream_allocator output_stream_allocator.bond output_stream_allocator.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cs/core/stream/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example
4 | {
5 | 0: string Name;
6 | 1: vector Constants;
7 | }
8 |
--------------------------------------------------------------------------------
/compiler/tests/schema/generics.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Foo
4 | {
5 | 0: T2 t2;
6 | 1: nullable> n;
7 | }
8 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/simple.bond:
--------------------------------------------------------------------------------
1 | namespace CodegenTest.DefaultIgnoresOutput;
2 |
3 | struct SimpleType
4 | {
5 | 0: int32 _int32;
6 | }
7 |
--------------------------------------------------------------------------------
/examples/cs/core/marshaling/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example
4 | {
5 | 0: string Name;
6 | 1: vector Constants;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/cs/core/serializer/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example
4 | {
5 | 0: string Name;
6 | 1: vector Constants;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/java/core/imports/src/main/bond/common/common.bond:
--------------------------------------------------------------------------------
1 | namespace Examples.Common
2 |
3 | enum Priority
4 | {
5 | Low;
6 | Normal;
7 | High;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cpp/core/import/import.bond:
--------------------------------------------------------------------------------
1 | import "bond/core/bond.bond"
2 |
3 | namespace examples.imports
4 |
5 | struct Struct
6 | {
7 | 0: bond.TypeDef type;
8 | }
9 |
--------------------------------------------------------------------------------
/compiler/tests/generated/empty_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "empty_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/schema/inheritance.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Base
4 | {
5 | 0: int32 x;
6 | }
7 |
8 | struct Foo : Base
9 | {
10 | 0: int32 x;
11 | }
12 |
--------------------------------------------------------------------------------
/examples/cpp/core/polymorphic_container_visitor/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_test (polymorphic_container_visitor polymorphic_container_visitor.bond polymorphic_container_visitor.cpp)
2 |
--------------------------------------------------------------------------------
/examples/cs/core/import/common/protocol/header.bond:
--------------------------------------------------------------------------------
1 | namespace Examples.Common.Protocol
2 |
3 | struct Header
4 | {
5 | 0: string Origin;
6 | 1: string Destination;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/cs/core/simple_json/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Config
4 | {
5 | 0: string Variant;
6 | 1: bool Enabled;
7 | 3: vector Urls;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cs/core/simple_xml/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Config
4 | {
5 | 0: string Variant;
6 | 1: bool Enabled;
7 | 3: vector Urls;
8 | }
9 |
--------------------------------------------------------------------------------
/compiler/tests/generated/generics_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "generics_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/java/.gitignore:
--------------------------------------------------------------------------------
1 | */.gradle/
2 | */gradle/
3 | */gradlew
4 | */gradlew.bat
5 | */.idea/libraries
6 | */.idea/uiDesigner.xml
7 | */.idea/workspace.xml
8 | */build/
9 | */out/
10 |
--------------------------------------------------------------------------------
/python/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (NOT BOND_SKIP_CORE_TESTS)
2 | add_subfolder (core "tests/python/unit_test/core")
3 | add_subfolder (compat "tests/python/compat")
4 | endif()
5 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/image-cleanup/collector/config.py:
--------------------------------------------------------------------------------
1 | """Constants for the garbage image collector."""
2 |
3 | REGISTRY_NAME = 'bondciimages'
4 | REPOSITORY_NAME = 'ubuntu-1604'
5 |
--------------------------------------------------------------------------------
/tools/syntax/SublimeText3/Readme.md:
--------------------------------------------------------------------------------
1 | #Bond Syntax Highlighting for SublimeText
2 |
3 | Install by adding to your user's directory
4 | ```%AppData%\Roaming\Sublime Text 3\Packages\User```
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/empty_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "empty_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/empty_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "empty_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/schema/field_modifiers.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Foo
4 | {
5 | 0: optional bool o;
6 | 1: required int16 r;
7 | 2: required_optional double ro;
8 | }
9 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/bin/should-not-be-compiled.bond:
--------------------------------------------------------------------------------
1 | This file should not be automatically added by the codegen targets because
2 | it is in one of the output directories.
3 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/obj/should-not-be-compiled.bond:
--------------------------------------------------------------------------------
1 | This file should not be automatically added by the codegen targets because
2 | it is in one of the output directories.
3 |
--------------------------------------------------------------------------------
/examples/cpp/core/record_streaming/record_streaming.bond:
--------------------------------------------------------------------------------
1 | namespace examples.record_streaming
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | }
8 |
--------------------------------------------------------------------------------
/examples/cs/core/record_streaming/record_streaming.bond:
--------------------------------------------------------------------------------
1 | namespace examples.record_streaming
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | }
8 |
--------------------------------------------------------------------------------
/compiler/tests/.gitattributes:
--------------------------------------------------------------------------------
1 | # For the generated files in the compiler test suite, we need these files to
2 | # be treated as-is to avoid spurious test failures.
3 |
4 | generated/** -text
5 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/generics_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "generics_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/empty_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "empty_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/empty_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "empty_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/schema/bond_meta.bond:
--------------------------------------------------------------------------------
1 | namespace deprecated.bondmeta;
2 |
3 | struct HasMetaFields
4 | {
5 | 0: bond_meta::full_name full_name;
6 | 1: bond_meta::name name;
7 | }
8 |
--------------------------------------------------------------------------------
/cpp/test/core/skip_tests.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class SkipTest
4 | {
5 | public:
6 | static void InitializeMismatchedIdTests();
7 | static void InitializeMismatchedTypeTests();
8 | };
9 |
--------------------------------------------------------------------------------
/examples/cs/core/decimal/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | using decimal = blob;
4 |
5 | struct Example
6 | {
7 | 0: decimal Price;
8 | 1: vector Numbers;
9 | }
10 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/generics_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "generics_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/generics_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "generics_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/examples/cpp/core/string_ref/string_ref.bond:
--------------------------------------------------------------------------------
1 | namespace examples.string_ref
2 |
3 | using string_ref = string;
4 |
5 | struct Example
6 | {
7 | 0: vector words;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/examples/cs/core/date_time/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | using DateTime = int64;
4 |
5 | struct Example
6 | {
7 | 0: DateTime Now;
8 | 1: vector Dates;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/java/core/imports/src/main/bond/common/protocol/header.bond:
--------------------------------------------------------------------------------
1 | namespace Examples.Common.Protocol
2 |
3 | struct Header
4 | {
5 | 0: string Origin;
6 | 1: string Destination;
7 | }
8 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/generics_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "generics_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | } // namespace tests
9 |
--------------------------------------------------------------------------------
/compiler/tests/schema/alias_key.bond:
--------------------------------------------------------------------------------
1 | namespace test
2 |
3 | using String = string;
4 | using Int = int32;
5 |
6 | struct foo
7 | {
8 | 0: map m;
9 | 1: set s;
10 | }
11 |
--------------------------------------------------------------------------------
/compiler/tests/schema/error/int_out_of_range.bond:
--------------------------------------------------------------------------------
1 |
2 | //this bond file is invalid; do not use as example
3 |
4 |
5 | namespace tests
6 |
7 | struct Test
8 | {
9 | 0: int16 i = 32768;
10 | }
--------------------------------------------------------------------------------
/compiler/tests/schema/error/service_invalid_base_type_param.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | // Invalid service definition with type param as base
4 | service Foo : T
5 | {
6 | nothing bar();
7 | }
8 |
--------------------------------------------------------------------------------
/examples/java/core/record_streaming/src/main/bond/record_streaming.bond:
--------------------------------------------------------------------------------
1 | namespace examples.record_streaming
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | }
8 |
--------------------------------------------------------------------------------
/java/core/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tools/syntax/Notepad-plus-plus/README.md:
--------------------------------------------------------------------------------
1 | #Installation Instructions for the Bond UDL:
2 |
3 |
4 | Import "bond.xml" via the Notepad++ menu,
5 |
6 | ```Language > Define your Language... > Import```
7 |
--------------------------------------------------------------------------------
/compiler/tests/generated/empty_reflection.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "empty_types.h"
5 | #include
6 |
7 | namespace tests
8 | {
9 |
10 | } // namespace tests
11 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/obj/debug/netstandard1.0/should-not-be-compiled.bond:
--------------------------------------------------------------------------------
1 | This file should not be automatically added by the codegen targets because
2 | it is in one of the output directories.
3 |
--------------------------------------------------------------------------------
/cs/test/core/Partial.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTest
2 | {
3 | public partial class BasicTypes
4 | {
5 | // static constructor
6 | static BasicTypes()
7 | { }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/cs/core/serialization/schema.bond:
--------------------------------------------------------------------------------
1 | namespace examples.serialization
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/java/compat/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test/compat/core/schemas/compat2.bond:
--------------------------------------------------------------------------------
1 | namespace unittest.compat.another
2 |
3 | enum EnumType
4 | {
5 | EnumValue1 = 6,
6 | };
7 |
8 |
9 | struct Another
10 | {
11 | 10: double d;
12 | };
13 |
--------------------------------------------------------------------------------
/compiler/tests/schema/nullable_alias.bond:
--------------------------------------------------------------------------------
1 | namespace test
2 |
3 | using LargeInt=int64;
4 | using time=int64;
5 |
6 | struct foo
7 | {
8 | 1: nullable l;
9 | 2: time t = nothing;
10 | }
11 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/obj/retail/netstandard1.0/should-not-be-compiled.bond:
--------------------------------------------------------------------------------
1 | This file should not be automatically added by the codegen targets because
2 | it is in one of the output directories.
3 |
--------------------------------------------------------------------------------
/examples/cpp/core/serialization/serialization.bond:
--------------------------------------------------------------------------------
1 | namespace examples.serialization
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cs/core/blob/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example
4 | {
5 | 0: vector ListOfBlobs;
6 | 1: nullable NullableBlob;
7 | 2: blob UninitializedBlob = nothing;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cs/core/container_alias/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | using CustomList = list;
4 |
5 | struct Example
6 | {
7 | 0: string Name;
8 | 1: CustomList Constants;
9 | }
10 |
--------------------------------------------------------------------------------
/java/gradle-plugin/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/empty_reflection.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "empty_types.h"
5 | #include
6 |
7 | namespace tests
8 | {
9 |
10 | } // namespace tests
11 |
--------------------------------------------------------------------------------
/java/core/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | rootProject.name = 'bond'
5 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/empty_reflection.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "empty_types.h"
5 | #include
6 |
7 | namespace tests
8 | {
9 |
10 | } // namespace tests
11 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/empty_reflection.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "empty_types.h"
5 | #include
6 |
7 | namespace tests
8 | {
9 |
10 | } // namespace tests
11 |
--------------------------------------------------------------------------------
/compiler/tests/schema/metadata_edge_cases.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Foo
4 | {
5 | 0: int32 id;
6 | 1: int32 metadata;
7 | 2: int32 id_type;
8 | 3: int32 x;
9 | 4: int32 x_type;
10 | }
11 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/empty_reflection.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include "empty_types.h"
5 | #include
6 |
7 | namespace tests
8 | {
9 |
10 | } // namespace tests
11 |
--------------------------------------------------------------------------------
/compiler/tests/schema/import.bond:
--------------------------------------------------------------------------------
1 | // Uses mixed slashes to test gbc can deal with that
2 | import "dir1/dir2\empty.bond"
3 |
4 | namespace import_test;
5 |
6 | struct HasEmpty
7 | {
8 | 0: empty.Empty e;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/cpp/core/protocol_versions/protocol_versions.bond:
--------------------------------------------------------------------------------
1 | namespace examples.protocol_versions
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cs/core/protocol_versions/protocol_versions.bond:
--------------------------------------------------------------------------------
1 | namespace examples.protocol_versions
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/java/core/blob/src/main/bond/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example
4 | {
5 | 0: vector ListOfBlobs;
6 | 1: nullable NullableBlob;
7 | 2: blob UninitializedBlob = nothing;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/java/core/serialization/src/main/bond/serialization.bond:
--------------------------------------------------------------------------------
1 | namespace examples.serialization
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/java/compat/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/java/compat/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required (VERSION 2.8.12)
2 |
3 | set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
4 |
5 | include (Java)
6 |
7 | add_gradle_build (java-compat
8 | DEPENDS java-core)
9 |
--------------------------------------------------------------------------------
/java/core/.idea/dictionaries/bond.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | codegen
5 | struct
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/java/core/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/java/json/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/compiler/tests/schema/error/aliases_default.bond:
--------------------------------------------------------------------------------
1 |
2 | //this bond file is invalid; do not use as example
3 |
4 |
5 | namespace tests
6 |
7 | using String = string;
8 |
9 | struct Test
10 | {
11 | 0: String s = 6;
12 | }
--------------------------------------------------------------------------------
/java/gradle-plugin/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/cmake/RunPythonTest.cmake:
--------------------------------------------------------------------------------
1 | set (ENV{PYTHONPATH} ${PYTHONPATH})
2 |
3 | execute_process (
4 | COMMAND ${PYTHON_EXECUTABLE} ${SCRIPT}
5 | RESULT_VARIABLE error)
6 |
7 | if (error)
8 | message (FATAL_ERROR)
9 | endif()
10 |
--------------------------------------------------------------------------------
/examples/cs/core/protocol_transcoding/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Widget
4 | {
5 | 0: string Name;
6 | 1: double Number;
7 | }
8 |
9 | struct Example
10 | {
11 | 0: vector Widgets;
12 | }
13 |
--------------------------------------------------------------------------------
/cpp/test/core/scope_test1.bond:
--------------------------------------------------------------------------------
1 | namespace x.y
2 |
3 | enum Enumeration
4 | {
5 | standard = 1,
6 | custom = 2,
7 | };
8 |
9 | struct Struct
10 | {
11 | 1: double value;
12 | 2: Enumeration field = standard;
13 | };
14 |
--------------------------------------------------------------------------------
/examples/java/core/protocol_versions/src/main/bond/protocol_versions.bond:
--------------------------------------------------------------------------------
1 | namespace examples.protocol_versions
2 |
3 | struct Struct
4 | {
5 | 0: uint32 n;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/java/gradle-plugin/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required (VERSION 2.8.12)
2 |
3 | set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
4 |
5 | include (Java)
6 |
7 | add_gradle_build (gradle-plugin
8 | GRADLE_TARGET install)
9 |
--------------------------------------------------------------------------------
/cs/build/nuget/Bond.CSharp.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/examples/cpp/core/inheritance/inheritance.bond:
--------------------------------------------------------------------------------
1 | namespace examples.inheritance
2 |
3 | struct Base
4 | {
5 | 1: string str = "base default";
6 | }
7 |
8 | struct Derived : Base
9 | {
10 | 1: string str = "derived default";
11 | }
12 |
--------------------------------------------------------------------------------
/examples/cpp/core/output_stream_allocator/output_stream_allocator.bond:
--------------------------------------------------------------------------------
1 | namespace examples.output_stream_allocator
2 |
3 | struct Struct
4 | {
5 | 0: uint32 num;
6 | 1: string str;
7 | 2: vector items;
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cpp/core/time_alias/time_alias.bond:
--------------------------------------------------------------------------------
1 | namespace examples.time
2 |
3 | // Define time to be an alias of int64
4 | using time = int64;
5 |
6 | struct Example
7 | {
8 | 0: time when;
9 | 1: map bdays;
10 | }
11 |
--------------------------------------------------------------------------------
/examples/cs/core/inheritance/inheritance.bond:
--------------------------------------------------------------------------------
1 | namespace examples.inheritance
2 |
3 | struct Base
4 | {
5 | 1: string str = "base default";
6 | }
7 |
8 | struct Derived : Base
9 | {
10 | 1: string str = "derived default";
11 | }
12 |
--------------------------------------------------------------------------------
/cpp/test/core/security.bond:
--------------------------------------------------------------------------------
1 | namespace security
2 |
3 | struct Base
4 | {
5 | 0: T x;
6 | }
7 |
8 | struct Struct : Base
9 | {
10 | 0: T3 n;
11 | 1: T1 y;
12 | 2: vector items;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/cpp/core/enumerations/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (enumerations.bond
2 | ENUM_HEADER)
3 |
4 | add_bond_test (enumerations
5 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/enumerations_types.cpp
6 | enumerations.cpp)
7 |
8 |
--------------------------------------------------------------------------------
/compiler/tests/schema/service_attributes.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Result{}
4 | struct Param{}
5 |
6 | [FooAttribute("Bar")]
7 | service Foo
8 | {
9 | [foo("method")]
10 | [method("")]
11 | Result foo(Param);
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/cs/build/nuget/Bond.Compiler.CSharp.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/examples/cpp/core/move_semantics/move_semantics.bond:
--------------------------------------------------------------------------------
1 | namespace examples.move_semantics
2 |
3 | struct Item
4 | {
5 | 0: string name;
6 | }
7 |
8 | struct Struct
9 | {
10 | 0: uint32 value;
11 | 1: optional vector- items;
12 | }
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # CMake
2 | # Our documentation recommends that the root directory /build/ be used for
3 | # CMake files.
4 | /build/
5 |
6 | # Emacs
7 | *~
8 | \#*\#
9 |
10 | # Vim
11 | *.swp
12 | *.swo
13 | *.swm
14 |
15 | # VS
16 | .vs/
17 | .vscode/
18 |
--------------------------------------------------------------------------------
/compiler/tests/schema/error/service_invalid_base_struct.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct dummy {
4 | 0: int32 count;
5 | }
6 |
7 | // Invalid service definition with struct as a base
8 | service Foo : dummy
9 | {
10 | nothing bar();
11 | }
12 |
--------------------------------------------------------------------------------
/examples/java/core/inheritance/src/main/bond/inheritance.bond:
--------------------------------------------------------------------------------
1 | namespace examples.inheritance
2 |
3 | struct Base
4 | {
5 | 1: string str = "base default";
6 | }
7 |
8 | struct Derived : Base
9 | {
10 | 1: string str = "derived default";
11 | }
12 |
--------------------------------------------------------------------------------
/java/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required (VERSION 2.8.12)
2 |
3 | set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
4 |
5 | include (Java)
6 |
7 | add_gradle_build (java-core
8 | GRADLE_TARGET install
9 | DEPENDS gradle-plugin)
10 |
--------------------------------------------------------------------------------
/examples/cpp/core/generics/generics.bond:
--------------------------------------------------------------------------------
1 | namespace examples.generics
2 |
3 | struct Base
4 | {
5 | 0: T x;
6 | }
7 |
8 | struct Struct : Base
9 | {
10 | 0: T3 n;
11 | 1: T1 y;
12 | 2: vector items;
13 | }
14 |
--------------------------------------------------------------------------------
/java/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Top-level meta-target to build the entire Java world. Implicitly depends on
2 | # all targets created by add_gradle_build.
3 | add_custom_target (java)
4 |
5 | add_subdirectory (gradle-plugin)
6 | add_subdirectory (core)
7 | add_subdirectory (compat)
8 |
--------------------------------------------------------------------------------
/compiler/tests/schema/error/struct_nothing.bond:
--------------------------------------------------------------------------------
1 |
2 | //this bond file is invalid; do not use as example
3 |
4 |
5 | namespace tests
6 |
7 | struct BasicTypes
8 | {
9 | 0: bool _bool;
10 | }
11 |
12 | struct Test
13 | {
14 | 0: BasicTypes bt = nothing;
15 | }
--------------------------------------------------------------------------------
/compiler/tests/schema/error/enum_no_default.bond:
--------------------------------------------------------------------------------
1 |
2 | //this bond file is invalid; do not use as example
3 |
4 |
5 | namespace tests
6 |
7 | enum Priority
8 | {
9 | Low;
10 | Normal;
11 | High;
12 | }
13 |
14 | struct Test
15 | {
16 | 0: Priority p;
17 | }
--------------------------------------------------------------------------------
/compiler/tests/schema/error/duplicate_service_method.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct dummy {
4 | 0: int32 count;
5 | }
6 |
7 | // Invalid service definition with two methods with the same name
8 | service Foo
9 | {
10 | void bar(dummy);
11 | nothing bar();
12 | }
--------------------------------------------------------------------------------
/examples/java/core/generics/src/main/bond/generics.bond:
--------------------------------------------------------------------------------
1 | namespace examples.generics
2 |
3 | struct Base
4 | {
5 | 0: T x;
6 | }
7 |
8 | struct Struct : Base
9 | {
10 | 0: T3 n;
11 | 1: T1 y;
12 | 2: vector items;
13 | }
14 |
--------------------------------------------------------------------------------
/python/test/compat/compat.cpp:
--------------------------------------------------------------------------------
1 | #include "compat_reflection.h"
2 | #include
3 |
4 | BOOST_PYTHON_MODULE(python_compatibility_test)
5 | {
6 | using namespace unittest::compat;
7 |
8 | bond::python::struct_()
9 | .def();
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Bond project has ended
2 |
3 | As of March 2025, the Bond open-source project has ended.
4 |
5 | There will be no further activity in this project. no new features, no bug
6 | fixes, and, importantly, no security fixes.
7 |
8 | See the [README](README.md) for more details.
9 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/README.md:
--------------------------------------------------------------------------------
1 | This test ensures that the .bond files automatically added to BondCodegen
2 | exclude files in the project's output paths.
3 |
4 | This directory has some files intentionally committed under the
5 | typically-ignored `bin/` and `obj/` paths.
6 |
--------------------------------------------------------------------------------
/examples/cs/core/untagged_protocols/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example1
4 | {
5 | 0: bool Enabled;
6 | 1: string Name;
7 | }
8 |
9 | struct Example2
10 | {
11 | 0: bool Enabled;
12 | 1: string Name;
13 | 2: nullable
> Numbers;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/cpp/core/container_of_pointers/container_of_pointers.bond:
--------------------------------------------------------------------------------
1 | namespace examples.container_of_pointers
2 |
3 | struct Item
4 | {
5 | 1: string foo;
6 | 2: uint16 bar;
7 | }
8 |
9 | using PtrList=list;
10 |
11 | struct Struct
12 | {
13 | 2: PtrList- items;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/cpp/core/marshaling/marshaling.bond:
--------------------------------------------------------------------------------
1 | namespace examples.marshaling
2 |
3 | struct A
4 | {
5 | 0: int32 x;
6 | }
7 |
8 | struct Struct
9 | {
10 | 0: uint32 n;
11 | 1: string str;
12 | 2: vector items;
13 | 3: bonded a;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/cs/core/generics/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Generic1
4 | {
5 | 0: nullable Field;
6 | }
7 |
8 | struct Generic2
9 | {
10 | 0: T Field = nothing;
11 | }
12 |
13 | struct Example
14 | {
15 | 0: Generic1> Field;
16 | }
17 |
--------------------------------------------------------------------------------
/java/compat/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/cpp/test/core/imports/dir1/dir2/import_test2.bond:
--------------------------------------------------------------------------------
1 | namespace import2
2 |
3 | enum ImportedEnum
4 | {
5 | ImportedEnum1 = 13,
6 | ImportedEnum2 = 23
7 | }
8 |
9 | struct Recursive;
10 |
11 | struct Recursive
12 | {
13 | 0: nullable> next;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/java/core/untagged_protocols/src/main/bond/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Example1
4 | {
5 | 0: bool Enabled;
6 | 1: string Name;
7 | }
8 |
9 | struct Example2
10 | {
11 | 0: bool Enabled;
12 | 1: string Name;
13 | 2: nullable
> Numbers;
14 | }
15 |
--------------------------------------------------------------------------------
/java/gradle-plugin/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/java/json/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | The Bond open-source project ended in March 2025. Contributions to this
4 | project are no longer being accepted.
5 |
6 | Microsoft has no affiliation with other open-source implementations of Bond.
7 | We cannot endorse any of them, and Microsoft will not provide any support.
8 |
--------------------------------------------------------------------------------
/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/cpp/core/dll/dllexample_dynlink.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #if defined(BUILDING_DLLEXAMPLE_DLL)
4 | #define DLLEXAMPLE_DYNLINK __declspec(dllexport)
5 | #elif defined(USING_DLLEXAMPLE_DLL)
6 | #define DLLEXAMPLE_DYNLINK __declspec(dllimport)
7 | #else
8 | #define DLLEXAMPLE_DYNLINK
9 | #endif
10 |
--------------------------------------------------------------------------------
/examples/cpp/core/scoped_allocator/scoped_alloc.bond:
--------------------------------------------------------------------------------
1 | namespace examples.scoped_allocator
2 |
3 | struct Strings
4 | {
5 | 0: vector strings;
6 | }
7 |
8 | struct Struct
9 | {
10 | 0: vector ints;
11 | 1: Strings strings;
12 | 2: vector strings_vector;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/cpp/core/static_library/lib/static_library.bond:
--------------------------------------------------------------------------------
1 | namespace examples.static_library
2 |
3 | struct Item
4 | {
5 | 0: string str = "default string value";
6 | 1: list numbers;
7 | }
8 |
9 | struct MyStruct
10 | {
11 | 0: vector- items;
12 | 1: bonded
- item;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/cs/core/cloning/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Document
4 | {
5 | 0: string Title;
6 | 1: set Authors;
7 | 2: vector Tags;
8 | 3: vector Content;
9 | }
10 |
11 | struct Outline
12 | {
13 | 0: string Title;
14 | 2: list Tags;
15 | }
16 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/build_cpp-common.zsh:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 |
3 | set -eux
4 |
5 | cmake -DBOND_STACK_OPTIONS="--allow-different-user" \
6 | -DCMAKE_CXX_FLAGS="$BOND_CXX_FLAGS" \
7 | -DCMAKE_C_FLAGS="$BOND_CC_FLAGS" \
8 | ${=BOND_CMAKE_FLAGS} \
9 | /root/bond
10 |
11 | make --jobs 2 check
12 |
--------------------------------------------------------------------------------
/examples/cpp/core/capped_allocator/capped_allocator.bond:
--------------------------------------------------------------------------------
1 | namespace examples.capped_allocator
2 |
3 | struct Strings
4 | {
5 | 0: vector strings;
6 | }
7 |
8 | struct Struct
9 | {
10 | 0: vector ints;
11 | 1: Strings strings;
12 | 2: vector strings_vector;
13 | }
14 |
--------------------------------------------------------------------------------
/java/core/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/java/core/src/test/bond/bonded.bond:
--------------------------------------------------------------------------------
1 | // Uses mixed slashes to test gbc can deal with that
2 | import "dir1\dir2/common.bond"
3 |
4 | namespace org.bondlib.test
5 |
6 | struct HasBondedField {
7 | 0: bonded bondedField;
8 | }
9 |
10 | struct BondedCollection {
11 | 0: list> bondeds;
12 | }
13 |
--------------------------------------------------------------------------------
/compiler/tests/schema/service_inheritance.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Params {}
4 | struct Result {}
5 |
6 | service Foo
7 | {
8 | Result foo(Params);
9 | }
10 |
11 | service Bar : Foo
12 | {
13 | Result bar(T);
14 | }
15 |
16 | service Bux : Bar
17 | {
18 | Result bux(Params);
19 | }
20 |
--------------------------------------------------------------------------------
/cpp/test/core/scope_test2.bond:
--------------------------------------------------------------------------------
1 | import "scope_test1.bond"
2 |
3 | namespace a.x.y
4 |
5 | enum Enumeration
6 | {
7 | standard = 2,
8 | };
9 |
10 | struct Struct
11 | {
12 | 1: Enumeration member = standard;
13 | };
14 |
15 | struct Derived : x.y.Struct
16 | {
17 | 1: x.y.Enumeration thing = custom;
18 | };
19 |
--------------------------------------------------------------------------------
/examples/cpp/core/modifying_transform/modifying_transform.bond:
--------------------------------------------------------------------------------
1 | namespace examples.modifying_transform
2 |
3 | struct Nested
4 | {
5 | 1: string str;
6 | }
7 |
8 |
9 | struct Base
10 | {
11 | 2: string str;
12 | }
13 |
14 |
15 | struct Struct : Base
16 | {
17 | 0: Nested n;
18 | 1: string str;
19 | }
20 |
--------------------------------------------------------------------------------
/examples/cpp/core/static_array/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (static_array.bond
2 | OPTIONS
3 | --using=\"array=std::array<{0}, {1}>\"
4 | --header=\"\")
5 |
6 | add_bond_test (static_array
7 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/static_array_types.cpp
8 | static_array.cpp)
9 |
--------------------------------------------------------------------------------
/java/compat/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cs/test/core/NamespaceConflictBond.bond:
--------------------------------------------------------------------------------
1 | namespace SomeNamespace.Bond
2 |
3 | // Having both namespaces UnitTest and UnitTest.Bond might cause compilation failures if the
4 | // codegen does not handle the global::Bond namespace correctly. The purpose of this file is
5 | // to ensure that this does not happen.
6 | struct Foo
7 | {
8 | }
9 |
--------------------------------------------------------------------------------
/examples/cs/core/runtime_schema/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Struct
4 | {
5 | 0: string String = "this is a string";
6 | }
7 |
8 | [StructAttribute("Value of the attribute")]
9 | struct Example
10 | {
11 | [FieldAttribute("Value of the attribute")]
12 | 0: map mapStruct1;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/java/core/runtime_schema/src/main/bond/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | struct Struct
4 | {
5 | 0: string String = "this is a string";
6 | }
7 |
8 | [StructAttribute("struct attribute")]
9 | struct Example
10 | {
11 | [FieldAttribute("field attribute")]
12 | 0: map mapStruct1;
13 | }
14 |
--------------------------------------------------------------------------------
/java/json/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cpp/inc/bond/core/containers.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #pragma once
5 |
6 | #include
7 |
8 | #include "bond_fwd.h"
9 | #include "maybe.h"
10 | #include "stl_containers.h"
11 |
--------------------------------------------------------------------------------
/cs/build/nuget/Bond.CSharp.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/compiler/tests/schema/attributes.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | [EnumAttribute1("one")]
4 | [EnumAttribute2("two")]
5 | enum Enum
6 | {
7 | Value1
8 | }
9 |
10 | [StructAttribute1("one")]
11 | [StructAttribute2("two")]
12 | struct Foo
13 | {
14 | [FieldAttribute1("one")]
15 | [FieldAttribute2("two")]
16 | 0: string f;
17 | }
18 |
--------------------------------------------------------------------------------
/doc/doxygen/bond_reference.css:
--------------------------------------------------------------------------------
1 | /* Customize doxygen CSS for Bond */
2 |
3 | .memTemplParams {
4 | font-size: 100%;
5 | }
6 |
7 | .memtemplate {
8 | font-size: 100%;
9 | }
10 |
11 | .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams, .memname, .memtemplate {
12 | font-family: monospace;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/examples/cpp/core/runtime_binding/runtime_binding.bond:
--------------------------------------------------------------------------------
1 | namespace examples.runtime_binding
2 |
3 | struct Struct
4 | {
5 | 0: uint32 number;
6 | 1: string name;
7 | 2: string address;
8 | 3: int16 age;
9 | }
10 |
11 |
12 | struct MyView
13 | {
14 | 5: string some_string;
15 | 8: int32 some_number;
16 | }
17 |
--------------------------------------------------------------------------------
/examples/cs/core/guid/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | // Two flavors of storing a GUID are demonstrated here:
4 | // the first uses a string and the second uses a binary blob.
5 |
6 | using guid_str = string;
7 | using guid_bin = blob;
8 |
9 | struct Example
10 | {
11 | 0: guid_str id_str;
12 | 1: guid_bin id_bin;
13 | }
14 |
--------------------------------------------------------------------------------
/java/gradle-plugin/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cpp/test/core/import_test1.bond:
--------------------------------------------------------------------------------
1 | // Uses mixed slashes to test gbc can deal with that
2 | import "dir1/dir2\import_test2.bond"
3 |
4 | namespace import1
5 | namespace csharp Microsoft.Import1
6 |
7 | struct ImportedStruct
8 | {
9 | 10: required_optional int32 x;
10 | 20: required_optional import2.ImportedEnum e = ImportedEnum2;
11 | };
12 |
--------------------------------------------------------------------------------
/cs/build/nuget/Bond.Compiler.CSharp.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/cpp/core/string_ref/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (string_ref.bond
2 | OPTIONS
3 | --using=\"string_ref=boost::string_ref\"
4 | --header=\"\"
5 | --type-aliases)
6 |
7 | add_bond_test (string_ref
8 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/string_ref_types.cpp
9 | string_ref.cpp)
10 |
--------------------------------------------------------------------------------
/examples/cpp/core/attributes/attributes.bond:
--------------------------------------------------------------------------------
1 | namespace examples.attributes
2 |
3 | struct Nested
4 | {
5 | [Min("10")]
6 | [Max("20")]
7 | 0: uint32 n;
8 |
9 | [Min("-3")]
10 | [Max("+3")]
11 | 1: int16 f;
12 | }
13 |
14 |
15 | struct Base
16 | {
17 | 2: Nested s;
18 | }
19 |
20 |
21 | struct Struct : Base
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/java/gradle-plugin/README.md:
--------------------------------------------------------------------------------
1 | To build with a development version of this plugin, enter the directory
2 | containing this README and repeat as follows:
3 |
4 | * write some code
5 | * `gradle build install`
6 |
7 | This will install the plugin to your local maven repository, which the other
8 | Java projects' build.gradles will use in preference to maven central.
9 |
--------------------------------------------------------------------------------
/compiler/tests/schema/generic_service.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct SomeBox
4 | {
5 | 0: T value;
6 | }
7 |
8 | service Foo
9 | {
10 | void foo31(Payload);
11 | Payload foo32(void);
12 | Payload foo33(Payload);
13 |
14 | void ConsumesGeneric1(SomeBox);
15 | void ConsumesGeneric2(SomeBox>);
16 | }
17 |
--------------------------------------------------------------------------------
/examples/cs/core/enumerations/enumerations.bond:
--------------------------------------------------------------------------------
1 | namespace Examples;
2 |
3 | enum Color
4 | {
5 | Orange = 1,
6 | Yellow = 2,
7 | }
8 |
9 | enum Fruit
10 | {
11 | Apple = 1,
12 | Orange = 2,
13 | }
14 |
15 | enum Limits
16 | {
17 | Int32Min = -2147483648,
18 | Int32Max = 2147483647,
19 | UInt32Min = 0,
20 | UInt32Max = 0xFFFFFFFF,
21 | }
22 |
--------------------------------------------------------------------------------
/examples/cpp/core/merge/merge.bond:
--------------------------------------------------------------------------------
1 | namespace examples.merge
2 |
3 | struct Base
4 | {
5 | 0: string str;
6 | }
7 |
8 | struct Item : Base
9 | {
10 | 0: float f;
11 | }
12 |
13 | struct Struct
14 | {
15 | 0: vector
- items;
16 | 1: Item item;
17 | }
18 |
19 | struct StructView
20 | {
21 | 0: vector items;
22 | 1: bonded item;
23 | }
24 |
--------------------------------------------------------------------------------
/compiler/tests/schema/complex_types.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct Foo {};
4 | struct Bar;
5 |
6 | struct ComplexTypes
7 | {
8 | 0: list li8;
9 | 1: set sb;
10 | 2: vector vb;
11 | 3: nullable nf;
12 | 4: map msws;
13 | 5: bonded bfoo;
14 | 6: map>>>> m;
15 | }
16 |
--------------------------------------------------------------------------------
/examples/cs/core/import/schema.bond:
--------------------------------------------------------------------------------
1 | import "common.bond"
2 | import "protocol/header.bond"
3 |
4 | namespace Examples
5 |
6 | struct Message
7 | {
8 | // To use a type from a different namespace, use its fully qualified name.
9 | 0: Examples.Common.Protocol.Header Header;
10 | 1: Examples.Common.Priority Priority = Normal;
11 | 2: uint32 MessagePayload;
12 | }
13 |
--------------------------------------------------------------------------------
/examples/cpp/core/dll/dll.bond:
--------------------------------------------------------------------------------
1 | namespace examples.dll
2 |
3 | enum Color
4 | {
5 | Red = 1;
6 | Blue = 2;
7 | }
8 |
9 | struct Item
10 | {
11 | 0: string str = "default string value";
12 | 1: list numbers;
13 | 3: Color color = Blue;
14 | }
15 |
16 | struct MyStruct
17 | {
18 | 0: vector
- > items;
19 | 1: bonded
- > item;
20 | }
21 |
--------------------------------------------------------------------------------
/examples/cpp/core/enumerations/enumerations.bond:
--------------------------------------------------------------------------------
1 | namespace examples.enumerations
2 |
3 | enum Color
4 | {
5 | Orange = 1,
6 | Yellow = 2,
7 | }
8 |
9 | enum Fruit
10 | {
11 | Apple = 1,
12 | Orange = 2,
13 | }
14 |
15 | enum Limits
16 | {
17 | Int32Min = -2147483648,
18 | Int32Max = 2147483647,
19 | UInt32Min = 0,
20 | UInt32Max = 0xFFFFFFFF,
21 | }
22 |
--------------------------------------------------------------------------------
/examples/java/core/enumerations/src/main/bond/enumerations.bond:
--------------------------------------------------------------------------------
1 | namespace Examples;
2 |
3 | enum Color
4 | {
5 | Orange = 1,
6 | Yellow = 2,
7 | }
8 |
9 | enum Fruit
10 | {
11 | Apple = 1,
12 | Orange = 2,
13 | }
14 |
15 | enum Limits
16 | {
17 | Int32Min = -2147483648,
18 | Int32Max = 2147483647,
19 | UInt32Min = 0,
20 | UInt32Max = 0xFFFFFFFF,
21 | }
22 |
--------------------------------------------------------------------------------
/examples/cpp/core/container_of_pointers/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (container_of_pointers.bond
2 | OPTIONS
3 | --using=\"PtrList=std::list >\"
4 | --header=\"\")
5 |
6 | add_bond_test (container_of_pointers
7 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/container_of_pointers_types.cpp
8 | container_of_pointers.cpp)
9 |
10 |
--------------------------------------------------------------------------------
/cpp/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Core unit tests don't build under VS2013 without this.
2 | cxx_add_compile_options(MSVC /EHa)
3 |
4 | if (NOT BOND_SKIP_COMPAT_TESTS)
5 | add_subfolder (compat/core "tests/compat/core")
6 | endif()
7 |
8 | if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
9 | if (NOT BOND_SKIP_CORE_TESTS)
10 | add_subfolder (core "tests/unit_test/core")
11 | endif()
12 | endif()
13 |
--------------------------------------------------------------------------------
/examples/java/core/imports/src/main/bond/schema.bond:
--------------------------------------------------------------------------------
1 | import "common.bond"
2 | import "protocol/header.bond"
3 |
4 | namespace Examples
5 |
6 | struct Message
7 | {
8 | // To use a type from a different namespace, use its fully qualified name.
9 | 0: Examples.Common.Protocol.Header Header;
10 | 1: Examples.Common.Priority Priority = Normal;
11 | 2: uint32 MessagePayload;
12 | }
13 |
--------------------------------------------------------------------------------
/compiler/tests/schema/aliases.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | using array = vector;
4 | using array10 = array<10, T>;
5 |
6 | struct Foo
7 | {
8 | 0: array10> aa;
9 | }
10 |
11 | using Wrapper = T;
12 |
13 | enum EnumToWrap
14 | {
15 | anEnumValue
16 | }
17 |
18 | struct WrappingAnEnum
19 | {
20 | 0: Wrapper aWrappedEnum = anEnumValue;
21 | }
22 |
--------------------------------------------------------------------------------
/examples/cpp/core/multiprecision/multiprecision.bond:
--------------------------------------------------------------------------------
1 | namespace examples.multiprecision
2 |
3 | // Type aliases for large integers
4 | using uint512 = blob;
5 | using uint1024 = blob;
6 |
7 | // Type alias for arbitrary precision integer
8 | using integer = blob;
9 |
10 | struct Example
11 | {
12 | 0: uint1024 private_key;
13 | 1: uint512 public_key;
14 | 2: integer product;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/examples/cpp/core/protocol_transcoding/protocol_transcoding.bond:
--------------------------------------------------------------------------------
1 | namespace examples.protocol_transcoding
2 |
3 | struct User
4 | {
5 | 0: string name;
6 | 1: string address;
7 | }
8 |
9 | struct Struct
10 | {
11 | 0: uint32 n;
12 | 1: string str;
13 | 2: vector items;
14 | 3: map users;
15 | }
16 |
--------------------------------------------------------------------------------
/examples/cpp/core/simple_json/simple_json.bond:
--------------------------------------------------------------------------------
1 | namespace examples.simple_json
2 |
3 | struct Window
4 | {
5 | 0: string title = "Sample Konfabulator Widget";
6 | 2: int16 width = 500;
7 | 3: int16 height = 500;
8 | }
9 |
10 | enum Mode
11 | {
12 | on,
13 | off
14 | }
15 |
16 | struct Widget
17 | {
18 | 0: Mode debug = on;
19 | 1: vector windows;
20 | }
21 |
--------------------------------------------------------------------------------
/cs/build/internal/DevVersions.cs:
--------------------------------------------------------------------------------
1 | // For development builds, we set the versions to 0.0.0.1. Official builds
2 | // generate different versions based on the package version and do not
3 | // actually compile this file.
4 | [assembly: System.Reflection.AssemblyVersion("0.0.0.1")]
5 | [assembly: System.Reflection.AssemblyFileVersion("0.0.0.1")]
6 | [assembly: System.Reflection.AssemblyInformationalVersion("0.0.0.1")]
7 |
--------------------------------------------------------------------------------
/examples/cpp/core/nothing_default/nothing_default.bond:
--------------------------------------------------------------------------------
1 | namespace examples.nothing_default
2 |
3 |
4 | struct Struct_v1
5 | {
6 | 1: required int32 foo = nothing;
7 | 2: optional list baz = nothing;
8 | }
9 |
10 |
11 | struct Struct_v2
12 | {
13 | 1: required int32 foo = nothing;
14 | 2: optional list baz = nothing;
15 | 3: optional double bar = nothing;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/examples/cpp/core/transform/transform.bond:
--------------------------------------------------------------------------------
1 | namespace examples.transform
2 |
3 | struct Struct_1_0
4 | {
5 | 10: uint32 n;
6 | 20: string name;
7 | 30: vector items;
8 | };
9 |
10 |
11 | struct Struct_2_0
12 | {
13 | 10: uint32 n;
14 | 21: string first_name;
15 | 22: string last_name;
16 | 30: vector items;
17 | };
18 |
--------------------------------------------------------------------------------
/examples/cs/core/nothing_default/nothing_default.bond:
--------------------------------------------------------------------------------
1 | namespace examples.nothing_default
2 |
3 |
4 | struct Struct_v1
5 | {
6 | 1: required int32 foo = nothing;
7 | 2: optional list baz = nothing;
8 | }
9 |
10 |
11 | struct Struct_v2
12 | {
13 | 1: required int32 foo = nothing;
14 | 2: optional list baz = nothing;
15 | 3: optional double bar = nothing;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/cpp/test/core/unit_test_limits.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #ifdef _DEBUG
6 | const uint32_t c_max_string_length = 20;
7 | const uint32_t c_max_list_size = 10;
8 | const uint32_t c_iterations = 1;
9 | #else
10 | const uint32_t c_max_string_length = 50;
11 | const uint32_t c_max_list_size = 20;
12 | const uint32_t c_iterations = 5;
13 | #endif
14 |
15 |
--------------------------------------------------------------------------------
/examples/cpp/core/scoped_allocator/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (scoped_alloc.bond
2 | OPTIONS
3 | --allocator=\"examples::scoped_allocator::MyAllocator\"
4 | --header=\\\"allocator.h\\\"
5 | --alloc-ctors
6 | --scoped-alloc)
7 |
8 | add_bond_test (scoped_alloc
9 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/scoped_alloc_types.cpp
10 | scoped_alloc.cpp)
11 |
--------------------------------------------------------------------------------
/examples/java/core/nothing_default/src/main/bond/nothing_default.bond:
--------------------------------------------------------------------------------
1 | namespace examples.nothing_default
2 |
3 |
4 | struct Struct_v1
5 | {
6 | 1: required int32 foo = nothing;
7 | 2: optional list baz = nothing;
8 | }
9 |
10 |
11 | struct Struct_v2
12 | {
13 | 1: required int32 foo = nothing;
14 | 2: optional list baz = nothing;
15 | 3: optional double bar = nothing;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/cpp/inc/bond/core/customize.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #pragma once
5 |
6 | #include
7 |
8 | #include "traits.h"
9 |
10 | namespace bond
11 | {
12 |
13 |
14 | template struct
15 | is_protocol_enabled
16 | : std::false_type {};
17 |
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/examples/cpp/core/runtime_schema/runtime_schema.bond:
--------------------------------------------------------------------------------
1 | namespace examples.runtime_schema
2 |
3 | struct Struct1
4 | {
5 | 0: uint32 n;
6 | 1: string str = "this is a string";
7 | 2: vector items;
8 | }
9 |
10 |
11 | struct Struct2
12 | {
13 | [MyAttribute("Value of the attribute")]
14 | 0: map mapStruct1;
15 | 1: nullable nullableStruct1;
16 | }
17 |
--------------------------------------------------------------------------------
/cs/.gitignore:
--------------------------------------------------------------------------------
1 | # Build and test artifacts
2 | bin/
3 | obj/
4 | TestResults/
5 | tools/
6 | Debug/
7 | Release/
8 |
9 | # Nuget packages
10 | packages/
11 |
12 | # Profiler artifacts
13 | *.exe.manifest
14 | *.vsp
15 |
16 | # Resharper cache
17 | _ReSharper.*
18 |
19 | # Visual Studio
20 | *.sdf
21 | *.suo
22 | *.user
23 | *.opendb
24 | *.opensdf
25 | *.psess
26 | *.VC.db
27 |
28 | # MSBuild binary log
29 | msbuild.binlog
30 |
--------------------------------------------------------------------------------
/examples/python/core/extension/extension.bond:
--------------------------------------------------------------------------------
1 | namespace example.python
2 |
3 | enum Color
4 | {
5 | Blue,
6 | Hazelnut,
7 | Green,
8 | Brown,
9 | Red
10 | }
11 |
12 |
13 | struct Person
14 | {
15 | 0: string first_name;
16 | 1: string last_name;
17 | 2: Color eyes = Brown;
18 | 3: blob hash;
19 | }
20 |
21 |
22 | struct Example
23 | {
24 | 0: map people;
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/java/gradle-plugin/src/main/groovy/org/bondlib/gradle/BondPlugin.groovy:
--------------------------------------------------------------------------------
1 | package org.bondlib.gradle
2 |
3 | import org.gradle.api.Plugin
4 | import org.gradle.api.Project
5 |
6 | class BondPlugin implements Plugin {
7 | @Override
8 | void apply(Project project) {
9 | project.tasks.create("compileBond", BondProdCodegen)
10 | project.tasks.create("compileTestBond", BondTestCodegen)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/cmake/FindJavaBuildTools.cmake:
--------------------------------------------------------------------------------
1 | find_program (GRADLE_EXECUTABLE gradle)
2 |
3 | if (GRADLE_EXECUTABLE)
4 | execute_process (
5 | COMMAND ${GRADLE_EXECUTABLE} --version
6 | OUTPUT_VARIABLE gradle_version)
7 | message (STATUS "gradle found at ${GRADLE_EXECUTABLE}")
8 | message (STATUS "${gradle_version}")
9 | else()
10 | message (FATAL_ERROR "gradle was not found. Java code cannot be built.")
11 | endif()
12 |
--------------------------------------------------------------------------------
/compiler/tests/generated/maybe_blob_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "maybe_blob_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Foo::Schema::metadata
9 | = Foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Foo::Schema::s_b_metadata
12 | = ::bond::reflection::MetadataInit(::bond::nothing, "b");
13 |
14 |
15 | } // namespace tests
16 |
--------------------------------------------------------------------------------
/cs/src/io/properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Reflection;
5 |
6 | [assembly: AssemblyTitle("Bond.IO")]
7 | [assembly: AssemblyCompany("Microsoft")]
8 | [assembly: AssemblyProduct("Bond")]
9 | [assembly: AssemblyCopyright("Copyright (C) Microsoft. All rights reserved.")]
10 |
--------------------------------------------------------------------------------
/examples/cs/.gitignore:
--------------------------------------------------------------------------------
1 | # Build and test artifacts
2 | bin/
3 | obj/
4 | TestResults/
5 | tools/
6 | Debug/
7 | Release/
8 |
9 | # Nuget packages
10 | packages/
11 |
12 | # Profiler artifacts
13 | *.exe.manifest
14 | *.vsp
15 |
16 | # Resharper cache
17 | _ReSharper.*
18 |
19 | # Visual Studio
20 | *.sdf
21 | *.suo
22 | *.user
23 | *.opendb
24 | *.opensdf
25 | *.psess
26 | *.VC.db
27 |
28 | # MSBuild binary log
29 | msbuild.binlog
30 |
--------------------------------------------------------------------------------
/examples/python/core/extension/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_python_module (python_extension
2 | extension.cpp
3 | extension.bond
4 | example.py)
5 |
6 | target_compile_definitions (python_extension PRIVATE
7 | -DBOND_COMPACT_BINARY_PROTOCOL
8 | -DBOND_SIMPLE_JSON_PROTOCOL)
9 |
10 | add_python_test (
11 | NAME python_extension
12 | MODULE python_extension
13 | SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/example.py)
14 |
--------------------------------------------------------------------------------
/cmake/NoDebug.cmake:
--------------------------------------------------------------------------------
1 | macro (_debug_none var)
2 | string (REPLACE /debug /debug:None ${var} ${${var}})
3 | endmacro()
4 |
5 | macro (no_pdb)
6 | if (MSVC)
7 | _debug_none (CMAKE_EXE_LINKER_FLAGS_DEBUG)
8 | _debug_none (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO)
9 | _debug_none (CMAKE_MODULE_LINKER_FLAGS_DEBUG)
10 | _debug_none (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO)
11 | endif()
12 | endmacro()
13 |
--------------------------------------------------------------------------------
/compiler/tests/generated/import_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "import_reflection.h"
3 | #include
4 |
5 | namespace import_test
6 | {
7 |
8 | const ::bond::Metadata HasEmpty::Schema::metadata
9 | = HasEmpty::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata HasEmpty::Schema::s_e_metadata
12 | = ::bond::reflection::MetadataInit("e");
13 |
14 |
15 | } // namespace import_test
16 |
--------------------------------------------------------------------------------
/cpp/test/core/precompiled.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #ifndef ENABLE_TEST_CASE
9 | # include
10 | #endif
11 |
12 | #include
13 | #include
14 |
15 | using namespace unittest;
16 |
17 | #include "unit_test_util.h"
18 |
--------------------------------------------------------------------------------
/cs/src/json/properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | using System.Reflection;
5 |
6 | [assembly: AssemblyTitle("Bond.JSON")]
7 | [assembly: AssemblyCompany("Microsoft")]
8 | [assembly: AssemblyProduct("Bond")]
9 | [assembly: AssemblyCopyright("Copyright (C) Microsoft. All rights reserved.")]
10 |
--------------------------------------------------------------------------------
/doc/src/reference_index.md:
--------------------------------------------------------------------------------
1 | Bond project has ended
2 | ======================
3 |
4 | As of March 2025, the Bond open-source project has ended. There will be no
5 | further activity in this project: no new features, no bug fixes, and,
6 | importantly, no security fixes.
7 |
8 | The documentation as it existed at the time of the end of the project
9 | follows.
10 |
11 | Bond Reference
12 | ==============
13 |
14 | - [C++](cpp\index.html)
15 |
--------------------------------------------------------------------------------
/examples/cpp/core/compile_time_schema/compile_time_schema.bond:
--------------------------------------------------------------------------------
1 | namespace examples.compile_time_schema
2 |
3 | struct Struct1
4 | {
5 | 0: uint32 n;
6 | 1: string str = "this is a string";
7 | 2: vector items;
8 | }
9 |
10 |
11 | struct Struct2
12 | {
13 | [MyAttribute("Value of the attribute")]
14 | 0: map mapStruct1;
15 | 1: nullable nullableStruct1;
16 | }
17 |
--------------------------------------------------------------------------------
/examples/cpp/core/time_alias/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (time_alias.bond
2 | OPTIONS
3 | --using=\"time=boost::posix_time::ptime\"
4 | --header=\"\"
5 | --type-aliases)
6 |
7 | add_bond_test (time_alias
8 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/time_alias_types.cpp
9 | time_alias.cpp)
10 |
11 | target_link_libraries (time_alias PRIVATE
12 | ${Boost_DATE_TIME_LIBRARY})
13 |
--------------------------------------------------------------------------------
/examples/python/core/extension/extension.cpp:
--------------------------------------------------------------------------------
1 | #include "extension_reflection.h"
2 | #include
3 |
4 | BOOST_PYTHON_MODULE(python_extension)
5 | {
6 | using namespace example::python;
7 |
8 | // Expose the Example struct to Python.
9 | // Any other structs or enums referenced by Example are automatically
10 | // exposed as well.
11 | bond::python::struct_()
12 | .def();
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/maybe_blob_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "maybe_blob_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Foo::Schema::metadata
9 | = Foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Foo::Schema::s_b_metadata
12 | = ::bond::reflection::MetadataInit(::bond::nothing, "b");
13 |
14 |
15 | } // namespace tests
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/import_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "import_reflection.h"
3 | #include
4 |
5 | namespace import_test
6 | {
7 |
8 | const ::bond::Metadata HasEmpty::Schema::metadata
9 | = HasEmpty::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata HasEmpty::Schema::s_e_metadata
12 | = ::bond::reflection::MetadataInit("e");
13 |
14 |
15 | } // namespace import_test
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/maybe_blob_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "maybe_blob_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Foo::Schema::metadata
9 | = Foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Foo::Schema::s_b_metadata
12 | = ::bond::reflection::MetadataInit(::bond::nothing, "b");
13 |
14 |
15 | } // namespace tests
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/import_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "import_reflection.h"
3 | #include
4 |
5 | namespace import_test
6 | {
7 |
8 | const ::bond::Metadata HasEmpty::Schema::metadata
9 | = HasEmpty::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata HasEmpty::Schema::s_e_metadata
12 | = ::bond::reflection::MetadataInit("e");
13 |
14 |
15 | } // namespace import_test
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/import_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "import_reflection.h"
3 | #include
4 |
5 | namespace import_test
6 | {
7 |
8 | const ::bond::Metadata HasEmpty::Schema::metadata
9 | = HasEmpty::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata HasEmpty::Schema::s_e_metadata
12 | = ::bond::reflection::MetadataInit("e");
13 |
14 |
15 | } // namespace import_test
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/maybe_blob_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "maybe_blob_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Foo::Schema::metadata
9 | = Foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Foo::Schema::s_b_metadata
12 | = ::bond::reflection::MetadataInit(::bond::nothing, "b");
13 |
14 |
15 | } // namespace tests
16 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/build_hs.zsh:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 |
3 | set -eux
4 |
5 | local BOND_CMAKE_FLAGS="$BOND_CMAKE_FLAGS -DBOND_SKIP_CORE_TESTS=TRUE"
6 | cmake \
7 | -DBOND_STACK_OPTIONS="--allow-different-user" \
8 | -DCMAKE_CXX_FLAGS="$BOND_CXX_FLAGS" -DCMAKE_C_FLAGS="$BOND_CC_FLAGS" \
9 | ${=BOND_CMAKE_FLAGS} \
10 | $BOND_ROOT
11 |
12 | make gbc-tests
13 |
14 | cd $BOND_ROOT/compiler
15 | $BUILD_ROOT/compiler/build/gbc-tests/gbc-tests
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/import_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "import_reflection.h"
3 | #include
4 |
5 | namespace import_test
6 | {
7 |
8 | const ::bond::Metadata HasEmpty::Schema::metadata
9 | = HasEmpty::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata HasEmpty::Schema::s_e_metadata
12 | = ::bond::reflection::MetadataInit("e");
13 |
14 |
15 | } // namespace import_test
16 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/maybe_blob_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "maybe_blob_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Foo::Schema::metadata
9 | = Foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Foo::Schema::s_b_metadata
12 | = ::bond::reflection::MetadataInit(::bond::nothing, "b");
13 |
14 |
15 | } // namespace tests
16 |
--------------------------------------------------------------------------------
/examples/cpp/core/schema_view/schema_view.bond:
--------------------------------------------------------------------------------
1 | namespace examples.schema_view
2 |
3 |
4 | struct Example
5 | {
6 | 0: uint32 num;
7 | 1: string str;
8 | 2: vector items;
9 | }
10 |
11 |
12 | // ExampleView is a view of Example containing two fields: num and str.
13 | // In every other respect struct ExampleView will be identical to Example.
14 | struct ExampleView view_of Example
15 | {
16 | num, str;
17 | }
18 |
--------------------------------------------------------------------------------
/examples/cs/core/schema_view/schema_view.bond:
--------------------------------------------------------------------------------
1 | namespace examples.schema_view
2 |
3 |
4 | struct Example
5 | {
6 | 0: uint32 num;
7 | 1: string str;
8 | 2: vector items;
9 | }
10 |
11 |
12 | // ExampleView is a view of Example containing two fields: num and str.
13 | // In every other respect struct ExampleView will be identical to Example.
14 | struct ExampleView view_of Example
15 | {
16 | num, str;
17 | }
18 |
--------------------------------------------------------------------------------
/doc/doxygen/doxygen.cmake:
--------------------------------------------------------------------------------
1 | # Doxygen doesn't allow specifying output directory via command line arguments
2 | # so we need this silly workaround to set environment variable that is then
3 | # used in the .doxygen file.
4 | set (ENV{BOND_DOXYGEN_OUTPUT_DIR} ${Doxygen_OUTPUT_DIR})
5 |
6 | execute_process (
7 | COMMAND ${Doxygen_EXECUTABLE} doxygen/bond.doxygen
8 | RESULT_VARIABLE error)
9 |
10 | if (error)
11 | message (FATAL_ERROR)
12 | endif()
13 |
--------------------------------------------------------------------------------
/compiler/tests/schema/basic_types.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct BasicTypes
4 | {
5 | 0: bool _bool;
6 | 2: string _str;
7 | 3: wstring _wstr;
8 | 14: int8 _int8;
9 | 15: int16 _int16;
10 | 16: int32 _int32;
11 | 17: int64 _int64;
12 | 13: uint8 _uint8;
13 | 11: uint16 _uint16;
14 | 12: uint32 _uint32;
15 | 10: uint64 _uint64;
16 | 18: double _double;
17 | 20: float _float;
18 | 21: blob _blob;
19 | }
20 |
--------------------------------------------------------------------------------
/examples/java/core/schema_view/src/main/bond/schema_view.bond:
--------------------------------------------------------------------------------
1 | namespace examples.schema_view
2 |
3 |
4 | struct Example
5 | {
6 | 0: uint32 num;
7 | 1: string str;
8 | 2: vector items;
9 | }
10 |
11 |
12 | // ExampleView is a view of Example containing two fields: num and str.
13 | // In every other respect struct ExampleView will be identical to Example.
14 | struct ExampleView view_of Example
15 | {
16 | num, str;
17 | }
18 |
--------------------------------------------------------------------------------
/python/test/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_python_module (python_unit_test
2 | unit_test.cpp
3 | unit_test.bond
4 | unit_test.py)
5 |
6 | target_compile_definitions (python_unit_test PRIVATE
7 | -DBOND_COMPACT_BINARY_PROTOCOL)
8 |
9 | # disable generation of debug symbols to speed up build
10 | no_pdb()
11 |
12 | add_python_test (
13 | NAME python_unit_test
14 | MODULE python_unit_test
15 | SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/unit_test.py)
16 |
--------------------------------------------------------------------------------
/compiler/tests/schema/basic_types_nsmapped.bond:
--------------------------------------------------------------------------------
1 | namespace tests
2 |
3 | struct BasicTypes
4 | {
5 | 0: bool _bool;
6 | 2: string _str;
7 | 3: wstring _wstr;
8 | 14: int8 _int8;
9 | 15: int16 _int16;
10 | 16: int32 _int32;
11 | 17: int64 _int64;
12 | 13: uint8 _uint8;
13 | 11: uint16 _uint16;
14 | 12: uint32 _uint32;
15 | 10: uint64 _uint64;
16 | 18: double _double;
17 | 20: float _float;
18 | 21: blob _blob;
19 | }
20 |
--------------------------------------------------------------------------------
/java/core/src/test/bond/imports/dir1/dir2/common.bond:
--------------------------------------------------------------------------------
1 | namespace org.bondlib.test
2 |
3 | enum MonthOfYear {
4 | January = 1,
5 | February,
6 | March,
7 | April,
8 | May,
9 | June,
10 | July,
11 | August,
12 | September,
13 | October,
14 | November,
15 | December
16 | }
17 |
18 | struct Empty {}
19 |
20 | struct Base {
21 | 0: int32 baseInt;
22 | }
23 |
24 | struct Derived : Base {
25 | 0: int32 derivedInt;
26 | }
27 |
--------------------------------------------------------------------------------
/examples/cs/core/polymorphic_container/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | enum Type
4 | {
5 | Unknown,
6 | Circle,
7 | Rectangle
8 | }
9 |
10 | struct Shape
11 | {
12 | 0: Type Type = Unknown;
13 | }
14 |
15 | struct Circle : Shape
16 | {
17 | 0: double Radius;
18 | }
19 |
20 | struct Rectangle : Shape
21 | {
22 | 0: double Width;
23 | 1: double Height;
24 | }
25 |
26 | struct Polymorphic
27 | {
28 | 0: vector> Shapes;
29 | }
30 |
--------------------------------------------------------------------------------
/examples/cpp/core/generic_tree/generic_tree.bond:
--------------------------------------------------------------------------------
1 | namespace examples.generic_tree
2 |
3 | // For recursive data structures, a forward declaration is needed so Node
4 | // can refer back to itself.
5 | struct Node;
6 |
7 | struct Node
8 | {
9 | // In order to prevent infinite recursion, a nullable> field
10 | // must be used to hold other Nodes.
11 | 0: nullable> left;
12 | 1: nullable> right;
13 | 2: T data;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/cs/core/generic_tree/generic_tree.bond:
--------------------------------------------------------------------------------
1 | namespace examples.generic_tree
2 |
3 | // For recursive data structures, a forward declaration is needed so Node
4 | // can refer back to itself.
5 | struct Node;
6 |
7 | struct Node
8 | {
9 | // In order to prevent infinite recursion, a nullable> field
10 | // must be used to hold other Nodes.
11 | 0: nullable> left;
12 | 1: nullable> right;
13 | 2: T data;
14 | }
15 |
--------------------------------------------------------------------------------
/tools/syntax/VsCode/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | {
3 | "version": "0.1.0",
4 | "configurations": [
5 | {
6 | "name": "Launch Extension",
7 | "type": "extensionHost",
8 | "request": "launch",
9 | "runtimeExecutable": "${execPath}",
10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ]
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/cmake/FindStack.cmake:
--------------------------------------------------------------------------------
1 | FIND_PROGRAM(STACK_EXECUTABLE stack)
2 |
3 | SET(STACK_FOUND FALSE)
4 |
5 | IF (STACK_EXECUTABLE)
6 | SET(STACK_FOUND TRUE)
7 |
8 | execute_process (
9 | COMMAND ${STACK_EXECUTABLE} --version
10 | OUTPUT_VARIABLE stack_version)
11 |
12 | string (STRIP ${stack_version} stack_version)
13 |
14 | MESSAGE(STATUS "Stack found at ${STACK_EXECUTABLE}. ${stack_version}")
15 | ELSE()
16 | MESSAGE(FATAL_ERROR "Stack was not found.")
17 | ENDIF()
18 |
--------------------------------------------------------------------------------
/cpp/src/bond/protocol/detail/rapidjson_utils.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #include
5 |
6 | #if BOND_LIB_TYPE == BOND_LIB_TYPE_HEADER
7 | #error This source file should not be compiled for BOND_LIB_TYPE_HEADER
8 | #endif
9 |
10 | #include
11 | #include
12 |
--------------------------------------------------------------------------------
/cs/test/core/Containers.bond:
--------------------------------------------------------------------------------
1 | import "UnitTest.bond"
2 |
3 | namespace UnitTest
4 |
5 | struct NestedContainers
6 | {
7 | 0: vector> vvb;
8 | 1: list>> vnc;
9 | 2: vector> vvbt;
10 | 3: vector
> vln;
11 | 4: list> lvs;
12 | 5: list> lsf;
13 | 6: vector> vsb;
14 | 7: map> mslb;
15 | 8: map> mimbn;
16 | }
17 |
--------------------------------------------------------------------------------
/examples/java/core/generic_tree/src/main/bond/generic_tree.bond:
--------------------------------------------------------------------------------
1 | namespace examples.generic_tree
2 |
3 | // For recursive data structures, a forward declaration is needed so Node
4 | // can refer back to itself.
5 | struct Node;
6 |
7 | struct Node
8 | {
9 | // In order to prevent infinite recursion, a nullable> field
10 | // must be used to hold other Nodes.
11 | 0: nullable> left;
12 | 1: nullable> right;
13 | 2: T data;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/java/core/polymorphic_container/src/main/bond/schema.bond:
--------------------------------------------------------------------------------
1 | namespace Examples
2 |
3 | enum Type
4 | {
5 | Unknown,
6 | Circle,
7 | Rectangle
8 | }
9 |
10 | struct Shape
11 | {
12 | 0: Type Type = Unknown;
13 | }
14 |
15 | struct Circle : Shape
16 | {
17 | 0: double Radius;
18 | }
19 |
20 | struct Rectangle : Shape
21 | {
22 | 0: double Width;
23 | 1: double Height;
24 | }
25 |
26 | struct Polymorphic
27 | {
28 | 0: vector> Shapes;
29 | }
30 |
--------------------------------------------------------------------------------
/python/test/compat/compat.cmake:
--------------------------------------------------------------------------------
1 | set (ENV{PYTHONPATH} ${PYTHON_COMPAT})
2 |
3 | function (run)
4 | execute_process (
5 | COMMAND ${ARGV}
6 | RESULT_VARIABLE error)
7 | if (error)
8 | message (FATAL_ERROR)
9 | endif()
10 | endfunction()
11 |
12 | run (${PYTHON_EXECUTABLE} ${SOURCE_DIR}/compat.py -d ${COMPAT_DATA}/compat.${TEST}.dat -s compat.${TEST}.py.dat ${TEST})
13 | run (${BOND_COMPAT} ${TEST} -d compat.${TEST}.py.dat expected.py.${TEST} deserialized.py.${TEST})
14 |
--------------------------------------------------------------------------------
/cs/src/core/expressions/ISerializerGenerator.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace Bond.Expressions
5 | {
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq.Expressions;
9 |
10 | public interface ISerializerGenerator
11 | {
12 | IEnumerable>> Generate(IParser parser);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/cs/test/codegen/default-ignore-output/ConsumeCodegen.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace CodegenTest.DefaultIgnoresOutput
5 | {
6 | public static class UsesCodegen
7 | {
8 | public static SimpleType Make()
9 | {
10 | return new SimpleType
11 | {
12 | _int32 = 42,
13 | };
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/cpp/core/static_array/static_array.bond:
--------------------------------------------------------------------------------
1 | namespace examples.static_array
2 |
3 | // Define array as an alias of vector
4 | using array = vector;
5 |
6 | struct Example
7 | {
8 | // Static array of 64 32-bit integers
9 | // Since std::array does not have a concept of default value we need to
10 | // make the field required in order to avoid debug assert saying that we
11 | // are trying to deserialize into non-clean object.
12 | 0: required array features;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/cs/test/core/ReadOnly.bond:
--------------------------------------------------------------------------------
1 | import "UnitTest.bond"
2 |
3 | namespace UnitTest.Readonly
4 |
5 | struct BasicTypes view_of UnitTest.BasicTypes
6 | {
7 | _bool;
8 | _str;
9 | _wstr;
10 | _int8;
11 | _int16;
12 | _int32;
13 | _int64;
14 | _uint8;
15 | _uint16;
16 | _uint32;
17 | _uint64;
18 | _double;
19 | _float;
20 | _enum1;
21 | };
22 |
23 | struct SimpleContainers view_of UnitTest.SimpleContainers
24 | {
25 | strings;
26 | basics;
27 | numbers;
28 | };
29 |
--------------------------------------------------------------------------------
/java/core/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/java/json/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tools/ci-scripts/linux/image-cleanup/mypy.ini:
--------------------------------------------------------------------------------
1 | [mypy]
2 | warn_no_return=True
3 | warn_unused_configs=True
4 |
5 | # The same set of flags as enabled by --strict
6 | check-untyped-defs=True
7 | disallow-incomplete-defs=True
8 | disallow-subclassing-any=True
9 | disallow-untyped-calls=True
10 | disallow-untyped-decorators=True
11 | disallow-untyped-defs=True
12 | no-implicit-optional=True
13 | strict-optional=True
14 | warn-redundant-casts=True
15 | warn-return-any=True
16 | warn-unused-configs=True
17 | warn-unused-ignores=True
18 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alias_key_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "alias_key_reflection.h"
3 | #include
4 |
5 | namespace test
6 | {
7 |
8 | const ::bond::Metadata foo::Schema::metadata
9 | = foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata foo::Schema::s_m_metadata
12 | = ::bond::reflection::MetadataInit("m");
13 |
14 | const ::bond::Metadata foo::Schema::s_s_metadata
15 | = ::bond::reflection::MetadataInit("s");
16 |
17 |
18 | } // namespace test
19 |
--------------------------------------------------------------------------------
/cpp/test/compat/core/compat.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "compat_types.h"
4 | #include "compat_no_generics_types.h"
5 | #include "cmd_arg_types.h"
6 | #include
7 |
8 | using namespace unittest::compat;
9 |
10 | void Init(Test test, Compat& obj);
11 | bond::blob Serialize(Test test, const Compat& obj);
12 | void Deserialize(Test test, const bond::blob& buffer, Compat& obj, bond::SchemaDef& schema);
13 | void Convert(const Compat& from, CompatNoGenerics& to);
14 |
15 | const int MAX_SIZE = 6 * 1024 * 1024;
16 |
--------------------------------------------------------------------------------
/java/compat/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/java/gradle-plugin/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/alias_key_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "alias_key_reflection.h"
3 | #include
4 |
5 | namespace test
6 | {
7 |
8 | const ::bond::Metadata foo::Schema::metadata
9 | = foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata foo::Schema::s_m_metadata
12 | = ::bond::reflection::MetadataInit("m");
13 |
14 | const ::bond::Metadata foo::Schema::s_s_metadata
15 | = ::bond::reflection::MetadataInit("s");
16 |
17 |
18 | } // namespace test
19 |
--------------------------------------------------------------------------------
/cpp/inc/bond/core/detail/nonassignable.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #pragma once
5 |
6 | #include
7 |
8 | namespace bond
9 | {
10 | namespace detail
11 | {
12 | class nonassignable
13 | {
14 | protected:
15 | nonassignable() {}
16 | ~nonassignable() {}
17 | private:
18 | nonassignable& operator=(const nonassignable&);
19 | };
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/alias_key_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "alias_key_reflection.h"
3 | #include
4 |
5 | namespace test
6 | {
7 |
8 | const ::bond::Metadata foo::Schema::metadata
9 | = foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata foo::Schema::s_m_metadata
12 | = ::bond::reflection::MetadataInit("m");
13 |
14 | const ::bond::Metadata foo::Schema::s_s_metadata
15 | = ::bond::reflection::MetadataInit("s");
16 |
17 |
18 | } // namespace test
19 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/alias_key_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "alias_key_reflection.h"
3 | #include
4 |
5 | namespace test
6 | {
7 |
8 | const ::bond::Metadata foo::Schema::metadata
9 | = foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata foo::Schema::s_m_metadata
12 | = ::bond::reflection::MetadataInit("m");
13 |
14 | const ::bond::Metadata foo::Schema::s_s_metadata
15 | = ::bond::reflection::MetadataInit("s");
16 |
17 |
18 | } // namespace test
19 |
--------------------------------------------------------------------------------
/compiler/tests/schema/bond_meta.json:
--------------------------------------------------------------------------------
1 | {"namespaces":[{"name":["deprecated","bondmeta"]}],"imports":[],"declarations":[{"structBase":null,"tag":"Struct","structFields":[{"fieldModifier":"Optional","fieldDefault":null,"fieldType":"bond_meta::full_name","fieldName":"full_name","fieldAttributes":[],"fieldOrdinal":0},{"fieldModifier":"Optional","fieldDefault":null,"fieldType":"bond_meta::name","fieldName":"name","fieldAttributes":[],"fieldOrdinal":1}],"declParams":[],"declNamespaces":[{"name":["deprecated","bondmeta"]}],"declName":"HasMetaFields","declAttributes":[]}]}
--------------------------------------------------------------------------------
/cs/src/core/io/ICloneable.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace Bond.IO
5 | {
6 | ///
7 | /// Clones an input stream or protocol reader
8 | ///
9 | /// Object type
10 | public interface ICloneable
11 | {
12 | ///
13 | /// Create a clone
14 | ///
15 | T Clone();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tools/syntax/VsCode/bond.configuration.json:
--------------------------------------------------------------------------------
1 | {
2 | "comments": {
3 | // symbol used for single line comment. Remove this entry if your language does not support line comments
4 | "lineComment": "//",
5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6 | "blockComment": [ "/*", "*/" ]
7 | },
8 | // symbols used as brackets
9 | "brackets": [
10 | ["{", "}"],
11 | ["[", "]"],
12 | ["(", ")"]
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/alias_key_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "alias_key_reflection.h"
3 | #include
4 |
5 | namespace test
6 | {
7 |
8 | const ::bond::Metadata foo::Schema::metadata
9 | = foo::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata foo::Schema::s_m_metadata
12 | = ::bond::reflection::MetadataInit("m");
13 |
14 | const ::bond::Metadata foo::Schema::s_s_metadata
15 | = ::bond::reflection::MetadataInit("s");
16 |
17 |
18 | } // namespace test
19 |
--------------------------------------------------------------------------------
/examples/cpp/core/access_control/access_control.bond:
--------------------------------------------------------------------------------
1 | namespace examples.access_control
2 |
3 | struct Person
4 | {
5 | [ACL("identity")]
6 | 0: string name;
7 | }
8 |
9 | struct Employee : Person
10 | {
11 | [ACL("location")]
12 | 0: string address;
13 | }
14 |
15 | struct Company
16 | {
17 | [ACL("identity")]
18 | 0: string ticker;
19 |
20 | [ACL("location")]
21 | 1: string city;
22 |
23 | [ACL("all")]
24 | 2: vector employees;
25 |
26 | [ACL("identity")]
27 | 3: Employee ceo;
28 | }
29 |
--------------------------------------------------------------------------------
/compiler/tests/generated/schemadef/example.SomeStruct.json:
--------------------------------------------------------------------------------
1 | {
2 | "structs": [
3 | {
4 | "fields": [
5 | {
6 | "id": 0,
7 | "metadata": {
8 | "default_value": {
9 | "int_value": 123
10 | },
11 | "name": "someField"
12 | },
13 | "type": {
14 | "id": 16
15 | }
16 | }
17 | ],
18 | "metadata": {
19 | "name": "SomeStruct",
20 | "qualified_name": "example.some.SomeStruct"
21 | }
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/cs/test/core/NamespaceConflict.bond:
--------------------------------------------------------------------------------
1 | namespace SomeNamespace
2 |
3 | // Having both namespaces X and X.Bond might cause compilation failures if the
4 | // codegen does not handle the global::Bond namespace correctly. The purpose of this file is
5 | // to ensure that this does not happen.
6 | [someAttribute("foo")]
7 | struct Foo
8 | {
9 | [someAttribute("bar")]
10 | 1: wstring wstring_field;
11 |
12 | 2: nullable nullable_field;
13 |
14 | 3: required bonded generic_field;
15 |
16 | 4: required_optional bool required_optional_field;
17 | }
18 |
--------------------------------------------------------------------------------
/cs/nuget/.dir-locals.el:
--------------------------------------------------------------------------------
1 | ;;; Directory Local Variables
2 | ;;; For more information see (info "(emacs) Directory Variables")
3 |
4 | (
5 | ; In the .nuspec files we want line sorting for things like to
6 | ; be CASE SENSITIVE, otherwise Bond.dll and Bond.xml get sorted really far
7 | ; away from each other.
8 | (nil . ((sort-fold-case . nil)))
9 | ; The nuspec files in this directory are indented with four spaces per
10 | ; level, instead of the typical two for XML-things in the .NET world (like
11 | ; .csproj files).
12 | (nxml-mode . ((nxml-child-indent . 4))))
13 |
--------------------------------------------------------------------------------
/cpp/inc/bond/core/box.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #pragma once
5 |
6 | #include
7 |
8 | #include
9 |
10 | #include
11 |
12 |
13 | namespace bond
14 | {
15 |
16 | template
17 | Box::type> make_box(T&& value)
18 | {
19 | Box::type> b;
20 | b.value = std::forward(value);
21 | return b;
22 | }
23 |
24 | } // namespace bond
25 |
--------------------------------------------------------------------------------
/cpp/inc/bond/core/detail/value_extern.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #pragma once
5 |
6 | #include
7 | #include "extern_macro.h"
8 |
9 |
10 | namespace bond
11 | {
12 |
13 | #define BOND_DETAIL_ValueVoid_Apply(Reader, Writer) \
14 | void value::_Apply(const Serializer&) const;
15 |
16 | BOND_DETAIL_EXTERN(BOND_DETAIL_ValueVoid_Apply, BOND_DETAIL_BUILTIN_READERS_WRITERS)
17 |
18 |
19 | } // namespace bond
20 |
--------------------------------------------------------------------------------
/compiler/tests/generated/empty_types.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | // suppress "Missing XML comment for publicly visible type or member"
4 | #pragma warning disable 1591
5 |
6 |
7 | #region ReSharper warnings
8 | // ReSharper disable PartialTypeWithSinglePart
9 | // ReSharper disable RedundantNameQualifier
10 | // ReSharper disable InconsistentNaming
11 | // ReSharper disable CheckNamespace
12 | // ReSharper disable UnusedParameter.Local
13 | // ReSharper disable RedundantUsingDirective
14 | #endregion
15 |
16 | namespace tests
17 | {
18 | using System.Collections.Generic;
19 |
20 |
21 | } // tests
22 |
--------------------------------------------------------------------------------
/compiler/tests/schema/field_modifiers.json:
--------------------------------------------------------------------------------
1 | {"namespaces":[{"name":["tests"]}],"imports":[],"declarations":[{"structBase":null,"tag":"Struct","structFields":[{"fieldModifier":"Optional","fieldDefault":null,"fieldType":"bool","fieldName":"o","fieldAttributes":[],"fieldOrdinal":0},{"fieldModifier":"Required","fieldDefault":null,"fieldType":"int16","fieldName":"r","fieldAttributes":[],"fieldOrdinal":1},{"fieldModifier":"RequiredOptional","fieldDefault":null,"fieldType":"double","fieldName":"ro","fieldAttributes":[],"fieldOrdinal":2}],"declParams":[],"declNamespaces":[{"name":["tests"]}],"declName":"Foo","declAttributes":[]}]}
--------------------------------------------------------------------------------
/cpp/src/bond/core/value.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | #include
5 |
6 | #if BOND_LIB_TYPE == BOND_LIB_TYPE_HEADER
7 | #error This source file should not be compiled for BOND_LIB_TYPE_HEADER
8 | #endif
9 |
10 | #include
11 | #include
12 |
13 |
14 | namespace bond
15 | {
16 |
17 | BOND_DETAIL_INSTANTIATE(BOND_DETAIL_ValueVoid_Apply, BOND_DETAIL_BUILTIN_READERS_WRITERS)
18 |
19 | } // namespace bond
20 |
--------------------------------------------------------------------------------
/test/compat/core/schemas/compat_no_generics.bond:
--------------------------------------------------------------------------------
1 | import "compat.bond"
2 |
3 | namespace unittest.compat
4 |
5 | struct CompatNoGenerics view_of Compat
6 | {
7 | m_basicTypes;
8 | m_containers;
9 | m_withBase;
10 | m_nullable_string;
11 | m_nullable_uint64;
12 | // m_generic2;
13 | // m_generic1;
14 | // m_generic0;
15 | // m_generic_another_struct;
16 | // m_generic_another_enum;
17 | // m_defaults;
18 | m_basicUnintialized;
19 | m_enum1;
20 | m_enum2;
21 | m_enum3;
22 | m_enum4;
23 | m_enum5;
24 | m_enum6;
25 | m_nullable;
26 | };
27 |
--------------------------------------------------------------------------------
/compiler/tests/generated/collection-interfaces/empty_types.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | // suppress "Missing XML comment for publicly visible type or member"
4 | #pragma warning disable 1591
5 |
6 |
7 | #region ReSharper warnings
8 | // ReSharper disable PartialTypeWithSinglePart
9 | // ReSharper disable RedundantNameQualifier
10 | // ReSharper disable InconsistentNaming
11 | // ReSharper disable CheckNamespace
12 | // ReSharper disable UnusedParameter.Local
13 | // ReSharper disable RedundantUsingDirective
14 | #endregion
15 |
16 | namespace tests
17 | {
18 | using System.Collections.Generic;
19 |
20 |
21 | } // tests
22 |
--------------------------------------------------------------------------------
/examples/cpp/core/polymorphic_container/polymorphic_container.bond:
--------------------------------------------------------------------------------
1 | namespace examples.polymorphic_containers
2 |
3 | enum StructKind
4 | {
5 | StructKind_Unknown;
6 | StructKind_Struct1;
7 | StructKind_Struct2;
8 | }
9 |
10 | struct Base
11 | {
12 | 0: StructKind kind = StructKind_Unknown;
13 | }
14 |
15 |
16 | struct Struct1 : Base
17 | {
18 | 0: string str;
19 | 1: uint16 n;
20 | }
21 |
22 |
23 | struct Struct2 : Base
24 | {
25 | 1: bool b;
26 | 2: int32 n;
27 | 3: string str;
28 | }
29 |
30 |
31 | struct Polymorphic
32 | {
33 | 0: list> items;
34 | }
35 |
--------------------------------------------------------------------------------
/java/core/src/main/java/org/bondlib/TwoPassProtocolWriter.java:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | package org.bondlib;
5 |
6 | /**
7 | * Provides interface to a writer to pre-run for protocols (like Compact Binary v2) which need two passes.
8 | */
9 | public interface TwoPassProtocolWriter extends ProtocolWriter {
10 |
11 | /**
12 | * Provide the first-pass writer.
13 | *
14 | * @return the first-pass writer
15 | */
16 | ProtocolWriter getFirstPassWriter();
17 | }
18 |
--------------------------------------------------------------------------------
/compiler/tests/generated/empty_types.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #if BOND_VERSION < 0x0b00
7 | #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library.
8 | #endif
9 |
10 | #if BOND_MIN_CODEGEN_VERSION > 0x0d00
11 | #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library.
12 | #endif
13 |
14 | #include
15 | #include
16 |
17 |
18 |
19 | namespace tests
20 | {
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/cs/src/json/protocols/IJsonReader.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved.
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3 |
4 | namespace Bond.Protocols
5 | {
6 | using System;
7 | using Newtonsoft.Json;
8 |
9 | public interface IJsonReader
10 | {
11 | void Read();
12 |
13 | void Skip();
14 |
15 | bool EOF { get; }
16 |
17 | JsonToken TokenType { get; }
18 |
19 | object Value { get; }
20 |
21 | int LineNumber { get; }
22 |
23 | int LinePosition { get; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/cpp/core/polymorphic_container_visitor/polymorphic_container_visitor.bond:
--------------------------------------------------------------------------------
1 | namespace examples.polymorphic_containers
2 |
3 | enum StructKind
4 | {
5 | StructKind_Unknown;
6 | StructKind_Struct1;
7 | StructKind_Struct2;
8 | }
9 |
10 | struct Base
11 | {
12 | 0: StructKind kind = StructKind_Unknown;
13 | }
14 |
15 |
16 | struct Struct1 : Base
17 | {
18 | 0: string str;
19 | 1: uint16 n;
20 | }
21 |
22 |
23 | struct Struct2 : Base
24 | {
25 | 1: bool b;
26 | 2: int32 n;
27 | 3: string str;
28 | }
29 |
30 |
31 | struct Polymorphic
32 | {
33 | 0: list> items;
34 | }
35 |
--------------------------------------------------------------------------------
/examples/cpp/core/static_library/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_bond_codegen (lib/static_library.bond
2 | OPTIONS --apply=compact)
3 |
4 | add_library (static_library_lib EXCLUDE_FROM_ALL
5 | STATIC
6 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/static_library_types.cpp
7 | ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/static_library_apply.cpp)
8 |
9 | add_target_to_folder (static_library_lib)
10 |
11 | target_link_libraries (static_library_lib PUBLIC
12 | bond)
13 |
14 | add_bond_test (static_library
15 | exe/static_library.cpp)
16 |
17 | target_link_libraries (static_library PRIVATE
18 | static_library_lib)
19 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/empty_types.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #if BOND_VERSION < 0x0b00
7 | #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library.
8 | #endif
9 |
10 | #if BOND_MIN_CODEGEN_VERSION > 0x0d00
11 | #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library.
12 | #endif
13 |
14 | #include
15 | #include
16 |
17 |
18 |
19 | namespace tests
20 | {
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/empty_types.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #if BOND_VERSION < 0x0b00
7 | #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library.
8 | #endif
9 |
10 | #if BOND_MIN_CODEGEN_VERSION > 0x0d00
11 | #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library.
12 | #endif
13 |
14 | #include
15 | #include
16 |
17 |
18 |
19 | namespace tests
20 | {
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/empty_types.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #if BOND_VERSION < 0x0b00
7 | #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library.
8 | #endif
9 |
10 | #if BOND_MIN_CODEGEN_VERSION > 0x0d00
11 | #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library.
12 | #endif
13 |
14 | #include
15 | #include
16 |
17 |
18 |
19 | namespace tests
20 | {
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/schemadef/maybe_blob.Foo.json:
--------------------------------------------------------------------------------
1 | {
2 | "structs": [
3 | {
4 | "fields": [
5 | {
6 | "id": 0,
7 | "metadata": {
8 | "default_value": {
9 | "nothing": true
10 | },
11 | "name": "b"
12 | },
13 | "type": {
14 | "element": [
15 | {
16 | "id": 14
17 | }
18 | ],
19 | "id": 11
20 | }
21 | }
22 | ],
23 | "metadata": {
24 | "name": "Foo",
25 | "qualified_name": "tests.Foo"
26 | }
27 | }
28 | ]
29 | }
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/empty_types.h:
--------------------------------------------------------------------------------
1 |
2 | #pragma once
3 |
4 | #include
5 |
6 | #if BOND_VERSION < 0x0b00
7 | #error This file was generated by a newer version of the Bond compiler and is incompatible with your version of the Bond library.
8 | #endif
9 |
10 | #if BOND_MIN_CODEGEN_VERSION > 0x0d00
11 | #error This file was generated by an older version of the Bond compiler and is incompatible with your version of the Bond library.
12 | #endif
13 |
14 | #include
15 | #include
16 |
17 |
18 |
19 | namespace tests
20 | {
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/inheritance_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "inheritance_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Base::Schema::metadata
9 | = Base::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Base::Schema::s_x_metadata
12 | = ::bond::reflection::MetadataInit("x");
13 |
14 |
15 | const ::bond::Metadata Foo::Schema::metadata
16 | = Foo::Schema::GetMetadata();
17 |
18 | const ::bond::Metadata Foo::Schema::s_x_metadata
19 | = ::bond::reflection::MetadataInit("x");
20 |
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/inheritance_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "inheritance_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Base::Schema::metadata
9 | = Base::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Base::Schema::s_x_metadata
12 | = ::bond::reflection::MetadataInit("x");
13 |
14 |
15 | const ::bond::Metadata Foo::Schema::metadata
16 | = Foo::Schema::GetMetadata();
17 |
18 | const ::bond::Metadata Foo::Schema::s_x_metadata
19 | = ::bond::reflection::MetadataInit("x");
20 |
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/inheritance_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "inheritance_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Base::Schema::metadata
9 | = Base::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Base::Schema::s_x_metadata
12 | = ::bond::reflection::MetadataInit("x");
13 |
14 |
15 | const ::bond::Metadata Foo::Schema::metadata
16 | = Foo::Schema::GetMetadata();
17 |
18 | const ::bond::Metadata Foo::Schema::s_x_metadata
19 | = ::bond::reflection::MetadataInit("x");
20 |
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/bond_meta_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "bond_meta_reflection.h"
3 | #include
4 |
5 | namespace deprecated
6 | {
7 | namespace bondmeta
8 | {
9 |
10 | const ::bond::Metadata HasMetaFields::Schema::metadata
11 | = HasMetaFields::Schema::GetMetadata();
12 |
13 | const ::bond::Metadata HasMetaFields::Schema::s_full_name_metadata
14 | = ::bond::reflection::MetadataInit("full_name");
15 |
16 | const ::bond::Metadata HasMetaFields::Schema::s_name_metadata
17 | = ::bond::reflection::MetadataInit("name");
18 |
19 |
20 | } // namespace bondmeta
21 | } // namespace deprecated
22 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/inheritance_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "inheritance_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Base::Schema::metadata
9 | = Base::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Base::Schema::s_x_metadata
12 | = ::bond::reflection::MetadataInit("x");
13 |
14 |
15 | const ::bond::Metadata Foo::Schema::metadata
16 | = Foo::Schema::GetMetadata();
17 |
18 | const ::bond::Metadata Foo::Schema::s_x_metadata
19 | = ::bond::reflection::MetadataInit("x");
20 |
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/cmake/Folders.cmake:
--------------------------------------------------------------------------------
1 | set_property (GLOBAL PROPERTY USE_FOLDERS On)
2 |
3 | #
4 | # Add the target to "current" folder
5 | #
6 | function (add_target_to_folder target)
7 | set_property (GLOBAL APPEND PROPERTY bond_targets ${target})
8 | endfunction()
9 |
10 | #
11 | # add_subfolder (subdirectory folder)
12 | # similar to built-in add_subdirectory but groups targets in specified folder
13 | #
14 | macro (add_subfolder dir folder)
15 | set_property (GLOBAL PROPERTY bond_targets)
16 | add_subdirectory (${dir})
17 | get_property (targets GLOBAL PROPERTY bond_targets)
18 | set_target_properties (${targets} PROPERTIES FOLDER ${folder})
19 | endmacro()
20 |
21 |
--------------------------------------------------------------------------------
/compiler/tests/generated/scoped_allocator/inheritance_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "inheritance_reflection.h"
3 | #include
4 |
5 | namespace tests
6 | {
7 |
8 | const ::bond::Metadata Base::Schema::metadata
9 | = Base::Schema::GetMetadata();
10 |
11 | const ::bond::Metadata Base::Schema::s_x_metadata
12 | = ::bond::reflection::MetadataInit("x");
13 |
14 |
15 | const ::bond::Metadata Foo::Schema::metadata
16 | = Foo::Schema::GetMetadata();
17 |
18 | const ::bond::Metadata Foo::Schema::s_x_metadata
19 | = ::bond::reflection::MetadataInit("x");
20 |
21 |
22 | } // namespace tests
23 |
--------------------------------------------------------------------------------
/compiler/tests/generated/allocator/bond_meta_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "bond_meta_reflection.h"
3 | #include
4 |
5 | namespace deprecated
6 | {
7 | namespace bondmeta
8 | {
9 |
10 | const ::bond::Metadata HasMetaFields::Schema::metadata
11 | = HasMetaFields::Schema::GetMetadata();
12 |
13 | const ::bond::Metadata HasMetaFields::Schema::s_full_name_metadata
14 | = ::bond::reflection::MetadataInit("full_name");
15 |
16 | const ::bond::Metadata HasMetaFields::Schema::s_name_metadata
17 | = ::bond::reflection::MetadataInit("name");
18 |
19 |
20 | } // namespace bondmeta
21 | } // namespace deprecated
22 |
--------------------------------------------------------------------------------
/compiler/tests/generated/alloc_ctors/bond_meta_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "bond_meta_reflection.h"
3 | #include
4 |
5 | namespace deprecated
6 | {
7 | namespace bondmeta
8 | {
9 |
10 | const ::bond::Metadata HasMetaFields::Schema::metadata
11 | = HasMetaFields::Schema::GetMetadata();
12 |
13 | const ::bond::Metadata HasMetaFields::Schema::s_full_name_metadata
14 | = ::bond::reflection::MetadataInit("full_name");
15 |
16 | const ::bond::Metadata HasMetaFields::Schema::s_name_metadata
17 | = ::bond::reflection::MetadataInit("name");
18 |
19 |
20 | } // namespace bondmeta
21 | } // namespace deprecated
22 |
--------------------------------------------------------------------------------
/compiler/tests/generated/type_aliases/bond_meta_types.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "bond_meta_reflection.h"
3 | #include