| 1 |
typedef unsigned short PRUint16; |
| 2 |
typedef PRUint16 PRUnichar; |
| 3 |
template <class CharT> struct nsCharTraits { |
| 4 |
}; |
| 5 |
class nsAString_internal { |
| 6 |
public: |
| 7 |
typedef PRUnichar char_type; |
| 8 |
}; |
| 9 |
class nsString : public nsAString_internal { |
| 10 |
public: |
| 11 |
typedef nsString self_type; |
| 12 |
nsString( const self_type& str ); |
| 13 |
}; |
| 14 |
class nsDependentString : public nsString { |
| 15 |
public: |
| 16 |
explicit nsDependentString( const char_type* data ); |
| 17 |
}; |
| 18 |
typedef struct sqlite3_stmt sqlite3_stmt; |
| 19 |
const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 20 |
class nsIVariant { }; |
| 21 |
template <typename DataType> struct variant_storage_traits { |
| 22 |
typedef DataType ConstructorType; |
| 23 |
typedef DataType StorageType; |
| 24 |
static inline StorageType storage_conversion(ConstructorType aData) { |
| 25 |
return aData; |
| 26 |
} |
| 27 |
}; |
| 28 |
template <typename DataType> class Variant : public nsIVariant { |
| 29 |
public: |
| 30 |
Variant(typename variant_storage_traits<DataType>::ConstructorType aData) |
| 31 |
: mData(variant_storage_traits<DataType>::storage_conversion(aData)) {} |
| 32 |
typename variant_storage_traits<DataType>::StorageType mData; |
| 33 |
}; |
| 34 |
typedef Variant<nsString> TextVariant; |
| 35 |
class Row { |
| 36 |
void initialize(sqlite3_stmt *aStatement); |
| 37 |
}; |
| 38 |
void Row::initialize(sqlite3_stmt *aStatement) |
| 39 |
{ |
| 40 |
nsDependentString str(static_cast<const PRUnichar |
| 41 |
*>(::sqlite3_column_text16(aStatement, 0))); |
| 42 |
new TextVariant(str); |
| 43 |
} |
| 44 |
|