However, to get the actual glyph indexes used by small caps, you have to parse a lot -- from the top of my head, find the GSUB table for the current language; find out if it has a smcp entry; locate the entry; parse individual substitutions until you either find the character code you wanted [*], or reach the end of the table. You might want to start by reading up on the internal representation of OTF fonts, elsewhere on the Adobe site (and some info scattered about on Microsoft/Typography).
[*] There is actually another layer of abstraction. Character codes -- such as 'lowercase a' -- are mapped separately into glyphs, in the cmap section of OpenType fonts. GSUB tables work exclusively with glyph-to-glyph translations. So the correct order would be: (1) find the glyph index representing your current character; (2) find that glyph in the GSUB smcp table; (3) check what glyph it translates to.