mongo-cxx-driver, where are the implementations of bson_value::view::get_string() and document::element::get_string()?

28 views Asked by At

I did a grep and only see ... get_string const; declarations for both functions, no actual implementation in any hpp or cpp files in github.com/mongo-cxx-driver/src. Did anyone know where they live?

1

There are 1 answers

0
QnA On BEST ANSWER

It's done via name decoration/mangling, hence grep for get_string in the code source did not return any function definition.

//bsoncxx/v_noabi/bsoncxx/document/element.cpp
#define BSONCXX_ENUM(name, val) \
    types::b_##name element::get_##name() const { \
    ...

and

//bsoncxx/v_noabi/bsoncxx/enums/type.hpp
BSONCXX_ENUM(string, 0x02)