ChildData.h

00001 /*  wcecompat: Windows CE C Runtime Library "compatibility" library.
00002  *
00003  *  Copyright (C) 2001-2002 Essemer Pty Ltd.  All rights reserved.
00004  *  http://www.essemer.com.au/
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2.1 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Lesser General Public
00017  *  License along with this library; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 
00022 #ifndef __wcecompat__ChildData_h__
00023 #define __wcecompat__ChildData_h__
00024 
00025 
00026 #include "args.h"
00027 
00028 
00029 class ChildData
00030 {
00031         typedef struct
00032         {
00033                 TCHAR*  name;
00034                 TCHAR*  value;
00035         } NameValuePair;
00036 
00037 private:
00038 
00039         TCHAR*                  currentDirectory;
00040         RedirArg*               redirArgs;
00041         int                             numRedirArgs;
00042         NameValuePair*  environment;
00043         int                             environmentLength;      // num of environment variables
00044 
00045 public:
00046 
00047         ChildData();
00048         ~ChildData();
00049 
00050         void dump();
00051 
00052         const TCHAR* getCurrentDirectory() const;
00053         void setCurrentDirectory(const TCHAR* directory);
00054 
00055         void resetCurrentDirectory();
00056 
00057         void resetRedirArgs();
00058         RedirArg* getRedirArg(int fd);
00059         bool setRedirArg(RedirArg* redirArg);
00060         bool setRedirArgs(RedirArg* redirArgs, int numRedirArgs);
00061 
00062         void resetEnvironment();
00063         bool addEnvironmentVar(WCHAR* env);
00064         bool addEnvironmentList(WCHAR* env);
00065         bool saveEnvironment();
00066         bool restoreEnvironment();
00067 
00068         // if childData is NULL, the size will be returned in childDataLen
00069         bool encode(void* childData, int* childDataSize);
00070 
00071         // if childData is NULL, the size will be returned in childDataLen
00072         bool decode(void* childData);//, int childDataSize);
00073 };
00074 
00075 
00076 #endif /* __wcecompat__ChildData_h__ */

Generated on Mon Jun 5 10:20:48 2006 for Intelligence.kdevelop by  doxygen 1.4.6