+
+// ----------------------------------------------------------------------------
+// wxFormatString::GetArgumentType()
+// ----------------------------------------------------------------------------
+
+namespace
+{
+
+template<typename CharType>
+wxFormatString::ArgumentType DoGetArgumentType(const CharType *format,
+ unsigned n)
+{
+ wxCHECK_MSG( format, wxFormatString::Arg_Other,
+ "empty format string not allowed here" );
+
+ wxPrintfConvSpecParser<CharType> parser(format);
+
+ wxCHECK_MSG( parser.pspec[n-1] != NULL, wxFormatString::Arg_Other,
+ "requested argument not found - invalid format string?" );
+
+ switch ( parser.pspec[n-1]->m_type )
+ {
+ case wxPAT_CHAR:
+ case wxPAT_WCHAR:
+ return wxFormatString::Arg_Char;
+
+ default:
+ return wxFormatString::Arg_Other;
+ }
+}
+
+} // anonymous namespace
+
+wxFormatString::ArgumentType wxFormatString::GetArgumentType(unsigned n) const
+{
+ if ( m_char )
+ return DoGetArgumentType(m_char.data(), n);
+ else if ( m_wchar )
+ return DoGetArgumentType(m_wchar.data(), n);
+ else if ( m_str )
+ return DoGetArgumentType(m_str->wx_str(), n);
+ else if ( m_cstr )
+ return DoGetArgumentType(m_cstr->AsInternal(), n);
+
+ wxFAIL_MSG( "unreachable code" );
+ return Arg_Other;
+}