str.h
Go to the documentation of this file.
1 /**
2  * @file str.h
3  * @brief String manipulation helper functions
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  * @author Oryx Embedded SARL (www.oryx-embedded.com)
24  * @version 1.9.0
25  **/
26 
27 #ifndef _STR_H
28 #define _STR_H
29 
30 //Dependencies
31 #include "os_port.h"
32 #include "error.h"
33 
34 //C++ guard
35 #ifdef __cplusplus
36  extern "C" {
37 #endif
38 
39 //String manipulation helper functions
40 char_t *strDuplicate(const char_t *s);
43 void strReplaceChar(char_t *s, char_t oldChar, char_t newChar);
44 
45 error_t strSafeCopy(char_t *dest, const char_t *src, size_t destSize);
46 
47 //C++ guard
48 #ifdef __cplusplus
49  }
50 #endif
51 
52 #endif
void strReplaceChar(char_t *s, char_t oldChar, char_t newChar)
Replace all occurrences of the specified character.
Definition: str.c:134
char char_t
Definition: compiler_port.h:41
char_t * strTrimWhitespace(char_t *s)
Removes all leading and trailing whitespace from a string.
Definition: str.c:68
Error codes description.
error_t strSafeCopy(char_t *dest, const char_t *src, size_t destSize)
Copy string.
Definition: str.c:157
void strRemoveTrailingSpace(char_t *s)
Removes all trailing whitespace from a string.
Definition: str.c:107
RTOS abstraction layer.
char_t * strDuplicate(const char_t *s)
Duplicate a string.
Definition: str.c:40
error_t
Error codes.
Definition: error.h:40