Debian Codegraph @

melder/melder_sprint.h

raw symbols SCIP
1 #cxx . . $ `<file>/melder/melder_sprint.h`/ifndef _melder_sprint_h_
2 #define _melder_sprint_h_cxx . . $ `melder/melder_sprint.h:2:9`!
3 /* melder_sprint.h
4 *
5 * Copyright (C) 1992-2018,2020,2022,2025 Paul Boersma
6 *
7 * This code is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or (at
10 * your option) any later version.
11 *
12 * This code is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this work. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 template <typename... Arg>
22 void Melder_sprintcxx . . $ Melder_sprint(2b992b0fb5123bdf). (mutablestring32cxx . . $ mutablestring32# buffer, int64cxx . . $ int64# bufferSize, const Arg... arg) {
23 const integercxx . . $ integer# length = MelderArg__lengthcxx . . $ MelderArg__length(17371cc2e0a1329d). (arg...);
24 if (length >= bufferSize) {
25 for (int64cxx . . $ int64# i = 0; i < bufferSize; i ++)
26 buffer [i] = U'?';
27 if (bufferSize > 0)
28 buffer [bufferSize - 1] = U'\0';
29 return;
30 }
31 char32cxx . . $ char32# *p = & buffer [0];
32 auto addOneStringElement = [& p] (conststring32cxx . . $ conststring32# string) {
33 if (string) {
34 char32cxx . . $ char32# *newEndOfStringLocation = stp32cpycxx . . $ stp32cpy(6ab934322573b179). (p, string);
35 p = newEndOfStringLocation;
36 }
37 };
38 (// fold
39 addOneStringElement (MelderArgcxx . . $ MelderArg# { arg }. _argcxx . . $ MelderArg#_arg.)
40 , ...
41 );
42 }
43
44 /* End of file melder_sprint.h */
45 #endif