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

Fixed string functions and definitions. More...

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

Go to the source code of this file.

Data Structures

struct  leFixedString
 This struct represents a fixed string. More...
 

Macros

#define THIS_TYPE   struct leWidget
 

Typedefs

typedef struct leFixedString leFixedString
 This struct represents a fixed string. More...
 

Functions

leFixedStringleFixedString_New (leChar *buf, uint32_t size)
 Create a new fixed string. More...
 
void leFixedString_Constructor (leFixedString *str, leChar *buf, uint32_t size)
 Consructs a fixed string. More...
 
virtual leResult setBuffer (leFixedString *_this, leChar *buf, uint32_t size)
 Set capacity of the dynamic string. More...
 

Detailed Description

Fixed string functions and definitions.

Typedef Documentation

◆ leFixedString

typedef struct leFixedString leFixedString

This struct represents a fixed string.

String type that allocates internal memory to accommodate fixed string operations

Function Documentation

◆ leFixedString_Constructor()

void leFixedString_Constructor ( leFixedString str,
leChar buf,
uint32_t  size 
)

Consructs a fixed 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.
leFixedString_Constructor(str, buf, size);
@param str is string to construct.
@param buf is the buffer to assign to this string.
@param size is the size of the buffer.
Returns
void

◆ leFixedString_New()

leFixedString* leFixedString_New ( leChar buf,
uint32_t  size 
)

Create a new fixed string.

Creates a new leFixedString and automatically calls its constructor function.

Remarks
Caller is responsible for freeing the memory allocated by this function using leString_Delete().
leChar* buf;
uint32_t size;
leFixedString * str = leFixedString_New(buf, size);
Returns
pointer to the newly allocated string

◆ setBuffer()

virtual leResult setBuffer ( leFixedString _this,
leChar buf,
uint32_t  size 
)
virtual

Set capacity of the dynamic string.

Copies up to size items of buf to _this.

leChar* buf;
uint32_t size;
leResult res = _this->fn->setBuffer(_this, buf, size);
Parameters
_thisis the string to operate on;
bufis the buffer to set;
sizeis the size of the buffer;
Returns
LE_SUCCESS if set, otherwise LE_FAILURE.