A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
string.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef NS3_STRING_H
9#define NS3_STRING_H
10
11#include "attribute-helper.h"
12
13#include <string>
14#include <vector>
15
16/**
17 * \file
18 * \ingroup attribute_String
19 * ns3::StringValue attribute value declarations.
20 */
21
22namespace ns3
23{
24
25/** Return type of SplitString. */
26using StringVector = std::vector<std::string>;
27
28/**
29 * Split a string on a delimiter.
30 * The input string is ummodified.
31 * \param [in] str The string.
32 * \param [in] delim The delimiter.
33 * \returns A vector of the components of \p str which were separated
34 * by \p delim.
35 */
36StringVector SplitString(const std::string& str, const std::string& delim);
37
38// Additional docs for class StringValue:
39/**
40 * Hold variables of type string
41 *
42 * This class can be used to hold variables of type string,
43 * that is, either char * or std::string.
44 */
48
49} // namespace ns3
50
51#endif /* NS3_STRING_H */
Attribute helper (ATTRIBUTE_ )macros definition.
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name)
Declare the attribute value class nameValue for underlying class type .
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type .
#define ATTRIBUTE_CHECKER_DEFINE(type)
Declare the AttributeChecker class typeChecker and the MaketypeChecker function for class type .
Every class exported by the ns3 library is enclosed in the ns3 namespace.
StringVector SplitString(const std::string &str, const std::string &delim)
Split a string on a delimiter.
Definition string.cc:23
std::vector< std::string > StringVector
Return type of SplitString.
Definition string.h:26