[sword-cvs] sword/src/mgr filemgr.cpp,1.25,1.26 installmgr.cpp,1.6,1.7

sword@www.crosswire.org sword@www.crosswire.org
Thu, 26 Jun 2003 19:21:07 -0700


Update of /usr/local/cvsroot/sword/src/mgr
In directory www:/tmp/cvs-serv21064/src/mgr

Modified Files:
	filemgr.cpp installmgr.cpp 
Log Message:
	Removed all std::string references from API and
		mostly replaced with SWBuf
	Added int max param to SWBuf::append
	Added some file copy functions to FileMgr
	Moved some more install stuff to installmgr



Index: filemgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/filemgr.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** filemgr.cpp	27 Jun 2003 01:41:07 -0000	1.25
--- filemgr.cpp	27 Jun 2003 02:21:05 -0000	1.26
***************
*** 25,39 ****
  
  #include <dirent.h>
- #include <dir.h>
  #include <fcntl.h>
  #include <sys/stat.h>
  #include <sys/types.h>
  #include <stdio.h>
  #ifndef __GNUC__
  #include <io.h>
  #else
  #include <unistd.h>
  #endif
  
  SWORD_NAMESPACE_START
  
--- 25,43 ----
  
  #include <dirent.h>
  #include <fcntl.h>
  #include <sys/stat.h>
  #include <sys/types.h>
  #include <stdio.h>
+ #include <string.h>
  #ifndef __GNUC__
  #include <io.h>
+ #include <dir.h>
  #else
  #include <unistd.h>
  #endif
  
+ #ifndef O_BINARY
+ #define O_BINARY 0
+ #endif
  SWORD_NAMESPACE_START
  
***************
*** 283,289 ****
  	if (strlen(buf)>0) {
  		if (access(buf, 02)) {  // not exists with write access?
! 			if ((retCode = mkdir(buf))) {
  				createParent(buf);
! 				retCode = mkdir(buf);
  			}
  		}
--- 287,293 ----
  	if (strlen(buf)>0) {
  		if (access(buf, 02)) {  // not exists with write access?
! 			if ((retCode = mkdir(buf, 0755))) {
  				createParent(buf);
! 				retCode = mkdir(buf, 0755);
  			}
  		}

Index: installmgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/installmgr.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** installmgr.cpp	27 Jun 2003 01:41:07 -0000	1.6
--- installmgr.cpp	27 Jun 2003 02:21:05 -0000	1.7
***************
*** 7,10 ****
--- 7,11 ----
  
  #include <installmgr.h>
+ #include <filemgr.h>
  
  #include <fcntl.h>
***************
*** 185,190 ****
  		fileEnd = module->second.upper_bound("File");
  
! 		string modFile;
! 		string modDir;
  		entry = module->second.find("AbsoluteDataPath");
  		modDir = entry->second.c_str();
--- 186,191 ----
  		fileEnd = module->second.upper_bound("File");
  
! 		SWBuf modFile;
! 		SWBuf modDir;
  		entry = module->second.find("AbsoluteDataPath");
  		modDir = entry->second.c_str();
***************
*** 263,266 ****
--- 264,268 ----
  
  int installModule(const char *fromLocation, const char *modName, InstallSource *is) {
+ /*
  	SectionMap::iterator module, section;
  	ConfigEntMap::iterator fileBegin;
***************
*** 278,281 ****
--- 280,284 ----
  	else	sourceDir = getLocalDir();
  */	
+ /*
  	SWMgr mgr(sourceDir.c_str());
  	
***************
*** 422,430 ****
  		return (aborted) ? -1 : 0;
  	}
  	return 1;
  }
  
  
! int copyFileToSWORDInstall(const char *sourceDir, const char *fName) {
  	SWBuf sourcePath = sourceDir;
  	sourcePath += fName;
--- 425,434 ----
  		return (aborted) ? -1 : 0;
  	}
+ */
  	return 1;
  }
  
  
! int copyFileToSWORDInstall(SWMgr *manager, const char *sourceDir, const char *fName) {
  	SWBuf sourcePath = sourceDir;
  	sourcePath += fName;