normativeTypesCPP 6.0.2
ntutils.cpp
Go to the documentation of this file.
1/* ntutils.cpp */
2/*
3 * Copyright information and license terms for this software can be
4 * found in the file LICENSE that is included with the distribution
5 */
6
7#define epicsExportSharedSymbols
8#include <pv/ntutils.h>
9
10using namespace std;
11
12namespace epics { namespace nt {
13
14bool NTUtils::is_a(const std::string &u1, const std::string &u2)
15{
16 // remove minor for the u1
17 size_t pos1 = u1.find_last_of('.');
18 std::string su1 = (pos1 == string::npos) ? u1 : u1.substr(0, pos1);
19
20 // remove minor for the u2
21 size_t pos2 = u2.find_last_of('.');
22 std::string su2 = (pos2 == string::npos) ? u2 : u2.substr(0, pos2);
23
24 return su2 == su1;
25}
26
27}}
static bool is_a(const std::string &u1, const std::string &u2)
Definition ntutils.cpp:14