* Removes a key from the attribute chain * @param ff flow file record * @param key key to remove * @return 0 if removed, -1 otherwise */
| 441 | * @return 0 if removed, -1 otherwise |
| 442 | */ |
| 443 | int8_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 | |
| 450 | int get_content(const flow_file_record* ff, uint8_t* target, int size) { |
| 451 | NULL_CHECK(0, ff, target); |