MCPcopy Create free account
hub / github.com/Rblp/Rblpapi / appendOptionsToRequest

Function appendOptionsToRequest

src/blpapi_utils.cpp:147–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void appendOptionsToRequest(Request& request, SEXP options_) {
148 if(options_== R_NilValue) { return; }
149 Rcpp::CharacterVector options(options_);
150
151 if(!options.hasAttribute("names")) {
152 throw std::logic_error("Request options must be named.");
153 }
154
155 if(options.attr("names") == R_NilValue) {
156 throw std::logic_error("Request optionnames must not be null.");
157 }
158
159 Rcpp::CharacterVector options_names(options.attr("names"));
160
161 if(options.length() && options_names.length()==0) {
162 throw std::logic_error("Request options must be non empty and named.");
163 }
164
165 for(R_len_t i = 0; i < options.length(); i++) {
166 request.set(static_cast<std::string>(options_names[i]).c_str(), static_cast<std::string>(options[i]).c_str());
167 }
168}
169
170void appendOverridesToRequest(Request& request, SEXP overrides_) {
171 if(overrides_ == R_NilValue) { return; }

Callers 4

createStandardRequestFunction · 0.85
bds_ImplFunction · 0.85
getPortfolio_ImplFunction · 0.85
getBars_ImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected