MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_dynamicstring.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
28 #ifndef LEGATO_DYNAMICSTRING_H
29 #define LEGATO_DYNAMICSTRING_H
30 
32 
33 /* internal use only */
37 struct leDynamicString;
38 
39 #define LE_DYNAMICSTRING_VTABLE(THIS_TYPE) \
40  LE_STRING_VTABLE(THIS_TYPE) \
41  \
42  uint32_t (*getCapacity)(THIS_TYPE* str); \
43  leResult (*setCapacity)(THIS_TYPE* str, uint32_t cap); \
44 
45 typedef struct leDynamicStringVTable
46 {
47  LE_DYNAMICSTRING_VTABLE(struct leDynamicString)
48 } leDynamicStringVTable;
53 // *****************************************************************************
59 typedef struct leDynamicString
60 {
62  const leDynamicStringVTable* fn;
64  uint16_t capacity;
65  uint16_t length;
66  const leFont* font;
68 
69 // *****************************************************************************
83 
84 // *****************************************************************************
98 
99 
100 #ifdef _DOXYGEN_
101 #define THIS_TYPE struct leWidget
102 
103 // *****************************************************************************
114 virtual uint32_t getCapacity(leDynamicString* _this);
115 
116 // *****************************************************************************
129 virtual leResult setCapacity(leDynamicString* _this,
130  uint32_t cap);
131 
132 #undef THIS_TYPE
133 #endif
134 
135 #endif /* LEGATO_DYNAMICSTRING_H */
leChar * data
Definition: legato_dynamicstring.h:63
leString base
Definition: legato_dynamicstring.h:61
This struct represents a string.
Definition: legato_string.h:107
virtual uint32_t getCapacity(leDynamicString *_this)
Get capacity of the dynamic string.
This struct represents a dynamic string.
Definition: legato_dynamicstring.h:59
This struct represents a font object.
Definition: legato_font.h:156
leResult
This enum represents function call results.
Definition: legato_common.h:123
const leFont * font
Definition: legato_dynamicstring.h:66
uint16_t capacity
Definition: legato_dynamicstring.h:64
const leDynamicStringVTable * fn
Definition: legato_dynamicstring.h:62
void leDynamicString_Constructor(leDynamicString *str)
Consructs a dynamic string.
Definition: legato_dynamicstring.c:41
uint16_t length
Definition: legato_dynamicstring.h:65
virtual leResult setCapacity(leDynamicString *_this, uint32_t cap)
Set capacity of the dynamic string.
leDynamicString * leDynamicString_New(void)
Create a new dynamic string.
Definition: legato_dynamicstring.c:56
uint16_t leChar
This typedef represents Legato character.
Definition: legato_common.h:414
struct leDynamicString leDynamicString
This struct represents a dynamic string.
Fixed string functions and definitions.