-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrameName.cpp
46 lines (42 loc) · 900 Bytes
/
FrameName.cpp
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
36
37
38
39
40
41
42
43
44
45
#include "FrameName.hpp"
/**
* @brief Construct a new Frame Name
*
* @param pre Prefix of the frame name
* @param suf Suffix of the frame name
*/
FrameName::FrameName(const std::string pre, const std::string suf) : index(-1)
{
prefix = pre;
suffix = suf;
};
/**
* @brief Get the next name
*
* @return const std::string& Next name
*/
const std::string &FrameName::NextName()
{
Increment();
std::stringstream ss;
ss << prefix;
ss << index;
ss << suffix;
buffer = ss.str();
return buffer;
};
/**
* @brief Get the Current Name with a different suffix
*
* @param suf Suffix of the frame name
* @return const std::string& Name
*/
const std::string &FrameName::CurrentNameOtherSuffix(const std::string &suf)
{
std::stringstream ss;
ss << prefix;
ss << index;
ss << suf;
buffer2 = ss.str();
return (buffer2);
};