Start a new topic

String value of a node's attribute

Original Post by: spoulin Fri Mar 5 18:44:17 2010


Hi,


I wanted to know if there was a way to get the string value of a node's attribute. For example, I want to get the string value of an LOD node's Significant Size attribute. So, the said function would return "Significant Size" when I pass it the code of the attribute. Does such a function exist?


Thanks,

Steven


Original Post by: SteveThompson Mon Mar 8 04:20:08 2010


No there is no such function. Just get the value as its native type and use sprintf or other string formatting technique (std::ostringstream, for example) to turn the value into a string.

Original Post by: spoulin Mon Mar 8 13:01:23 2010


Actually that's not exactly what I wanted to do. Getting the string value of the attribute's value is no problem. What I want is to get the string value of the attribute's name. I'm looking for that functionnality because I wanted to create a "Modifications Preview" pane for one of my plugins and I was trying to make it generic. To do so I need a function that would return me the name of the attribute I'm changing. So if I'm changing the sig size of a node, I wanted a function like this "char* mgGetAttName(int fltCode)" that would return "Significant Size" in the previous case. Anyway, I doubt such a function exists but had to ask :)

Original Post by: SteveThompson Mon Mar 8 15:15:44 2010


Oh, sorry I misunderstood your question. Yes there is a function for this ddGetName. There are many similar. useful functions in the Data Dictionary Function Category to make queries on the records and attributes of OpenFlight nodes.

Login to post a comment