Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
KeyValuePair Struct Reference

A pair of strings. More...

#include <key_value_pair.h>

Public Member Functions

KeyValuePairAllocateKeyValuePair (const char *key_s, const char *value_s)
 Allocate a KeyValuePair. More...
 
void FreeKeyValuePair (KeyValuePair *kvp_p)
 Free a KeyValuePair. More...
 
KeyValuePairNodeAllocateKeyValuePairNodeByParts (const char *key_s, const char *value_s)
 Allocate a KeyValuePairNode. More...
 
KeyValuePairNodeAllocateKeyValuePairNode (KeyValuePair *kvp_p)
 Allocate a KeyValuePairNode. More...
 
void FreeKeyValuePairNode (ListItem *node_p)
 Free a KeyValuePairNode. More...
 
json_t * GetKeyValuePairAsJSON (const KeyValuePair *kvp_p)
 Get the JSON representation of a KeyValuePair. More...
 
KeyValuePairGetKeyValuePairFromJSON (const json_t *json_p)
 Create a KeyValuePair from its JSON representation. More...
 

Data Fields

char * kvp_key_s
 The string used as a key. More...
 
char * kvp_value_s
 The string used as a value. More...
 

Detailed Description

A pair of strings.

Member Function Documentation

◆ AllocateKeyValuePair()

KeyValuePair * AllocateKeyValuePair ( const char *  key_s,
const char *  value_s 
)

Allocate a KeyValuePair.

Parameters
key_sThis string will be deep copied and be the kvp_key_s in the KeyValuePair.
value_sThis string will be deep copied and be the kvp_value_s in the KeyValuePair.
Returns
A newly-allocated KeyValuePair or NULL upon error.

◆ FreeKeyValuePair()

void FreeKeyValuePair ( KeyValuePair kvp_p)

Free a KeyValuePair.

Parameters
kvp_pThe KeyValuePair to free.

◆ AllocateKeyValuePairNodeByParts()

KeyValuePairNode * AllocateKeyValuePairNodeByParts ( const char *  key_s,
const char *  value_s 
)

Allocate a KeyValuePairNode.

Parameters
key_sThis string will be deep copied and be the kvp_key_s in the KeyValuePair.
value_sThis string will be deep copied and be the kvp_value_s in the KeyValuePair.
Returns
A newly-allocated KeyValuePairNode containing the KeyValuePair or NULL upon error.

◆ AllocateKeyValuePairNode()

KeyValuePairNode * AllocateKeyValuePairNode ( KeyValuePair kvp_p)

Allocate a KeyValuePairNode.

Parameters
kvp_pThe KeyValuePair to store in the new KeyValuePairNode.
Returns
A newly-allocated KeyValuePairNode containing the KeyValuePair or NULL upon error.

◆ FreeKeyValuePairNode()

void FreeKeyValuePairNode ( ListItem node_p)

Free a KeyValuePairNode.

Parameters
node_pThe KeyValuePairNode to free.

◆ GetKeyValuePairAsJSON()

json_t * GetKeyValuePairAsJSON ( const KeyValuePair kvp_p)

Get the JSON representation of a KeyValuePair.

Parameters
kvp_pThe KeyValuePair to get the JSON representation of.
Returns
The newly-allocated JSON representation fof the given KeyValuePair or NULL upon error.

◆ GetKeyValuePairFromJSON()

KeyValuePair * GetKeyValuePairFromJSON ( const json_t *  json_p)

Create a KeyValuePair from its JSON representation.

Parameters
json_pThe JSON representation to get the KeyValuePair from..
Returns
The newly-allocated KeyValuePair or NULL upon error.

Field Documentation

◆ kvp_key_s

char* kvp_key_s

The string used as a key.

◆ kvp_value_s

char* kvp_value_s

The string used as a value.


The documentation for this struct was generated from the following file: