Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
format.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Inkscape::Util::format - g_strdup_printf wrapper producing shared strings
4 *
5 * Authors:
6 * MenTaLguY <mental@rydia.net>
7 *
8 * Copyright (C) 2006 MenTaLguY
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef SEEN_INKSCAPE_UTIL_FORMAT_H
14#define SEEN_INKSCAPE_UTIL_FORMAT_H
15
16#include <cstdarg>
17#include <glib.h>
18#include "util/share.h"
19
20namespace Inkscape {
21
22namespace Util {
23
24inline ptr_shared vformat(char const *format, va_list args) {
25 char *temp=g_strdup_vprintf(format, args);
27 g_free(temp);
28 return result;
29}
30
31 // needed since G_GNUC_PRINTF can only be used on a declaration
32 ptr_shared format(char const *format, ...) G_GNUC_PRINTF(1,2);
33inline ptr_shared format(char const *format, ...) {
34 va_list args;
35
36 va_start(args, format);
38 va_end(args);
39
40 return result;
41}
42
43}
44
45}
46
47#endif
48/*
49 Local Variables:
50 mode:c++
51 c-file-style:"stroustrup"
52 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
53 indent-tabs-mode:nil
54 fill-column:99
55 End:
56*/
57// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Css & result
Miscellaneous supporting code.
Definition document.h:93
ptr_shared format(char const *format,...) G_GNUC_PRINTF(1
Definition format.h:33
ptr_shared share_string(char const *string)
Definition share.cpp:20
ptr_shared vformat(char const *format, va_list args)
Definition format.h:24
Helper class to stream background task notifications as a series of messages.
va_end(args)
int G_GNUC_PRINTF(2, 3) safeprintf(char(&buf)[N]
int const char va_start(args, fmt)