commands/sql/sqlcmd_open.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // sqlcmd_open.h
       
     2 // 
       
     3 // Copyright (c) 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 #ifndef __FSQLCMD_OPEN_H__
       
    13 #define __FSQLCMD_OPEN_H__
       
    14 
       
    15 #include <fshell/ioutils.h>
       
    16 
       
    17 
       
    18 using namespace IoUtils;
       
    19 
       
    20 ////////////////////////////////////////////////////////////////////////////
       
    21 class CSqlCmdOpen : public CServerCommandBase
       
    22 	{
       
    23 public:
       
    24 	static CServerCommandBase* NewLC();
       
    25 	~CSqlCmdOpen();
       
    26 	static const TDesC& NameS();
       
    27 private:
       
    28 	void ConstructL();
       
    29 private: // From CCommandBase.
       
    30 	virtual const TDesC& Name() const;
       
    31 	virtual const TDesC& Description() const;
       
    32 	virtual void ArgumentsL(RCommandArgumentList& aArguments);	
       
    33 	virtual void DoRunL();
       
    34 private:
       
    35 	HBufC* iFileName;
       
    36 	};
       
    37 
       
    38 /////////////////////////////////////////////////////////////////
       
    39 
       
    40 class CSqlCmdExit : public CServerCommandBase
       
    41 	{
       
    42 public:
       
    43 	static CServerCommandBase* NewLC();
       
    44 	~CSqlCmdExit();
       
    45 	static const TDesC& NameS();
       
    46 private:
       
    47 	void ConstructL();
       
    48 private: // From CCommandBase.
       
    49 	virtual const TDesC& Name() const;
       
    50 	virtual const TDesC& Description() const;
       
    51 	virtual void DoRunL();
       
    52 	};
       
    53 
       
    54 ///////////////////////////////////////////////////////////////////
       
    55 
       
    56 class CSqlCmdClose : public CServerCommandBase
       
    57 	{
       
    58 public:
       
    59 	static CServerCommandBase* NewLC();
       
    60 	~CSqlCmdClose();
       
    61 	static const TDesC& NameS();
       
    62 private:
       
    63 	void ConstructL();
       
    64 private: // From CCommandBase.
       
    65 	virtual const TDesC& Name() const;
       
    66 	virtual const TDesC& Description() const;
       
    67 	virtual void DoRunL();
       
    68 	};
       
    69 
       
    70 /////////////////////////////////////////////////////////////////
       
    71 
       
    72 class CSqlCmdCreate : public CServerCommandBase
       
    73 	{
       
    74 public:
       
    75 	static CServerCommandBase* NewLC();
       
    76 	~CSqlCmdCreate();
       
    77 	static const TDesC& NameS();
       
    78 private:
       
    79 	void ConstructL();
       
    80 private: // From CCommandBase.
       
    81 	virtual const TDesC& Name() const;
       
    82 	virtual const TDesC& Description() const;
       
    83 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
    84 	virtual void DoRunL();
       
    85 	
       
    86 private:
       
    87 	HBufC* iFileName;	
       
    88 	};
       
    89 
       
    90 
       
    91 //////////////////////////////////////////////////////////////////
       
    92 class CSqlCmdExec : public CServerCommandBase
       
    93 	{
       
    94 public:
       
    95 	static CServerCommandBase* NewLC();
       
    96 	~CSqlCmdExec();
       
    97 	static const TDesC& NameS();
       
    98 private:
       
    99 	void ConstructL();
       
   100 private: // From CCommandBase.
       
   101 	virtual const TDesC& Name() const;
       
   102 	virtual const TDesC& Description() const;
       
   103 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
   104 	virtual void DoRunL();
       
   105 	
       
   106 private:
       
   107 	HBufC* iExec;	
       
   108 	};
       
   109 
       
   110 //////////////////////////////////////////////////////////////////
       
   111 
       
   112 class CSqlCmdState : public CServerCommandBase
       
   113 	{
       
   114 public:
       
   115 	static CServerCommandBase* NewLC();
       
   116 	~CSqlCmdState();
       
   117 	static const TDesC& NameS();
       
   118 private:
       
   119 	void ConstructL();
       
   120 private: // From CCommandBase.
       
   121 	virtual const TDesC& Name() const;
       
   122 	virtual const TDesC& Description() const;
       
   123 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
   124 	virtual void OptionsL(RCommandOptionList& aOptions);
       
   125 	virtual void DoRunL();
       
   126 	
       
   127 private:
       
   128 	HBufC* iOptFileName;	//TEMP file template, used to dump large binary contents
       
   129 	RPointerArray<HBufC> iOptParamFile;	//multiple filenames for use with parameter
       
   130 	
       
   131 	HBufC* iExec;	//the SQL statement
       
   132 	//RPointerArray<HBufC> iCmdArgu;	//arguments could be multiple strings	
       
   133 		
       
   134 	};
       
   135 
       
   136 /////////////////////////////////////////////////////////////////////
       
   137 
       
   138 //////////////////////////////////////////////////////////////////
       
   139 
       
   140 class CSqlCmdAttach : public CServerCommandBase
       
   141 	{
       
   142 public:
       
   143 	static CServerCommandBase* NewLC();
       
   144 	~CSqlCmdAttach();
       
   145 	static const TDesC& NameS();
       
   146 private:
       
   147 	void ConstructL();
       
   148 private: // From CCommandBase.
       
   149 	virtual const TDesC& Name() const;
       
   150 	virtual const TDesC& Description() const;
       
   151 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
   152 	void OptionsL(RCommandOptionList& aOptions);
       
   153 	virtual void DoRunL();
       
   154 	
       
   155 private:
       
   156 	HBufC* iOptFileName;
       
   157 	HBufC* iOptDBName;	//database name
       
   158 	};
       
   159 
       
   160 ///////////////////////////////////////////////////////////////////
       
   161 
       
   162 class CSqlCmdDetach : public CServerCommandBase
       
   163 	{
       
   164 public:
       
   165 	static CServerCommandBase* NewLC();
       
   166 	~CSqlCmdDetach();
       
   167 	static const TDesC& NameS();
       
   168 private:
       
   169 	void ConstructL();
       
   170 private: // From CCommandBase.
       
   171 	virtual const TDesC& Name() const;
       
   172 	virtual const TDesC& Description() const;
       
   173 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
   174 	void OptionsL(RCommandOptionList& aOptions);
       
   175 	virtual void DoRunL();
       
   176 	
       
   177 private:
       
   178 	HBufC* iOptDBName;	//database name
       
   179 	};
       
   180 
       
   181 /////////////////////////////////////////////////////////////////////
       
   182 
       
   183 #ifdef SQL_COMPACT
       
   184 
       
   185 //RSqlDatabase::Compact() is documented in Symbian Developer Library, 
       
   186 //but not exists in header file.
       
   187 //so just reserved this for future
       
   188 class CSqlCmdCompact : public CServerCommandBase
       
   189 	{
       
   190 public:
       
   191 	static CServerCommandBase* NewLC();
       
   192 	~CSqlCmdCompact();
       
   193 	static const TDesC& NameS();
       
   194 private:
       
   195 	void ConstructL();
       
   196 private: // From CCommandBase.
       
   197 	virtual const TDesC& Name() const;
       
   198 	virtual const TDesC& Description() const;
       
   199 	virtual void ArgumentsL(RCommandArgumentList& aArguments);
       
   200 	void OptionsL(RCommandOptionList& aOptions);
       
   201 	virtual void DoRunL();
       
   202 	
       
   203 private:
       
   204 	HBufC* iOptDBName;	//database name
       
   205 	};
       
   206 #endif
       
   207 
       
   208 #endif // __FSQLCMD_OPEN_H__