Minor c/c++ codegen update
1, Moved "#include <string>" from exported header to test flag provider
header file.
2, For production target and read only flags, the generated c
api should just return default value instead of calling into c++ api
3, Remove using namespace server_configurable_flags from header, instead
of just having the namespace to be spelled out in each api call. Having
using namespace xxx in header is not a c++ best practice.
4, Replace #ifdef #def #endif with #pragma once
Bug: b/279483801
Test: atest aconfig.test
Change-Id: I3e55a7b14301f3de419795467f33e2dc889d371e
diff --git a/tools/aconfig/templates/cpp_exported_header.template b/tools/aconfig/templates/cpp_exported_header.template
index e45548e..cd01853 100644
--- a/tools/aconfig/templates/cpp_exported_header.template
+++ b/tools/aconfig/templates/cpp_exported_header.template
@@ -1,7 +1,5 @@
-#ifndef {header}_HEADER_H
-#define {header}_HEADER_H
+#pragma once
-#include <string>
#include <memory>
namespace {cpp_namespace} \{
@@ -50,4 +48,3 @@
}
{{ -endif }}
}
-#endif