cpp enum class string idl.
Project description
cpp-enum-class-string-idl
python3 -m cpp_enum_class_string_idl MyEnums.yaml
MyEnums.yaml
interfaces:
- MyEnum.yaml
- MyOtherEnum.yaml
MyEnum.yaml
name: MyEnum
type: int
values:
- Value0
- Value1
MyEnum.h
#pragma once
/*
* generated code from cpp-enum-class-string-idl
*/
enum class MyEnum : int {
Value0,
Value1,
Count
};
const char* enum_to_string(const MyEnum value);
MyEnum.cpp
#include "MyEnum.h"
/*
* generated code from cpp-enum-class-string-idl
*/
const char* _MyEnum[] = {
"Value0",
"Value1"
};
const char* enum_to_string(const MyEnum value) {
if (MyEnum::Count == value) {
return "";
}
return _MyEnum[static_cast<int>(value)];
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cpp-enum-class-string-idl-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90c621f5ddf63f4dd4f4209e41495626ae6874bbe2a957948055d35e10c519cb |
|
MD5 | 7e1ae858db75b107b90754b84b5fd929 |
|
BLAKE2b-256 | 950808993d3fac2995644721c062e0e9166c16b5e751735410a2e1ef47c391dd |
Close
Hashes for cpp_enum_class_string_idl-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9c7816796b9e807ae82fd1985c32ce5f020742bcbc9fa33bd561fda4008a97e |
|
MD5 | 5f93853c54db71d5d39fac89f18a18a4 |
|
BLAKE2b-256 | 32ac687903169667db70d4b241675d551f02e6d35e6f96ce74d475ec3fa7f8c0 |