473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Help me find a good typedef name for the following type

Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std::pair<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.

/ Eric
Jul 23 '05 #1
3 1556
Eric Lilja wrote:
Hello, got an odd question. I need a good typedef name
for the type:
std::vector<std::vector<std::pair<std::string,
std::string> > >

Even with using-statements to get rid of std:: it's
simply too long and makes for keeping lines within a
length of 80 columns cumbersome.

I am using an object of that type to store matching rows
(with a varying number of non-NULL columns) from an SQL
database. The first string in the pair holds the field
name and the second the field value.

/ Eric


How about vvpss
Jul 23 '05 #2
"Eric Lilja" <er*************@yahoo.com> writes:
Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std::pair<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.

/ Eric


typedef std::pair<std::string, std::string> column_value_t;
typedef std::vector<column_value_t> record_t;
typedef std::vector<record_t> table_t;

--
Mikhail Polatov
MetaCommunications Engineering
Jul 23 '05 #3
* Eric Lilja:
Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std::pair<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.


Possibly you'd be better off by representing the NULL columns explicitly,
and store the field names just once, in a separate vector.

However,

typedef std::pair<std::string, std::string> NameValuePair;
typedef std::vector<NameValuePair> DbResultRow;
typedef std::vector<DbResultRow> DbResultTable;
typedef DbResultTable DbView;
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are...
5
by: Jeff Greenberg | last post by:
Not an experienced c++ programmer here and I've gotten myself a bit stuck. I'm trying to implement a class lib and I've run into a sticky problem that I can't solve. I'd appreciate any help that I...
7
by: Alan Bashy | last post by:
Please, guys, In need help with this. It is due in the next week. Please, help me to implement the functions in this programm especially the first three constructor. I need them guys. Please, help...
3
by: tomailmelookatbottom | last post by:
I am a beginner in C++. I recently downloaded the codes of C++ faq book.Since I don't have the book ,following is two program which is confusing me a lot. program 38_01.cpp ^^^^^^^^^^^^^^^^^...
22
by: Dave Cooke | last post by:
Hi I am very new to C. I am trying to figure out how to initialize a struct in my main program. The struct is declared in anouther header file like this... typedef struct ln { int key; int data;...
11
by: Mannequin* | last post by:
Hi all, I'm working on a quick program to bring the Bible into memory from a text file. Anyway, I have three questions to ask. First, is my implementation of malloc () correct in the program to...
4
by: Chris | last post by:
I've lurked around long enough... Time to interract =) I'm trying to make sense of the following. I can't quite wrap my head around what this is actually doing: ------------- typedef enum {...
12
by: gcary | last post by:
I am having trouble figuring out how to declare a pointer to an array of structures and initializing the pointer with a value. I've looked at older posts in this group, and tried a solution that...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.