str.h 1.5 KB

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