| 1 | #cxx . . $ `<file>/melder/STR.h`/pragma once |
| 2 | /* STR.h |
| 3 | * |
| 4 | * Copyright (C) 1992-2018,2020,2021,2024-2026 Paul Boersma |
| 5 | * |
| 6 | * This code is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or (at |
| 9 | * your option) any later version. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 14 | * See the GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | autostring8cxx . . $ autostring8# hex_STR8cxx . . $ hex_STR8(3f4f548efc2492f3). (conststring8cxx . . $ conststring8# str, uint64cxx . . $ uint64# key = 0); |
| 21 | autostring32cxx . . $ autostring32# hex_STRcxx . . $ hex_STR(f3b5e12a66e309ab). (conststring32cxx . . $ conststring32# str, uint64cxx . . $ uint64# key = 0); |
| 22 | |
| 23 | autostring32cxx . . $ autostring32# flatten_STRcxx . . $ flatten_STR(50b64ba3cdc027dd). (constSTRVECcxx . . $ constSTRVEC# const& value, conststring32cxx . . $ conststring32# separator); // TODO: make available in Formulas |
| 24 | |
| 25 | autostring32cxx . . $ autostring32# horizontal_STRcxx . . $ horizontal_STR(e6ef03305d70aad8). (constSTRVECcxx . . $ constSTRVEC# const& value); |
| 26 | |
| 27 | autostring32cxx . . $ autostring32# left_STRcxx . . $ left_STR(c02f217f21fae7fe). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# newLength = 1); |
| 28 | |
| 29 | autostring32cxx . . $ autostring32# lowerCase_STRcxx . . $ lowerCase_STR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 30 | autostring32cxx . . $ autostring32# lowerCamelCase_STRcxx . . $ lowerCamelCase_STR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 31 | autostring32cxx . . $ autostring32# lowerSnakeCase_STRcxx . . $ lowerSnakeCase_STR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 32 | |
| 33 | autostring32cxx . . $ autostring32# mid_STRcxx . . $ mid_STR(190ff3abf8d9ea16). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# startingPosition_1, integercxx . . $ integer# numberOfCharacters = 1); |
| 34 | |
| 35 | autostring32cxx . . $ autostring32# padLeft_STRcxx . . $ padLeft_STR(b76faa58d5a4b3dc). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# width, conststring32cxx . . $ conststring32# pad = U" "); |
| 36 | autostring32cxx . . $ autostring32# padRight_STRcxx . . $ padRight_STR(b76faa58d5a4b3dc). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# width, conststring32cxx . . $ conststring32# pad = U" "); |
| 37 | |
| 38 | autostring32cxx . . $ autostring32# padOrTruncateLeft_STRcxx . . $ padOrTruncateLeft_STR(b76faa58d5a4b3dc). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# width, conststring32cxx . . $ conststring32# pad = U" "); |
| 39 | autostring32cxx . . $ autostring32# padOrTruncateRight_STRcxx . . $ padOrTruncateRight_STR(b76faa58d5a4b3dc). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# width, conststring32cxx . . $ conststring32# pad = U" "); |
| 40 | |
| 41 | autostring32cxx . . $ autostring32# quote_doubleSTRcxx . . $ quote_doubleSTR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 42 | |
| 43 | /** |
| 44 | Look for occurrences of `search` in `str`, and replace them with `replace`. |
| 45 | */ |
| 46 | autostring32cxx . . $ autostring32# replace_STRcxx . . $ replace_STR(58ee6b7335d69803). (conststring32cxx . . $ conststring32# str, conststring32cxx . . $ conststring32# search, |
| 47 | conststring32cxx . . $ conststring32# replace, integercxx . . $ integer# maximumNumberOfReplacements, |
| 48 | integercxx . . $ integer# *out_numberOfReplacements = nullptr); |
| 49 | |
| 50 | /** |
| 51 | Search and replace `maximumNumberOfReplacements` times in `string` on |
| 52 | the basis of regular expressions. |
| 53 | If maximumNumberOfReplacements <= 0, the interpreted `replaceRE` replaces *all* occurrences. |
| 54 | `search_compiled` is an efficient representation of the search regex and |
| 55 | is the result of the compileRE-function which should be called before this function. |
| 56 | The number of actual replacements performed is returned in `out_numberOfReplacements`. |
| 57 | */ |
| 58 | autostring32cxx . . $ autostring32# replace_regex_STRcxx . . $ replace_regex_STR(8c698ee9a707cbfd). (conststring32cxx . . $ conststring32# string, regexpcxx . . $ regexp# *search_compiled, |
| 59 | conststring32cxx . . $ conststring32# replace_regex, integercxx . . $ integer# maximumNumberOfReplacements, |
| 60 | integercxx . . $ integer# *out_numberOfReplacements = nullptr); |
| 61 | |
| 62 | autostring32cxx . . $ autostring32# right_STRcxx . . $ right_STR(c02f217f21fae7fe). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# newLength = 1); |
| 63 | |
| 64 | autostring32cxx . . $ autostring32# truncateLeft_STRcxx . . $ truncateLeft_STR(c02f217f21fae7fe). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# width); |
| 65 | autostring32cxx . . $ autostring32# truncateRight_STRcxx . . $ truncateRight_STR(c02f217f21fae7fe). (conststring32cxx . . $ conststring32# str, integercxx . . $ integer# width); |
| 66 | |
| 67 | autostring8cxx . . $ autostring8# unhex_STR8cxx . . $ unhex_STR8(3f4f548efc2492f3). (conststring8cxx . . $ conststring8# str, uint64cxx . . $ uint64# key = 0); |
| 68 | autostring32cxx . . $ autostring32# unhex_STRcxx . . $ unhex_STR(f3b5e12a66e309ab). (conststring32cxx . . $ conststring32# str, uint64cxx . . $ uint64# key = 0); |
| 69 | |
| 70 | autostring32cxx . . $ autostring32# upperCase_STRcxx . . $ upperCase_STR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 71 | autostring32cxx . . $ autostring32# upperCamelCase_STRcxx . . $ upperCamelCase_STR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 72 | autostring32cxx . . $ autostring32# upperSnakeCase_STRcxx . . $ upperSnakeCase_STR(87bf156b1f548402). (conststring32cxx . . $ conststring32# str); |
| 73 | |
| 74 | autostring32cxx . . $ autostring32# vertical_STRcxx . . $ vertical_STR(e6ef03305d70aad8). (constSTRVECcxx . . $ constSTRVEC# const& strvec); |
| 75 | |
| 76 | /* End of file STR.h */ |