-
Type:
Task
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
QE 2022-02-07, QE 2022-01-24
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Add new CppResource pseudo-builder that would allow for addition of arbitrary source files to the output cpp binary and support listing/retrieving contents of those files during execution.
Proposed usage:
SConscript file:
env.CppResource(
target='my_resources.cpp',
exportname='mongo::my_namespace::MyResources',
source=[
'A.txt',
'B.png',
],
)
Cpp source code:
#include "mongo/util/static_resources.h"
extern const StaticResources mongo::my_namespace::MyResources;
... // Get all the resources:
const std::map<string, StringData>& resourceMap = mongo::my_namespace::MyResources.items(); // Get the contents of a specific resource.
std::cout << "Resource contents:" << mongo::my_namespace::MyResources.getResourceByName("src/mongo/my_project_path/A.txt")->toString() << std::endl;
- is depended on by
-
SERVER-62735 Add unit test support for expected output in separate files
-
- Closed
-