QnA
QnA

Reputation: 1103

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

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?

Upvotes: -1

Views: 140

Answers (1)

QnA
QnA

Reputation: 1103

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)

Upvotes: 0

Related Questions