aboutsummaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/core/string.h
blob: 0c374d2711a77a089632cdcd6b4592c3c4d15dfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#define USE_VESPA_STRING 1

#if USE_VESPA_STRING
#include <vespa/vespalib/stllike/string.h>
#else
#include <string>
#endif

#include <vector>

namespace vbench {

// define which string class to use
#if USE_VESPA_STRING
typedef vespalib::string string;
#else
typedef std::string string;
#endif

extern string strfmt(const char *fmt, ...)
#ifdef __GNUC__
        // Add printf format checks with gcc
        __attribute__ ((format (printf,1,2)))
#endif
    ;

extern size_t splitstr(const string &str, const string &sep,
                       std::vector<string> &dst);

} // namespace vbench