Files
normativeTypes/src/ntutils.cpp
Michael Davidsaver cfe939ca7a Moves source and headers
src/nt/*.h   => src/pv/*.h
src/nt/*.cpp => src/*.cpp
test/nt/*.*  => test/*.*
2016-02-09 19:25:37 -05:00

29 lines
737 B
C++

/* ntutils.cpp */
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* This software is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
*/
#define epicsExportSharedSymbols
#include <pv/ntutils.h>
using namespace std;
namespace epics { namespace nt {
bool NTUtils::is_a(const std::string &u1, const std::string &u2)
{
// remove minor for the u1
size_t pos1 = u1.find_last_of('.');
std::string su1 = (pos1 == string::npos) ? u1 : u1.substr(0, pos1);
// remove minor for the u2
size_t pos2 = u2.find_last_of('.');
std::string su2 = (pos2 == string::npos) ? u2 : u2.substr(0, pos2);
return su2 == su1;
}
}}