MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / remove_attribute

Function remove_attribute

nanofi/src/api/nanofi.cpp:443–448  ·  view source on GitHub ↗

* Removes a key from the attribute chain * @param ff flow file record * @param key key to remove * @return 0 if removed, -1 otherwise */

Source from the content-addressed store, hash-verified

441 * @return 0 if removed, -1 otherwise
442 */
443int8_t remove_attribute(flow_file_record *ff, const char *key) {
444 NULL_CHECK(-1, ff, key);
445 NULL_CHECK(-1, ff->attributes);
446 auto attribute_map = static_cast<AttributeMap*>(ff->attributes);
447 return gsl::narrow<int8_t>(attribute_map->erase(key)) - 1; // erase by key returns the number of elements removed (0 or 1)
448}
449
450int get_content(const flow_file_record* ff, uint8_t* target, int size) {
451 NULL_CHECK(0, ff, target);

Callers 1

CAPITests.cppFile · 0.85

Calls 1

eraseMethod · 0.45

Tested by

no test coverage detected