[Mysql-cocoa-commits] CVS: Documentation/website/SMySQL_doc MCPConnection+MCPFastQueries.html,NONE,1
Brought to you by:
sergecohen
From: Serge C. <ser...@us...> - 2003-08-19 10:04:44
|
Update of /cvsroot/mysql-cocoa/Documentation/website/SMySQL_doc In directory sc8-pr-cvs1:/tmp/cvs-serv31190/website/SMySQL_doc Added Files: MCPConnection+MCPFastQueries.html MCPConnection.html MCPResult+MCPResultPlus.html MCPResult.html NSObject+MCPNSNullTest.html Removed Files: SMySQLConnection.html SMySQLResult.html Log Message: Started a big update of the website. Added the latest 2 'new' updates (one for version 2.0, 25 Dec 2002, one for version 2.2.0, yesterday). Still a lot to do (moving most of the updates to an archive file a-la MacGPG, rewriting the about, file, documentation sections). 2003-08-19; Serge Cohen. --- NEW FILE: MCPConnection+MCPFastQueries.html --- <HTML><HEAD><TITLE></TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <BR><BR><FONT COLOR="#000066"><H1><A NAME="//apple_ref/occ/cl/MCPConnection (MCPFastQueries)">MCPConnection (MCPFastQueries)</A></H1></FONT><BR> <blockquote><DL><DT><B>Declared In:</B></DT> <DD>MCPFastQueries.h</DD> </DL></blockquote> <BR><BR> <H2>Category Description</H2> <CODE> $Id: MCPConnection+MCPFastQueries.html,v 1.1 2003/08/19 10:04:41 sergecohen Exp $ </CODE><P> This actegory is made up to keep the extra methods out or the core of the framework.<P> Basicly this is the place to add methods which are useful, but are just wrappers to the methods of the core (MCPConnection, MCPResult). The purpous being to have a single line call available for current tasks which otherwise would need a couple of lines and object defined. <P><HR WIDTH=50% ALIGN=LEFT> <H2>Method Types</H2> <blockquote> For insert queries, get directly the Id of the newly inserted row <DL><DT></DT> <DD> <A HREF="#- insertQuery:">- insertQuery:</A></DD> <DD> <A HREF="#- updateQuery:">- updateQuery:</A></DD> </DL> Returns directly a proper NS object, or a collection (NSArray, NSDictionary...). <DL><DT></DT> <DD> <A HREF="#- getFirstFieldFromQuery:">- getFirstFieldFromQuery:</A></DD> <DD> <A HREF="#- getFirstRowFromQuery:asType:">- getFirstRowFromQuery:asType:</A></DD> <DD> <A HREF="#- getAllRowsFromQuery:asType:">- getAllRowsFromQuery:asType:</A></DD> <DD> <A HREF="#- getQuery:colWithIndex:">- getQuery:colWithIndex:</A></DD> <DD> <A HREF="#- getQuery:colWithName:">- getQuery:colWithName:</A></DD> </DL> </blockquote> <HR WIDTH=50% ALIGN=LEFT> <H2>Instance Methods</H2> <A NAME="- getAllRowsFromQuery:asType:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/getAllRowsFromQuery:asType:">getAllRowsFromQuery:asType:</A></H3><P> <CODE>- (id)<B>getAllRowsFromQuery:</B>(NSString *)<EM>aQuery</EM> <B>asType:</B>(MCPReturnType)<EM>aType</EM> </CODE><P> Get a bidimensional table of the whole rows of the result from the query <I>aQuery</I>. The type of the result is choosen by <I>aType</I>, it can be (MCPTypeArray, MCPTypeDictionary, MCPTypeFlippedArray & MCPTypeFlippedDictionary). Description of the types can be found in method <CODE>fetch2DResultAsType:</CODE>. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- getFirstFieldFromQuery:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/getFirstFieldFromQuery:">getFirstFieldFromQuery:</A></H3><P> <CODE>- (id)<B>getFirstFieldFromQuery:</B>(NSString *)<EM>aQuery</EM> </CODE><P> Get the first field of the first row of the result from the query (<I>aQuery</I>). Should return <B>nil</B> if no object at all are selected. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- getFirstRowFromQuery:asType:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/getFirstRowFromQuery:asType:">getFirstRowFromQuery:asType:</A></H3><P> <CODE>- (id)<B>getFirstRowFromQuery:</B>(NSString *)<EM>aQuery</EM> <B>asType:</B>(MCPReturnType)<EM>aType</EM> </CODE><P> Get the firdst row of the result from the query <I>aQuery</I>, in a collection of type determined by <I>aType</I> (MCPTypeArray or MCPTypeDictionary) <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- getQuery:colWithIndex:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/getQuery:colWithIndex:">getQuery:colWithIndex:</A></H3><P> <CODE>- (NSArray *)<B>getQuery:</B>(NSString *)<EM>aQuery</EM> <B>colWithIndex:</B>(unsigned int)<EM>aCol</EM> </CODE><P> Get a column (as an NSArray) of the result from the query <I>aQuery</I>. The column is choosen from it's index, starting from 0. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- getQuery:colWithName:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/getQuery:colWithName:">getQuery:colWithName:</A></H3><P> <CODE>- (NSArray *)<B>getQuery:</B>(NSString *)<EM>aQuery</EM> <B>colWithName:</B>(NSString *)<EM>aColName</EM> </CODE><P> Get a column (as an NSArray) of the result from the query <I>aQuery</I>. The column is choosen from it's name. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- insertQuery:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/insertQuery:">insertQuery:</A></H3><P> <CODE>- (my_ulonglong)<B>insertQuery:</B>(NSString *)<EM>aQuery</EM> </CODE><P> Send the query <I>aQuery</I> to the server and retrieve the row <B>id</B> if the table have a autoincrement column. Returns 0 if no have been inserted <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- updateQuery:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection (MCPFastQueries)/updateQuery:">updateQuery:</A></H3><P> <CODE>- (my_ulonglong)<B>updateQuery:</B>(NSString *)<EM>aQuery</EM> </CODE><P> Send the query <I>aQuery</I> to the server and retrieve the number of affected rows (should work with <CODE>update</CODE>, <CODE>delete</CODE>, <CODE>insert</CODE> and <CODE>select</CODE> type of queries).<P> NB: This can also be used with a <CODE>select</CODE> query if you are only interested in the number of row complying with the query; you'll get no chance to get the result from the query, except by sending the query again (with <CODE>queryString:</CODE>) <P><HR> Version 1.2 Copyright ©2002 by Serge Cohen. All Rights Reserved. Mon Aug 18 14:35:42 2003 <P> </BODY></HTML> --- NEW FILE: MCPConnection.html --- <HTML><HEAD><TITLE></TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <BR><BR><FONT COLOR="#000066"><H1><A NAME="//apple_ref/occ/cl/MCPConnection">MCPConnection</A></H1></FONT><BR> <blockquote><DL><DT><B>Inherits From:</B></DT> <DD>NSObject</DD> </DL></blockquote> <blockquote><DL><DT><B>Declared In:</B></DT> <DD>MCPConnection.h</DD> </DL></blockquote> <BR><BR> <H2>Class Description</H2> <CODE> $Id: MCPConnection.html,v 1.1 2003/08/19 10:04:41 sergecohen Exp $ </CODE> <CODE> $Name: $ </CODE><P> This class is used to keep a connection with a MySQL server, it correspond to the MYSQL structure of the C API, or the database handle of the PERL DBI/DBD interface.<P> You have to start any work on a MySQL server by getting a working MCPConnection object.<P> Most likely you will use this kind of code:<P> <CODE> <BR> MCPConnection *theConnec = [MCPConnection alloc]; <BR> MCPResult *theRes;<BR> <BR> theConnec = [theConnec initToHost::albert.com withLogin:@"toto" password:@"albert" port:0]; <BR> [theConnec selectDB:@"db1"]; <BR> theRes = [theConnec queryString:@"select * from table1"]; <BR> ... <BR> </CODE> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Global Variables</H2> <blockquote> <H4>Synopsis:</H4> <CODE>const unsigned int <B><A NAME="//apple_ref/c/data/kMCPConnectionDefaultOption">kMCPConnectionDefaultOption</A></B>;</CODE><BR> <CODE>const char *<B><A NAME="//apple_ref/c/data/kMCPConnectionDefaultSocket">kMCPConnectionDefaultSocket</A></B>;</CODE><BR> <CODE>const unsigned int <B><A NAME="//apple_ref/c/data/kMCPConnectionNotInited">kMCPConnectionNotInited</A></B>;</CODE><BR> </blockquote> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Instance Variables</H2> <blockquote> <CODE>MYSQL *<B>mConnection</B>;</CODE><BR> <CODE>BOOL <B>mConnected</B>;</CODE><BR> <CODE>NSStringEncoding <B>mEncoding</B>;</CODE><BR> <P><TABLE> <TR><TD>mConnection</TD><TD>The inited MySQL connection</TD></TR> <TR><TD>mConnected</TD><TD>Reflect the fact that the connection is already in place or not</TD></TR> <TR><TD>mEncoding</TD><TD>The encoding used by MySQL server, to ISO-1 default</TD></TR> </TABLE> </blockquote> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Method Types</H2> <blockquote> Getting default of MySQL <DL><DT></DT> <DD> <A HREF="#+ getMySQLLocales">+ getMySQLLocales</A></DD> <DD> <A HREF="#+ encodingForMySQLEncoding:">+ encodingForMySQLEncoding:</A></DD> <DD> <A HREF="#+ defaultMySQLEncoding">+ defaultMySQLEncoding</A></DD> </DL> Class maintenance <DL><DT></DT> <DD> <A HREF="#+ initialize">+ initialize</A></DD> </DL> Initialisation <DL><DT></DT> <DD> <A HREF="#- init">- init</A></DD> <DD> <A HREF="#- initToHost:withLogin:password:usingPort:">- initToHost:withLogin:password:usingPort:</A></DD> <DD> <A HREF="#- initToSocket:withLogin:password:">- initToSocket:withLogin:password:</A></DD> <DD> <A HREF="#- setConnectionOption:withArgument:">- setConnectionOption:withArgument:</A></DD> <DD> <A HREF="#- connectWithLogin:password:host:port:socket:">- connectWithLogin:password:host:port:socket:</A></DD> <DD> <A HREF="#- selectDB:">- selectDB:</A></DD> </DL> Errors information <DL><DT></DT> <DD> <A HREF="#- getLastErrorMessage">- getLastErrorMessage</A></DD> <DD> <A HREF="#- getLastErrorID">- getLastErrorID</A></DD> <DD> <A HREF="#- isConnected">- isConnected</A></DD> <DD> <A HREF="#- checkConnection">- checkConnection</A></DD> </DL> Queries <DL><DT></DT> <DD> <A HREF="#- prepareBinaryData:">- prepareBinaryData:</A></DD> <DD> <A HREF="#- prepareString:">- prepareString:</A></DD> <DD> <A HREF="#- queryString:">- queryString:</A></DD> <DD> <A HREF="#- affectedRows">- affectedRows</A></DD> <DD> <A HREF="#- insertId">- insertId</A></DD> </DL> Getting description of the database structure <DL><DT></DT> <DD> <A HREF="#- listDBs">- listDBs</A></DD> <DD> <A HREF="#- listDBsLike:">- listDBsLike:</A></DD> <DD> <A HREF="#- listTables">- listTables</A></DD> <DD> <A HREF="#- listTablesLike:">- listTablesLike:</A></DD> <DD> <A HREF="#- listTablesFromDB:like:">- listTablesFromDB:like:</A></DD> <DD> <A HREF="#- listFieldsFromTable:">- listFieldsFromTable:</A></DD> <DD> <A HREF="#- listFieldsFromTable:like:">- listFieldsFromTable:like:</A></DD> </DL> Server information and control <DL><DT></DT> <DD> <A HREF="#- clientInfo">- clientInfo</A></DD> <DD> <A HREF="#- hostInfo">- hostInfo</A></DD> <DD> <A HREF="#- serverInfo">- serverInfo</A></DD> <DD> <A HREF="#- protoInfo">- protoInfo</A></DD> <DD> <A HREF="#- listProcesses">- listProcesses</A></DD> <DD> <A HREF="#- killProcess:">- killProcess:</A></DD> </DL> Disconnection <DL><DT></DT> <DD> <A HREF="#- disconnect">- disconnect</A></DD> <DD> <A HREF="#- dealloc">- dealloc</A></DD> </DL> String encoding concerns (c string type to NSString). It's unlikely that users of the framework needs to use these methods which are used internally <DL><DT></DT> <DD> <A HREF="#- setEncoding:">- setEncoding:</A></DD> <DD> <A HREF="#- encoding">- encoding</A></DD> <DD> <A HREF="#- cStringFromString:">- cStringFromString:</A></DD> <DD> <A HREF="#- stringWithCString:">- stringWithCString:</A></DD> </DL> Text data convertion to string <DL><DT></DT> <DD> <A HREF="#- stringWithText:">- stringWithText:</A></DD> </DL> </blockquote> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Class Methods</H2> <A NAME="+ defaultMySQLEncoding"></A><H3><A NAME="//apple_ref/occ/clm/MCPConnection/defaultMySQLEncoding">defaultMySQLEncoding</A></H3> <CODE>+ (NSStringEncoding)<B>defaultMySQLEncoding</B> </CODE><P> Returns the default charset of the library mysqlclient used. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="+ encodingForMySQLEncoding:"></A><H3><A NAME="//apple_ref/occ/clm/MCPConnection/encodingForMySQLEncoding:">encodingForMySQLEncoding:</A></H3> <CODE>+ (NSStringEncoding)<B>encodingForMySQLEncoding:</B>(const char *)<EM>mysqlEncoding</EM> </CODE><P> Gets a proper NSStringEncoding according to the given MySQL charset.<P> MySQL 4.0 offers this charsets: big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin1_de latin2 latin5 sjis swe7 tis620 ujis usa7 win1250 win1251ukr<P> WARNING : incomplete implementation. Please, send your fixes. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="+ getMySQLLocales"></A><H3><A NAME="//apple_ref/occ/clm/MCPConnection/getMySQLLocales">getMySQLLocales</A></H3> <CODE>+ (NSDictionary *)<B>getMySQLLocales</B> </CODE><P> Gets a proper Locale dictionary to use formater to parse strings from MySQL. For example strings representing dates should give a proper Locales for use with methods such as NSDate::dateWithNaturalLanguageString: locales: <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="+ initialize"></A><H3><A NAME="//apple_ref/occ/clm/MCPConnection/initialize">initialize</A></H3> <CODE>+ (void)<B>initialize</B> </CODE><P> Initialize the class version to 2.0.0 <HR WIDTH=50% ALIGN=LEFT> <H2>Instance Methods</H2> <A NAME="- affectedRows"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/affectedRows">affectedRows</A></H3><P> <CODE>- (my_ulonglong)<B>affectedRows</B> </CODE><P> Returns the number of affected rows by the last query. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- cStringFromString:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/cStringFromString:">cStringFromString:</A></H3><P> <CODE>- (const char *)<B>cStringFromString:</B>(NSString *)<EM>theString</EM> </CODE><P> For internal use only. Transforms a NSString to a C type string (ending with \0) using the character set from the MCPConnection. Lossy conversions are enabled. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- checkConnection"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/checkConnection">checkConnection</A></H3><P> <CODE>- (BOOL)<B>checkConnection</B> </CODE><P> Checks if the connection to the server is still on. If not, tries to reconnect (changing no parameters from the MYSQL pointer). This method just uses mysql_ping(). <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- clientInfo"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/clientInfo">clientInfo</A></H3><P> <CODE>- (NSString *)<B>clientInfo</B> </CODE><P> Returns a string giving the client library version. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- connectWithLogin:password:host:port:socket:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/connectWithLogin:password:host:port:socket:">connectWithLogin:password:host:port:socket:</A></H3><P> <CODE>- (BOOL)<B>connectWithLogin:</B>(NSString *)<EM>login</EM> <B>password:</B>(NSString *)<EM>pass</EM> <B>host:</B>(NSString *)<EM>host</EM> <B>port:</B>(int)<EM>port</EM> <B>socket:</B>(NSString *)<EM>socket</EM> </CODE><P> The method used by <CODE>initToHost:withLogin:password:usingPort:</CODE> and <CODE>initToSocket:withLogin:password:</CODE>. Same information and use of the parameters:<P> - <I>login</I> is the user name - <I>pass</I> is the password corresponding to the user name - <I>host</I> is the hostname or IP adress - <I>port</I> is the TCP <I>port</I> to use to connect. If <I>port</I> = 0, uses the default <I>port</I> from mysql.h - <I>socket</I> is the path to the <I>socket</I> (for the localhost)<P> The <I>socket</I> is used if the <I>host</I> is set to <CODE>@"localhost"</CODE>, to an empty or a <CODE>nil</CODE> string For the moment the implementation might not be safe if you have a <B>nil</B> pointer to one of the NSString* variables (underestand: I don't know what the result will be). <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- dealloc"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/dealloc">dealloc</A></H3><P> <CODE>- (void)<B>dealloc</B> </CODE><P> The standard deallocation method for MCPConnection objects. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- disconnect"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/disconnect">disconnect</A></H3><P> <CODE>- (void)<B>disconnect</B> </CODE><P> Disconnects a connected MCPConnection object; used by <CODE>dealloc:</CODE> method. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- encoding"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/encoding">encoding</A></H3><P> <CODE>- (NSStringEncoding)<B>encoding</B> </CODE><P> Gets the encoding for the connection <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- getLastErrorID"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/getLastErrorID">getLastErrorID</A></H3><P> <CODE>- (unsigned int)<B>getLastErrorID</B> </CODE><P> Returns the ErrorID of the last MySQL error on the connection. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- getLastErrorMessage"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/getLastErrorMessage">getLastErrorMessage</A></H3><P> <CODE>- (NSString *)<B>getLastErrorMessage</B> </CODE><P> Returns a string with the last MySQL error message on the connection. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- hostInfo"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/hostInfo">hostInfo</A></H3><P> <CODE>- (NSString *)<B>hostInfo</B> </CODE><P> Returns a string giving information on the host of the DB server. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- init"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/init">init</A></H3><P> <CODE>- (id)<B>init</B> </CODE><P> Initialise a MySQLConnection without making a connection, most likely useless, except with <CODE>setConnectionOption:withArgument:</CODE>. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- initToHost:withLogin:password:usingPort:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/initToHost:withLogin:password:usingPort:">initToHost:withLogin:password:usingPort:</A></H3><P> <CODE>- (id)<B>initToHost:</B>(NSString *)<EM>host</EM> <B>withLogin:</B>(NSString *)<EM>login</EM> <B>password:</B>(NSString *)<EM>pass</EM> <B>usingPort:</B>(int)<EM>port</EM> </CODE><P> Initialise a connection using a <B>TCP/IP connection</B> with the given parameters (except if <I>host</I> is set to <CODE>localhost</CODE>, in which case uses the default)<P> - <I>host</I> is the hostname or IP adress - <I>login</I> is the user name - <I>pass</I> is the password corresponding to the user name - <I>port</I> is the TCP <I>port</I> to use to connect. If <I>port</I> = 0, uses the default <I>port</I> from mysql.h <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- initToSocket:withLogin:password:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/initToSocket:withLogin:password:">initToSocket:withLogin:password:</A></H3><P> <CODE>- (id)<B>initToSocket:</B>(NSString *)<EM>socket</EM> <B>withLogin:</B>(NSString *)<EM>login</EM> <B>password:</B>(NSString *)<EM>pass</EM> </CODE><P> Initialise a connection using a <B>unix <I>socket</I></B> with the given parameters<P> - <I>socket</I> is the path to the <I>socket</I> - <I>login</I> is the user name - <I>pass</I> is the password corresponding to the user name <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- insertId"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/insertId">insertId</A></H3><P> <CODE>- (my_ulonglong)<B>insertId</B> </CODE><P> If the last query was an insert in a table having a autoindex column, returns the <B>id</B> (autoindexed field) of the last row inserted. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- isConnected"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/isConnected">isConnected</A></H3><P> <CODE>- (BOOL)<B>isConnected</B> </CODE><P> Returns YES if the MCPConnection is connected to a DB, NO otherwise. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- killProcess:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/killProcess:">killProcess:</A></H3><P> <CODE>- (BOOL)<B>killProcess:</B>(unsigned long)<EM>pid</EM> </CODE><P> Kills the process with the given <I>pid</I>. The users needs the <CODE>Process_priv</CODE> privilege. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listDBs"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listDBs">listDBs</A></H3><P> <CODE>- (MCPResult *)<B>listDBs</B> </CODE><P> Just a fast wrapper for the more complex <CODE>listDBsWithPattern:</CODE> method. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listDBsLike:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listDBsLike:">listDBsLike:</A></H3><P> <CODE>- (MCPResult *)<B>listDBsLike:</B>(NSString *)<EM>dbsName</EM> </CODE><P> Returns a list of database which name correspond to the SQL regular expression in 'pattern'. The comparison is done with wild card extension : % and _. The result should correspond to the queryString:@"SHOW databases [LIKE wild]"; but implemented with mysql_list_dbs. If an empty string or <B>nil</B> is passed as pattern, all databases will be shown. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listFieldsFromTable:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listFieldsFromTable:">listFieldsFromTable:</A></H3><P> <CODE>- (MCPResult *)<B>listFieldsFromTable:</B>(NSString *)<EM>tableName</EM> </CODE><P> Just a fast wrapper for the more complex list <CODE>listFieldsWithPattern:forTable:</CODE> method. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listFieldsFromTable:like:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listFieldsFromTable:like:">listFieldsFromTable:like:</A></H3><P> <CODE>- (MCPResult *)<B>listFieldsFromTable:</B>(NSString *)<EM>tableName</EM> <B>like:</B>(NSString *)<EM>fieldsName</EM> </CODE><P> Show all the fields of the table <I>tableName</I> which name correspond to pattern (with wild card expansion : %,_). Indeed, and as recommanded from mysql reference, this method is NOT using mysql_list_fields but the <CODE>queryString:</CODE> method. If an empty string or <B>nil</B> is passed as <I>fieldsName</I>, all fields (of <I>tableName</I>) will be returned. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listProcesses"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listProcesses">listProcesses</A></H3><P> <CODE>- (MCPResult *)<B>listProcesses</B> </CODE><P> Lists active process <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listTables"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listTables">listTables</A></H3><P> <CODE>- (MCPResult *)<B>listTables</B> </CODE><P> Make sure a DB is selected (with <CODE>selectDB:</CODE> method) first. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listTablesFromDB:like:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listTablesFromDB:like:">listTablesFromDB:like:</A></H3><P> <CODE>- (MCPResult *)<B>listTablesFromDB:</B>(NSString *)<EM>dbName</EM> <B>like:</B>(NSString *)<EM>tablesName</EM> </CODE><P> List tables in DB specified by <I>dbName</I> and corresponding to pattern. This method indeed issues a <CODE>SHOW TABLES FROM dbName LIKE ...</CODE> query to the server. This is done this way to make sure the selected DB is not changed by this method. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- listTablesLike:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/listTablesLike:">listTablesLike:</A></H3><P> <CODE>- (MCPResult *)<B>listTablesLike:</B>(NSString *)<EM>tablesName</EM> </CODE><P> From within a database, give back the list of table which name correspond to <I>tablesName</I> (with wild card %, _ extension). Correspond to queryString:@"SHOW tables [LIKE wild]"; uses mysql_list_tables function. If an empty string or <B>nil</B> is passed as <I>tablesName</I>, all tables will be shown. WARNING: <B>produce an error if no databases are selected</B> (with <CODE>selectDB:</CODE> for example). <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- prepareBinaryData:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/prepareBinaryData:">prepareBinaryData:</A></H3><P> <CODE>- (NSString *)<B>prepareBinaryData:</B>(NSData *)<EM>theData</EM> </CODE><P> Takes a NSData object and transform it in a proper string for sending to the server in between quotes. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- prepareString:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/prepareString:">prepareString:</A></H3><P> <CODE>- (NSString *)<B>prepareString:</B>(NSString *)<EM>theString</EM> </CODE><P> Takes a string and escape any special character (like single quote : ') so that the string can be used directly in a query. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- protoInfo"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/protoInfo">protoInfo</A></H3><P> <CODE>- (NSNumber *)<B>protoInfo</B> </CODE><P> Returns the number of the protocole used to transfer info from server to client <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- queryString:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/queryString:">queryString:</A></H3><P> <CODE>- (MCPResult *)<B>queryString:</B>(NSString *)<EM>query</EM> </CODE><P> Takes a <I>query</I> string and return an MCPResult object holding the result of the <I>query</I>. The returned MCPResult is not retained, the client is responsible for that (it's autoreleased before being returned). If no field are present in the result (like in an insert <I>query</I>), will return <B>nil</B> (<B>difference from previous version implementation</B>). Though, if their is at least one field the result will be non <B>nil</B> (even if no row are selected).<P> Note that if you want to use this method with binary data (in the <I>query</I>), you should use <CODE>prepareBinaryData:</CODE> to include the binary data in the <I>query</I> string. Also if you want to include in your <I>query</I> a string containing any special character (\, ', " ...) then you should use <CODE>prepareString</CODE>. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- selectDB:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/selectDB:">selectDB:</A></H3><P> <CODE>- (BOOL)<B>selectDB:</B>(NSString *)<EM>dbName</EM> </CODE><P> Selects a database to work with. The MCPConnection object needs to be properly inited and connected to a server. If a connection is not yet set or the selection of the database didn't work, returns NO. Returns YES in normal cases where the database is properly selected.<P> So far, if <I>dbName</I> is a <B>nil</B> pointer it will return NO (as if it cannot connect), most likely this will throw an exception in the future. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- serverInfo"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/serverInfo">serverInfo</A></H3><P> <CODE>- (NSString *)<B>serverInfo</B> </CODE><P> Returns a string giving the server version. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- setConnectionOption:withArgument:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/setConnectionOption:withArgument:">setConnectionOption:withArgument:</A></H3><P> <CODE>- (BOOL)<B>setConnectionOption:</B>(int)<EM>option</EM> <B>withArgument:</B>(id)<EM>arg</EM> </CODE><P> <B>NOT YET IMPLEMENTED</B><P> This method is to be used for getting special <I>option</I> for a connection, in which case the MCPConnection has to be inited with the init method, then <I>option</I> are selected, finally connection is done using one of the connect methods:<P> <CODE> <BR> MCPConnection *theConnect = [[MCPConnection alloc] init]; <BR> [theConnect setConnectionOption: option withArgument: arg]; <BR> [theConnect connectToHost:albert.com withLogin:@"toto" password:@"albert" port:0]; <BR> .... <BR> </CODE> <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- setEncoding:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/setEncoding:">setEncoding:</A></H3><P> <CODE>- (void)<B>setEncoding:</B>(NSStringEncoding)<EM>theEncoding</EM> </CODE><P> Sets the encoding used by the server for data transfert. Used to make sure the output of the query result is ok even for non-ascii characters The character set (encoding) used by the db is passed to the MCPConnection object upon connection, so most likely the encoding (from -encoding) method is already the proper one. That is to say : It's unlikely you will need to call this method directly, and <B>if ever you use it, do it at your own risks</B>. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- stringWithCString:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/stringWithCString:">stringWithCString:</A></H3><P> <CODE>- (NSString *)<B>stringWithCString:</B>(const char *)<EM>theCString</EM> </CODE><P> Returns a NSString from a C style string encoded with the character set of theMCPConnection. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- stringWithText:"></A><H3><A NAME="//apple_ref/occ/instm/MCPConnection/stringWithText:">stringWithText:</A></H3><P> <CODE>- (NSString *)<B>stringWithText:</B>(NSData *)<EM>theTextData</EM> </CODE><P> Use the string encoding to convert the returned NSData to a string (for a Text field) <P><HR> Version 1.5 Copyright ©2003 by Serge Cohen. All Rights Reserved. Mon Aug 18 14:35:42 2003 <P> </BODY></HTML> --- NEW FILE: MCPResult+MCPResultPlus.html --- <HTML><HEAD><TITLE></TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <BR><BR><FONT COLOR="#000066"><H1><A NAME="//apple_ref/occ/cl/MCPResult (MCPResultPlus)">MCPResult (MCPResultPlus)</A></H1></FONT><BR> <blockquote><DL><DT><B>Declared In:</B></DT> <DD>MCPResultPlus.h</DD> </DL></blockquote> <BR><BR> <H2>Category Description</H2> <CODE> $Id: MCPResult+MCPResultPlus.html,v 1.1 2003/08/19 10:04:41 sergecohen Exp $ </CODE><P> This Category is provided to get shortcuts reformat the table obtained by a MCPResult (fetching a column, a 2D array...). <P><HR WIDTH=50% ALIGN=LEFT> <H2>Method Types</H2> <blockquote> Getting a complete column as an array <DL><DT></DT> <DD> <A HREF="#- fetchColAtIndex:">- fetchColAtIndex:</A></DD> <DD> <A HREF="#- fetchColWithName:">- fetchColWithName:</A></DD> </DL> Getting the complete result as 2D array <DL><DT></DT> <DD> <A HREF="#- fetch2DResultAsType:">- fetch2DResultAsType:</A></DD> </DL> </blockquote> <HR WIDTH=50% ALIGN=LEFT> <H2>Instance Methods</H2> <A NAME="- fetch2DResultAsType:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult (MCPResultPlus)/fetch2DResultAsType:">fetch2DResultAsType:</A></H3><P> <CODE>- (id)<B>fetch2DResultAsType:</B>(MCPReturnType)<EM>aType</EM> </CODE><P> Returns the complete result table in a 2D object, which type depends on <I>aType</I>:<P> - <CODE>MCPTypeArray</CODE> : a NSArray of rows as NSArray,<P> - <CODE>MCPTypeDictionary</CODE> : a NSArray of rows as NSDictionary,<P> - <CODE>MCPTypeFlippedArray</CODE> : a NSArray of columns (as NSArray),<P> - <CODE>MCPTypeFlippedDictionary</CODE> : a NSDictionary of columns (as NSArray)<P> In any case the read position is restored at the end of the call (hence a fetchRow will get the same row wether this method is called before it or not). <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchColAtIndex:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult (MCPResultPlus)/fetchColAtIndex:">fetchColAtIndex:</A></H3><P> <CODE>- (NSArray *)<B>fetchColAtIndex:</B>(unsigned int)<EM>aCol</EM> </CODE><P> Getting a complete column into a NSArray (1D). The index starts from 0 (first column).<P> The index 0 of the returned array always correspond to the first row (ie: returned NSArray is indexed by row number), the read position is restored after to it's initial position after the read. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchColWithName:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult (MCPResultPlus)/fetchColWithName:">fetchColWithName:</A></H3><P> <CODE>- (NSArray *)<B>fetchColWithName:</B>(NSString *)<EM>aColName</EM> </CODE><P> The same as <CODE>fetchColAtIndex:</CODE>, but the choice of the column is done by it's field name. Indeed it is just a wrapper to <CODE>fetchColAtIndex</CODE>. <P><HR> Version 1.2 Copyright ©2002 by Serge Cohen. All Rights Reserved. Mon Aug 18 14:35:42 2003 <P> </BODY></HTML> --- NEW FILE: MCPResult.html --- <HTML><HEAD><TITLE></TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <BR><BR><FONT COLOR="#000066"><H1><A NAME="//apple_ref/occ/cl/MCPResult">MCPResult</A></H1></FONT><BR> <blockquote><DL><DT><B>Inherits From:</B></DT> <DD>NSObject</DD> </DL></blockquote> <blockquote><DL><DT><B>Declared In:</B></DT> <DD>MCPResult.h</DD> </DL></blockquote> <BR><BR> <H2>Class Description</H2> <CODE> $Id: MCPResult.html,v 1.1 2003/08/19 10:04:41 sergecohen Exp $ </CODE><P> Hold the results of a query to a MySQL database server. It correspond to the MYSQL_RES structure of the C API, and to the statement handle of the PERL DBI/DBD.<P> Uses the <CODE>mysql_store_result()</CODE> function from the C API.<P> This object is generated only by a MCPConnection object, in this way (see <B>MCPConnection</B> documentation):<P> <CODE> <BR> MCPConnection *theConnec = [MCPConnection alloc]; <BR> MCPResult *theRes; <BR> NSDictionnary *theDict; <BR> NSArray *theColNames; <BR> int i, j;<BR> <BR> theConnec = [theConnec initToHost::albert.com withLogin:@"toto" password:@"albert" port:0]; <BR> [theConnec selectDB:@"db1"]; <BR> theRes = [theConnec queryString:@"select * from table1"]; <BR> theColNames = [theRes fetchFiedlsName]; <BR> i = 0; <BR> while (theDict = [theRes fetchRowAsDictionary]){ <BR> NSLog(@"Row : <I>d</I>\n", i); <BR> for (j=0; j<[theColNames count]; j++) { <BR> NSLog(@" Field : %@, contain : %@\n", [theColNames objectAtInex:j], [theDict objectForKey:[theColNames objectAtIndex:j]]); <BR> }<BR> i++; <BR> }<BR> </CODE> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Instance Variables</H2> <blockquote> <CODE>MYSQL_RES *<B>mResult</B>;</CODE><BR> <CODE>NSArray *<B>mNames</B>;</CODE><BR> <CODE>NSDictionary *<B>mMySQLLocales</B>;</CODE><BR> <CODE>NSStringEncoding <B>mEncoding</B>;</CODE><BR> <CODE>unsigned int <B>mNumOfFields</B>;</CODE><BR> <P><TABLE> <TR><TD>mResult</TD><TD>The MYSQL_RES structure of the C API</TD></TR> <TR><TD>mNames</TD><TD>An NSArray holding the name of the columns</TD></TR> <TR><TD>mMySQLLocales</TD><TD>A Locales dictionary to define the locales of MySQL</TD></TR> <TR><TD>mEncoding</TD><TD>The encoding used by MySQL server, to ISO-1 default</TD></TR> <TR><TD>mNumOfFields</TD><TD>The number of fields in the result</TD></TR> </TABLE> </blockquote> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Method Types</H2> <blockquote> Class maintenance <DL><DT></DT> <DD> <A HREF="#+ initialize">+ initialize</A></DD> </DL> Init used <B>only</B> by <B>MCPConnection</B> <DL><DT></DT> <DD> <A HREF="#- initWithMySQLPtr:encoding:">- initWithMySQLPtr:encoding:</A></DD> <DD> <A HREF="#- initWithResPtr:encoding:">- initWithResPtr:encoding:</A></DD> <DD> <A HREF="#- init">- init</A></DD> </DL> General info on the result <DL><DT></DT> <DD> <A HREF="#- numOfRows">- numOfRows</A></DD> <DD> <A HREF="#- numOfFields">- numOfFields</A></DD> </DL> Getting the rows <DL><DT></DT> <DD> <A HREF="#- dataSeek:">- dataSeek:</A></DD> <DD> <A HREF="#- fetchRowAsType:">- fetchRowAsType:</A></DD> <DD> <A HREF="#- fetchRowAsArray">- fetchRowAsArray</A></DD> <DD> <A HREF="#- fetchRowAsDictionary">- fetchRowAsDictionary</A></DD> </DL> Getting information on columns <DL><DT></DT> <DD> <A HREF="#- fetchFieldsName">- fetchFieldsName</A></DD> <DD> <A HREF="#- fetchTypesAsType:">- fetchTypesAsType:</A></DD> <DD> <A HREF="#- fetchTypesAsArray">- fetchTypesAsArray</A></DD> <DD> <A HREF="#- fetchTypesAsDictionary">- fetchTypesAsDictionary</A></DD> <DD> <A HREF="#- isBlobAtIndex:">- isBlobAtIndex:</A></DD> <DD> <A HREF="#- isBlobForKey:">- isBlobForKey:</A></DD> </DL> Text data convertion to string <DL><DT></DT> <DD> <A HREF="#- stringWithText:">- stringWithText:</A></DD> </DL> Utility method <DL><DT></DT> <DD> <A HREF="#- description">- description</A></DD> </DL> End of the scope... <DL><DT></DT> <DD> <A HREF="#- dealloc">- dealloc</A></DD> </DL> Private methods, internal use only <DL><DT></DT> <DD> <A HREF="#- cStringFromString:">- cStringFromString:</A></DD> <DD> <A HREF="#- stringWithCString:">- stringWithCString:</A></DD> </DL> </blockquote> <P><HR WIDTH=50% ALIGN=LEFT> <H2>Class Methods</H2> <A NAME="+ initialize"></A><H3><A NAME="//apple_ref/occ/clm/MCPResult/initialize">initialize</A></H3> <CODE>+ (void)<B>initialize</B> </CODE><P> Initialize the class version to 2.0.0 <HR WIDTH=50% ALIGN=LEFT> <H2>Instance Methods</H2> <A NAME="- cStringFromString:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/cStringFromString:">cStringFromString:</A></H3><P> <CODE>- (const char *)<B>cStringFromString:</B>(NSString *)<EM>theString</EM> </CODE><P> For internal use only. Transform a NSString to a C type string (ended with \0) using ethe character set from the MCPConnection. Lossy conversions are enabled. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- dataSeek:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/dataSeek:">dataSeek:</A></H3><P> <CODE>- (void)<B>dataSeek:</B>(my_ulonglong)<EM>row</EM> </CODE><P> Go to a precise <I>row</I> in the selected result. 0 is the very first <I>row</I> <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- dealloc"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/dealloc">dealloc</A></H3><P> <CODE>- (void)<B>dealloc</B> </CODE><P> No method description. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- description"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/description">description</A></H3><P> <CODE>- (NSString *)<B>description</B> </CODE><P> Return a (long) string containing the table of results, first line being the fields name, next line(s) the row(s). Useful to have NSLog logging a MCPResult (example). <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchFieldsName"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchFieldsName">fetchFieldsName</A></H3><P> <CODE>- (NSArray *)<B>fetchFieldsName</B> </CODE><P> Generate the mNames if not already generated, and return it.<P> mNames is a NSArray holding the names of the fields(columns) of the results <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchRowAsArray"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchRowAsArray">fetchRowAsArray</A></H3><P> <CODE>- (NSArray *)<B>fetchRowAsArray</B> </CODE><P> Return the next row of the result as an array, the index in select field order, the object a proper object for handling the information in the field (NSString, NSNumber ...).<P> Just a <B>typed</B> wrapper for method <CODE>fetchRosAsType:</CODE> (with arg MCPTypeArray).<P> NB: Returned object is immutable. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchRowAsDictionary"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchRowAsDictionary">fetchRowAsDictionary</A></H3><P> <CODE>- (NSDictionary *)<B>fetchRowAsDictionary</B> </CODE><P> Return the next row of the result as a dictionary, the key being the field name, the object a proper object for handling the information in the field (NSString, NSNumber ...).<P> Just a <B>typed</B> wrapper for method <CODE>fetchRosAsType:</CODE> (with arg MCPTypeDictionary).<P> NB: Returned object is immutable. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchRowAsType:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchRowAsType:">fetchRowAsType:</A></H3><P> <CODE>- (id)<B>fetchRowAsType:</B>(MCPReturnType)<EM>aType</EM> </CODE><P> Return the next row of the result as a collection of type defined by <I>aType</I> (namely MCPTypeArray or MCPTypeDictionary). Each field of the row is made into a proper object to hold the info (NSNumber, NSString...).<P> This method returned directly the <B>mutable</B> object generated while going through all the columns <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchTypesAsArray"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchTypesAsArray">fetchTypesAsArray</A></H3><P> <CODE>- (NSArray *)<B>fetchTypesAsArray</B> </CODE><P> Return an array of the fields' types.<P> NB: Returned object is immutable. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchTypesAsDictionary"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchTypesAsDictionary">fetchTypesAsDictionary</A></H3><P> <CODE>- (NSDictionary *)<B>fetchTypesAsDictionary</B> </CODE><P> Return a dictionnary of the fields' types (keys are the fields' names).<P> NB: Returned object is immutable. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- fetchTypesAsType:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/fetchTypesAsType:">fetchTypesAsType:</A></H3><P> <CODE>- (id)<B>fetchTypesAsType:</B>(MCPReturnType)<EM>aType</EM> </CODE><P> Return a collection of the fields's type. The type of collection is choosen by the <I>aType</I> variable (MCPTypeArray or MCPTypeDictionary).<P> This method returned directly the <B>mutable</B> object generated while going through all the columns <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- init"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/init">init</A></H3><P> <CODE>- (id)<B>init</B> </CODE><P> Empty init, normaly of NO use to the user, again, MCPResult should be made through calls to MCPConnection <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- initWithMySQLPtr:encoding:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/initWithMySQLPtr:encoding:">initWithMySQLPtr:encoding:</A></H3><P> <CODE>- (id)<B>initWithMySQLPtr:</B>(MYSQL *)<EM>mySQLPtr</EM> <B>encoding:</B>(NSStringEncoding)<EM>theEncoding</EM> </CODE><P> initialise a MCPResult, it is used internally by MCPConnection <CODE>queryString:</CODE> method: the only proper way to get a running MCPResult object. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- initWithResPtr:encoding:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/initWithResPtr:encoding:">initWithResPtr:encoding:</A></H3><P> <CODE>- (id)<B>initWithResPtr:</B>(MYSQL_RES *)<EM>mySQLResPtr</EM> <B>encoding:</B>(NSStringEncoding)<EM>theEncoding</EM> </CODE><P> This metod it is used internally by MCPConnection object when it have already a MYSQL_RES object to initialise MCPResult object. Initialise a MCPResult with the MYSQL_RES pointer (returned by such a function as mysql_list_dbs). NB: MCPResult should be made by using one of the method of MCPConnection. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- isBlobAtIndex:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/isBlobAtIndex:">isBlobAtIndex:</A></H3><P> <CODE>- (BOOL)<B>isBlobAtIndex:</B>(unsigned int)<EM>index</EM> </CODE><P> Return YES if the field with the given <I>index</I> is a BLOB. It should be used to discriminates between BLOBs and TEXTs.<P> <B>NOT YET IMPLEMENTED</B>, return YES for both BLOBs and TEXTs... <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- isBlobForKey:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/isBlobForKey:">isBlobForKey:</A></H3><P> <CODE>- (BOOL)<B>isBlobForKey:</B>(NSString *)<EM>key</EM> </CODE><P> Return YES if the field (by name) with the given index is a BLOB. It should be used to discriminates between BLOBs and TEXTs.<P> <B>NOT YET IMPLEMENTED</B>, return YES for both BLOBs and TEXTs... <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- numOfFields"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/numOfFields">numOfFields</A></H3><P> <CODE>- (unsigned int)<B>numOfFields</B> </CODE><P> Return the number of fields selected by the query. As a side effect it forces an update of the number of fields. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- numOfRows"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/numOfRows">numOfRows</A></H3><P> <CODE>- (my_ulonglong)<B>numOfRows</B> </CODE><P> Return the number of rows selected by the query. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- stringWithCString:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/stringWithCString:">stringWithCString:</A></H3><P> <CODE>- (NSString *)<B>stringWithCString:</B>(const char *)<EM>theCString</EM> </CODE><P> Return a NSString from a C style string encoded with the character set of theMCPConnection. <P><HR WIDTH=25% ALIGN=LEFT> <A NAME="- stringWithText:"></A><H3><A NAME="//apple_ref/occ/instm/MCPResult/stringWithText:">stringWithText:</A></H3><P> <CODE>- (NSString *)<B>stringWithText:</B>(NSData *)<EM>theTextData</EM> </CODE><P> Use the string encoding to convert the returned NSData to a string (for a Text field) <P><HR> Version 1.2 Copyright ©2002 by Serge Cohen. All Rights Reserved. Mon Aug 18 14:35:42 2003 <P> </BODY></HTML> --- NEW FILE: NSObject+MCPNSNullTest.html --- <HTML><HEAD><TITLE></TITLE></HEAD> <BODY BGCOLOR="#FFFFFF"> <BR><BR><FONT COLOR="#000066"><H1><A NAME="//apple_ref/occ/cl/NSObject (MCPNSNullTest)">NSObject (MCPNSNullTest)</A></H1></FONT><BR> <blockquote><DL><DT><B>Declared In:</B></DT> <DD>MCPNull.h</DD> </DL></blockquote> <BR><BR> <H2>Category Description</H2> <CODE> $Id: NSObject+MCPNSNullTest.html,v 1.1 2003/08/19 10:04:41 sergecohen Exp $ </CODE><P> This Category is meant to make any kind of object the possible target to the test (isNSNull) <P><HR WIDTH=50% ALIGN=LEFT> <H2>Method Types</H2> <blockquote> Addin to NSObject. <DL><DT></DT> <DD> <A HREF="#- isNSNull">- isNSNull</A></DD> </DL> </blockquote> <HR WIDTH=50% ALIGN=LEFT> <H2>Instance Methods</H2> <A NAME="- isNSNull"></A><H3><A NAME="//apple_ref/occ/instm/NSObject (MCPNSNullTest)/isNSNull">isNSNull</A></H3><P> <CODE>- (BOOL)<B>isNSNull</B> </CODE><P> No method description. <P><HR> Version 1.2 Copyright ©2002 by Serge Cohen. All Rights Reserved. Mon Aug 18 14:35:42 2003 <P> </BODY></HTML> --- SMySQLConnection.html DELETED --- --- SMySQLResult.html DELETED --- |