- /* In an effort to reduce overhead we don't actually allocate the list
- * until the first time it's needed...so...
- */
- if(fieldlist)
- {
- fieldlist->clear();
- }
- else
- {
- fieldlist = new SQLfieldList;
- }
-
- if(currentrow < PQntuples(res))
- {
- int ncols = PQnfields(res);
-
- for(int i = 0; i < ncols; i++)
- {
- fieldlist->push_back(GetValue(currentrow, i));
- }
-
- currentrow++;
- }
-
- return *fieldlist;
- }
-
- virtual SQLfieldMap& GetRowMap()
- {
- /* In an effort to reduce overhead we don't actually allocate the map
- * until the first time it's needed...so...
- */
- if(fieldmap)
- {
- fieldmap->clear();
- }
- else
- {
- fieldmap = new SQLfieldMap;
- }
-
- if(currentrow < PQntuples(res))
- {
- int ncols = PQnfields(res);
-
- for(int i = 0; i < ncols; i++)
- {
- fieldmap->insert(std::make_pair(ColName(i), GetValue(currentrow, i)));
- }
-
- currentrow++;
- }
-
- return *fieldmap;
- }
-
- virtual SQLfieldList* GetRowPtr()
- {
- SQLfieldList* fl = new SQLfieldList;
-
- if(currentrow < PQntuples(res))
- {
- int ncols = PQnfields(res);
-
- for(int i = 0; i < ncols; i++)
- {
- fl->push_back(GetValue(currentrow, i));
- }
-
- currentrow++;
- }
-
- return fl;
- }
-
- virtual SQLfieldMap* GetRowMapPtr()
- {
- SQLfieldMap* fm = new SQLfieldMap;