A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
22
namespace
ns3
23
{
24
25
/** Return type of SplitString. */
26
using
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
*/
36
StringVector
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
*/
45
ATTRIBUTE_VALUE_DEFINE_WITH_NAME
(std::string, String);
46
ATTRIBUTE_ACCESSOR_DEFINE
(String);
47
ATTRIBUTE_CHECKER_DEFINE
(String);
48
49
}
// namespace ns3
50
51
#endif
/* NS3_STRING_H */
attribute-helper.h
Attribute helper (ATTRIBUTE_ )macros definition.
ATTRIBUTE_VALUE_DEFINE_WITH_NAME
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name)
Declare the attribute value class nameValue for underlying class type .
Definition
attribute-helper.h:192
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type .
Definition
attribute-helper.h:163
ATTRIBUTE_CHECKER_DEFINE
#define ATTRIBUTE_CHECKER_DEFINE(type)
Declare the AttributeChecker class typeChecker and the MaketypeChecker function for class type .
Definition
attribute-helper.h:261
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::SplitString
StringVector SplitString(const std::string &str, const std::string &delim)
Split a string on a delimiter.
Definition
string.cc:23
ns3::StringVector
std::vector< std::string > StringVector
Return type of SplitString.
Definition
string.h:26
src
core
model
string.h
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0