MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_fixedstring.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 
30 #ifndef LEGATO_FIXEDSTRING_H
31 #define LEGATO_FIXEDSTRING_H
32 
34 struct leFixedString;
38 #define LE_FIXEDSTRING_VTABLE(THIS_TYPE) \
39  LE_STRING_VTABLE(THIS_TYPE) \
40  \
41  leResult (*setBuffer)(THIS_TYPE* str, leChar* buf, uint32_t size); \
42 
43 typedef struct leFixedStringVTable
44 {
45  LE_FIXEDSTRING_VTABLE(struct leFixedString)
46 } leFixedStringVTable;
56 typedef struct leFixedString
57 {
59  const leFixedStringVTable* fn;
61  uint16_t capacity;
62  uint16_t length;
63  const leFont* font;
65 
66 // *****************************************************************************
81  uint32_t size);
82 
83 // *****************************************************************************
98  leChar* buf,
99  uint32_t size);
100 
101 // *****************************************************************************
102 
103 #ifdef _DOXYGEN_
104 #define THIS_TYPE struct leWidget
105 
106 // *****************************************************************************
122 virtual leResult setBuffer(leFixedString* _this,
123  leChar* buf,
124  uint32_t size);
125 
126 #undef THIS_TYPE
127 #endif
128 
129 
130 #endif /* LEGATO_FIXEDSTRING_H */
void leFixedString_Constructor(leFixedString *str, leChar *buf, uint32_t size)
Consructs a fixed string.
Definition: legato_fixedstring.c:42
leChar * data
Definition: legato_fixedstring.h:60
const leFont * font
Definition: legato_fixedstring.h:63
const leFixedStringVTable * fn
Definition: legato_fixedstring.h:59
This struct represents a string.
Definition: legato_string.h:107
This struct represents a font object.
Definition: legato_font.h:156
leResult
This enum represents function call results.
Definition: legato_common.h:123
uint16_t capacity
Definition: legato_fixedstring.h:61
uint16_t length
Definition: legato_fixedstring.h:62
leFixedString * leFixedString_New(leChar *buf, uint32_t size)
Create a new fixed string.
Definition: legato_fixedstring.c:60
virtual leResult setBuffer(leFixedString *_this, leChar *buf, uint32_t size)
Set capacity of the dynamic string.
struct leFixedString leFixedString
This struct represents a fixed string.
This struct represents a fixed string.
Definition: legato_fixedstring.h:56
uint16_t leChar
This typedef represents Legato character.
Definition: legato_common.h:414
leString base
Definition: legato_fixedstring.h:58
Fixed string functions and definitions.