List:MySQL++« Previous MessageNext Message »
From:Alex Date:August 21 2008 7:06pm
Subject:Re: A way to copy mysqlpp::StoreQueryResult into a std::map?
View as plain text  
Haha, no, not homework. Just a project I'm working on. :)

Thanks for that extensive piece of code. I'll try to give it a shot
tomorrow.. Right now, I'm going to go to sleep.

Thanks again. :)

2008/8/21 Warren Young <mysqlpp@stripped>

> Alex wrote:
>
>>
>> So you can understand that I wouldn't be able to directly refer to the
>> specific command the user wants help for as the vector is split up in
>> numbers.
>>
>
> I understand no such thing.  The answer is simple either way:
>
>        Query q = conn.query("SELECT * FROM command WHERE NAME =");
>        q << quote << myCommandName;
>        StoreQueryResult res = q.store();
>        if (res) {
>                // have help for this command
>        }
>        else {
>                // don't have help for this command
>        }
>
> Or:
>
>        class command {
>        public:
>                command(const char* name, const char* help = 0,
>                        const char* syntax = 0) :
>                name_(name),
>                help_(help ? help : ""),
>                syntax_(syntax ? syntax : "")
>                {
>                }
>                ....
>                bool operator==(const command& rhs)
>                {
>                        return name_ == rhs.name_;
>                }
>        private:
>                string name_, help_, syntax_;
>        };
>
>        vector<commands> vc;
>
>        // populate vector of command objects somehow
>
>        vector<commands>::iterator it = find(vc.begin(), vc.end(),
>                command(myCommandName));
>        if (it != vc.end()) {
>                // have help for this command
>        }
>        else {
>                // don't have help for this command
>        }
>
> So, is this a homework problem, or what?
>
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>


-- 
GamerzWoW - http://www.gamerzwow.net

Thread
A way to copy mysqlpp::StoreQueryResult into a std::map?Alex13 Aug
  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young13 Aug
    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex13 Aug
      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young13 Aug
        • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex14 Aug
          • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex17 Aug
            • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young17 Aug
              • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex19 Aug
                • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young19 Aug
                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex20 Aug
                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young21 Aug
                      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex21 Aug
                        • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young21 Aug
                          • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex21 Aug
                            • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                              • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                      • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                        • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex22 Aug
                                          • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young22 Aug
                                            • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex25 Aug
                                              • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Joel Fielder26 Aug
                                                • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex26 Aug
                                                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Joel Fielder26 Aug
                                                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex26 Aug
                                                  • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Warren Young26 Aug
                                                    • Re: A way to copy mysqlpp::StoreQueryResult into a std::map?Alex27 Aug