aboutsummaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/core/string.h
blob: 8b8ed6f6f5b85f871ad6de31c17e980c039e2dd5 (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
// Copyright Vespa.ai. 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
using string = vespalib::string;
#else
using string = std::string;
#endif

extern string strfmt(const char *fmt, ...) __attribute__ ((format (printf,1,2)));

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

} // namespace vbench