problem with getting index as string

Ram Krishnaswamy RKrishnaswamy____pathfire.com
Wed May 16 20:16:07 CEST 2001


Hello,

In a set request, I am trying to find the index (the index is defined in the
mib as DisplayString) using the following method:

OctetStr indexStr = my_row->get_index().as_string();
std::string componentName = indexStr.get_printable();

Is this the right way to get the index (the index is defined in my private
mib as DisplayString)?

There are two rows created in this table with indices "scheduler" and
"nbcarchive". 

The 1st problem is that there is always a end of line character prefixed to
the names. So have to take it out.

The second problem is the indexStr.get_printable() returns the right string
when it is "nbcarchive" but does not when it is "scheduler". It not only
prefixes an extra line but also adds hex characters. Looking at
get_printable() code in octet.cpp, seems to me that it calls
get_printable_hex() if one of the characters is a printable one (apart from
other conditions). Seems like the hex method is called for the index
"scheduler". Why is it so for this index and not for the other index? 

How do I correctly get the index without this padding or the extra line
character prefixed? What am I doing wrong?

Thanks.

Ram Krishnaswamy
x1671




More information about the AGENTPP mailing list