MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_dynamicstring.h File Reference

Dynamic string functions and definitions. More...

Include dependency graph for legato_dynamicstring.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  leDynamicString
 This struct represents a dynamic string. More...
 

Macros

#define THIS_TYPE   struct leWidget
 

Typedefs

typedef struct leDynamicString leDynamicString
 This struct represents a dynamic string. More...
 

Functions

leDynamicStringleDynamicString_New (void)
 Create a new dynamic string. More...
 
void leDynamicString_Constructor (leDynamicString *str)
 Consructs a dynamic string. More...
 
virtual uint32_t getCapacity (leDynamicString *_this)
 Get capacity of the dynamic string. More...
 
virtual leResult setCapacity (leDynamicString *_this, uint32_t cap)
 Set capacity of the dynamic string. More...
 

Detailed Description

Dynamic string functions and definitions.

Typedef Documentation

◆ leDynamicString

This struct represents a dynamic string.

String type that dynamically allocates internal memory to accommodate dynamic string operations

Function Documentation

◆ getCapacity()

virtual uint32_t getCapacity ( leDynamicString _this)
virtual

Get capacity of the dynamic string.

Gets the capacity of _this.

uint32_t cap = _this->fn->getCapacity(_this);
Parameters
stris the string to operate on
Returns
the current string capacity.

◆ leDynamicString_Constructor()

void leDynamicString_Constructor ( leDynamicString str)

Consructs a dynamic string.

Allocates a memory for an existing str.

Remarks
It is assumed that the pointer provided is being managed by the caller. Use the destructor member function to destroy the string.
Parameters
strthe string to construct.
Returns
void

◆ leDynamicString_New()

leDynamicString* leDynamicString_New ( void  )

Create a new dynamic string.

Creates a new leDynamicString and automatically calls its constructor function.

Remarks
Caller is responsible for freeing the memory allocated by this function.
See also
leDynamicString_Delete()
Returns
pointer to the newly allocated string

◆ setCapacity()

virtual leResult setCapacity ( leDynamicString _this,
uint32_t  cap 
)
virtual

Set capacity of the dynamic string.

Sets capacity of _this to cap.

uint32_t cap;
leResult res = _this->fn->setCapacity(_this, cap);
Parameters
_thisis the string to operate on;
capis the desired capacity;
Returns
LE_SUCCESS if set, otherwise LE_FAILURE.