This is Unofficial EPICS BASE Doxygen Site
epics::nt::NTUtils Class Reference

Utility methods for NT types. More...

#include "ntutils.h"

Static Public Member Functions

static bool is_a (const std::string &u1, const std::string &u2)
 

Detailed Description

Utility methods for NT types.

Author
mse

Definition at line 19 of file ntutils.h.

Member Function Documentation

bool epics::nt::NTUtils::is_a ( const std::string &  u1,
const std::string &  u2 
)
static

Checks whether NT types are compatible by checking their IDs, i.e. their names and major version must match.

Parameters
u1the first URI.
u2the second URI.
Returns
true if URIs are compatible, false otherwise.

Definition at line 14 of file ntutils.cpp.

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 }

The documentation for this class was generated from the following files: