MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / GeneratePackage

Method GeneratePackage

source/generator_kotlin.cpp:4688–4746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4686}
4687
4688void GeneratorKotlin::GeneratePackage(const std::shared_ptr<Package>& p)
4689{
4690 std::string domain = (p->domain && !p->domain->empty()) ? (*p->domain + ".") : "";
4691 CppCommon::Path path = CppCommon::Path(_output) / CreatePackagePath(domain, *p->name);
4692
4693 // Create package path
4694 CppCommon::Directory::CreateTree(path);
4695
4696 // Generate namespace
4697 if (p->body)
4698 {
4699 // Generate child enums
4700 for (const auto& child_e : p->body->enums)
4701 GenerateEnum(p, child_e, path);
4702
4703 // Generate child flags
4704 for (const auto& child_f : p->body->flags)
4705 GenerateFlags(p, child_f, path);
4706
4707 // Generate child structs
4708 for (const auto& child_s : p->body->structs)
4709 GenerateStruct(p, child_s, path);
4710 }
4711
4712 // Generate containers
4713 GenerateContainers(p, false);
4714 if (Final())
4715 GenerateContainers(p, true);
4716
4717 // Generate protocol
4718 if (Proto())
4719 {
4720 // Generate protocol version
4721 GenerateProtocolVersion(p);
4722
4723 // Generate sender & receiver
4724 GenerateSender(p, false);
4725 GenerateSenderListener(p, false);
4726 GenerateReceiver(p, false);
4727 GenerateReceiverListener(p, false);
4728 GenerateProxy(p, false);
4729 GenerateProxyListener(p, false);
4730 GenerateClient(p, false);
4731 GenerateClientListener(p, false);
4732 if (Final())
4733 {
4734 GenerateSender(p, true);
4735 GenerateSenderListener(p, true);
4736 GenerateReceiver(p, true);
4737 GenerateReceiverListener(p, true);
4738 GenerateClient(p, true);
4739 GenerateClientListener(p, true);
4740 }
4741 }
4742
4743 // Generate JSON engine
4744 if (JSON())
4745 GenerateJson(p);

Callers

nothing calls this directly

Calls 2

ProtoClass · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected