[GME-commit] GMESRC/Paradigms/MetaGME/BonExtension BON2Component.cpp,1.23,1.24 BON2Component.h,1.10,1.11 BonExt.vcproj,1.2,1.3 Component.rc,1.6,1.7 Globals.h,1.7,1.8 LogStream.cpp,1.2,1.3 compicon.ico,1.4,1.5 logger.cpp,1.3,1.4 logger.h,1.3,1.4 resource.h,1.3,1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Fri Sep 22 17:05:49 CDT 2006


Update of /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension
In directory escher:/tmp/cvs-serv11565

Modified Files:
	BON2Component.cpp BON2Component.h BonExt.vcproj Component.rc 
	Globals.h LogStream.cpp compicon.ico logger.cpp logger.h 
	resource.h 
Log Message:
BonX made "namespacish".



CVS User: Zoltan Molnar, ISIS (zolmol)

Index: BonExt.vcproj
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/BonExt.vcproj,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BonExt.vcproj	7 Apr 2005 20:48:19 -0000	1.2
--- BonExt.vcproj	22 Sep 2006 16:05:47 -0000	1.3
***************
*** 1357,1360 ****
--- 1357,1363 ----
  	</Files>
  	<Globals>
+ 		<Global
+ 			Name="RESOURCE_FILE"
+ 			Value="Component.rc"/>
  	</Globals>
  </VisualStudioProject>

Index: compicon.ico
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/compicon.ico,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
Binary files /tmp/cvsp7GXAO and /tmp/cvstbI9oz differ

Index: BON2Component.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/BON2Component.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** BON2Component.cpp	21 Jun 2005 20:22:52 -0000	1.23
--- BON2Component.cpp	22 Sep 2006 16:05:47 -0000	1.24
***************
*** 34,37 ****
--- 34,56 ----
  {
  
+ class Deallocator
+ {
+ public:
+ 	Deallocator( Component* pComp)
+ 		: m_pComp( pComp)
+ 	{
+ 	}
+ 
+ 	~Deallocator()
+ 	{
+ 		global_vars.err.m_proj = Project();
+ 		if( m_pComp) m_pComp->finiMembers();
+ 		else ASSERT(0);
+ 	}
+ protected:
+ 	Component *m_pComp;
+ 
+ };
+ 
  //###############################################################################################################################################
  //
***************
*** 42,45 ****
--- 61,65 ----
  Component::Component()
  	: m_bIsInteractive( false )
+ 	, m_sheet( 0)
  {
  }
***************
*** 72,91 ****
  	// ======================
  	// Insert application specific code here
! 		m_entities.clear();
! 		m_relations.clear();
! 		m_equivRelations.clear();
! 		//m_toBeDeletedEntities.clear();
! 		m_equivBag.clear();
! 		m_realObj.clear();
! 
! 		Sheet::m_BON_Project_Root_Folder = (Folder)NULL; // crucial!!!
! 		Sheet::m_setOfParadigmSheets.clear();// crucial!!!
! 
! 		if ( m_sheet != 0)  
! 		{ 
! 			TO( "Internal error: Merged Paradigm Sheet object still exists."); 
! 			delete m_sheet; 
! 			m_sheet = 0; 
! 		}
  }
  
--- 92,96 ----
  	// ======================
  	// Insert application specific code here
! 	finiMembers();
  }
  
***************
*** 104,108 ****
  	scanSubModels(model);
  	entityBuilder(model, parent);
! 	Sheet::m_setOfParadigmSheets.insert( model);
  }
  
--- 109,113 ----
  	scanSubModels(model);
  	entityBuilder(model, parent);
! 	m_setOfParShs.insert( model);
  }
  
***************
*** 124,128 ****
  	{
  		Folder rf = project->getRootFolder();
- 		Sheet::m_BON_Project_Root_Folder = rf;
  
  		std::set<Folder> folders;
--- 129,132 ----
***************
*** 176,179 ****
--- 180,203 ----
  }
  
+ void Component::finiMembers()
+ {
+ 	m_entities.clear();
+ 	m_relations.clear();
+ 	m_equivRelations.clear();
+ 	//m_toBeDeletedEntities.clear();
+ 	m_equivBag.clear();
+ 	m_realObj.clear();
+ 
+ 	m_setOfParShs.erase( m_setOfParShs.begin(), m_setOfParShs.end());
+ 	m_setOfParShs.clear();
+ 
+ 	if ( m_sheet != 0)  
+ 	{ 
+ 		TO( "Internal error: Merged Paradigm Sheet object still exists."); 
+ 		delete m_sheet; 
+ 		m_sheet = 0; 
+ 	}
+ }
+ 
  
  void Component::createSheet()
***************
*** 189,192 ****
--- 213,220 ----
  {
  	m_sheet->setProject( project );
+ 	m_sheet->m_BON_Project_Root_Folder2 = project->getRootFolder();
+ 	m_sheet->m_setOfParadigmSheets2 = m_setOfParShs;
+ 	m_setOfParShs.clear();
+ 
  
  	bool error = false;
***************
*** 338,352 ****
  	// ======================
  	// Insert application specific code here
  
  	initMembers( project);
  
! 	if ( Dumper::selectOutputFiles( m_projectName) > 1)
  	{
! 		project->consoleMsg("[BonExtender] Output file name selection cancelled by the user or other file operation failed.", MSG_NORMAL);
  		return;
  	}
  
- 	global_vars.err.m_proj = project;
- 
  	CWaitCursor wait;
  
--- 366,389 ----
  	// ======================
  	// Insert application specific code here
+ 	global_vars.silent_mode = (lParam == GME_SILENT_MODE);
  
+ 	// when deallocated will clear the member variables of Component upon leaving the scope (and some of global_vars)
+ 	Deallocator g( this);
+ 	
  	initMembers( project);
+ 	global_vars.err.m_proj = project;
  
! 	BON::Folder rf = project->getRootFolder();
! 	BON::RegistryNode rn = rf->getRegistry()->getChild( "Namespace");
! 	global_vars.m_namespace_name = rn?rn->getValue():"";
! 
! 	BON::RegistryNode opt_rn = rf->getRegistry()->getChild( Dumper::m_strBonExtenderOptions);
! 
! 	if ( Dumper::selectOutputFiles( m_projectName, opt_rn) > 1)
  	{
! 		if( !global_vars.silent_mode) project->consoleMsg("[BonExtender] Output file name selection cancelled by the user or other file operation failed.", MSG_NORMAL);
  		return;
  	}
  
  	CWaitCursor wait;
  
***************
*** 433,437 ****
  	global_vars.err.flushit();
  	global_vars.err.close();
! 	global_vars.err.m_proj = (Project) 0;
  }
  
--- 470,474 ----
  	global_vars.err.flushit();
  	global_vars.err.close();
! 	global_vars.err.m_proj = Project();
  }
  

Index: Globals.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Globals.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Globals.h	30 Jul 2004 20:21:04 -0000	1.7
--- Globals.h	22 Sep 2006 16:05:47 -0000	1.8
***************
*** 8,11 ****
--- 8,18 ----
  class Globals
  {
+ public: // enum
+ 	typedef enum {
+ 		ALLTOGETHER  = 0,
+ 		PERCLASS     = 1,
+ 		PERNAMESPACE = 2,
+ 		X_THE_NO_OF_METHODS= 3 // upper boundary
+ 	} OUTPUTMETHOD_ENUM;
  public:
  	Globals() 
***************
*** 17,20 ****
--- 24,30 ----
  		, m_visitorSourceFileName("\\ParadigmVisitor")
  		, output_directory_name()
+ 		, m_namespace_name()
+ 		, m_outputMethod( ALLTOGETHER)
+ 		, silent_mode( false)
  		{ }
  
***************
*** 32,35 ****
--- 42,47 ----
  	std::string output_directory_name;
  	std::string m_namespace_name;
+ 	OUTPUTMETHOD_ENUM m_outputMethod;
+ 	bool        silent_mode;
  };
  

Index: Component.rc
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/Component.rc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Component.rc	26 Sep 2005 20:26:23 -0000	1.6
--- Component.rc	22 Sep 2006 16:05:47 -0000	1.7
***************
*** 116,120 ****
          RIGHTMARGIN, 298
          TOPMARGIN, 7
!         BOTTOMMARGIN, 227
      END
  END
--- 116,120 ----
          RIGHTMARGIN, 298
          TOPMARGIN, 7
!         BOTTOMMARGIN, 299
      END
  END
***************
*** 133,146 ****
  BEGIN
      DEFPUSHBUTTON   "OK",IDOK,92,261,50,14
!     PUSHBUTTON      "Cancel",IDCANCEL,202,261,50,14
!     COMBOBOX        IDC_COMBO1,85,5,256,70,CBS_DROPDOWN | WS_VSCROLL | 
                      WS_TABSTOP
      LTEXT           "Select configuration:",IDC_STATIC,14,6,68,10
  END
  
! IDD_DIALOG2 DIALOG  0, 0, 305, 234
  STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  CAPTION "Options"
! FONT 8, "MS Sans Serif"
  BEGIN
      GROUPBOX        "Output header and source files",IDC_STATIC,7,6,291,51
--- 133,148 ----
  BEGIN
      DEFPUSHBUTTON   "OK",IDOK,92,261,50,14
!     PUSHBUTTON      "Cancel",IDCANCEL,191,261,50,14
!     COMBOBOX        IDC_COMBO1,85,5,183,70,CBS_DROPDOWN | WS_VSCROLL | 
                      WS_TABSTOP
      LTEXT           "Select configuration:",IDC_STATIC,14,6,68,10
+     PUSHBUTTON      "None",IDC_DESELECTALLBTN,281,6,26,11
+     PUSHBUTTON      "All",IDC_SELECTALLBTN,314,6,26,11
  END
  
! IDD_DIALOG2 DIALOGEX 0, 0, 305, 306
  STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  CAPTION "Options"
! FONT 8, "MS Sans Serif", 0, 0, 0x0
  BEGIN
      GROUPBOX        "Output header and source files",IDC_STATIC,7,6,291,51
***************
*** 154,158 ****
      EDITTEXT        IDC_EDIT5,18,75,261,13,ES_AUTOHSCROLL
      PUSHBUTTON      "...",IDC_BUTTON5,283,76,10,11
!     GROUPBOX        "",IDC_STATIC,7,102,291,49
      CONTROL         "&Visitor",IDC_CHECK34,"Button",BS_AUTOCHECKBOX | 
                      WS_TABSTOP,16,103,35,10
--- 156,160 ----
      EDITTEXT        IDC_EDIT5,18,75,261,13,ES_AUTOHSCROLL
      PUSHBUTTON      "...",IDC_BUTTON5,283,76,10,11
!     GROUPBOX        "",IDC_STATIC,7,102,291,68
      CONTROL         "&Visitor",IDC_CHECK34,"Button",BS_AUTOCHECKBOX | 
                      WS_TABSTOP,16,103,35,10
***************
*** 161,181 ****
      EDITTEXT        IDC_EDIT4,18,132,261,13,ES_AUTOHSCROLL
      PUSHBUTTON      "...",IDC_BUTTON4,283,133,10,11
!     GROUPBOX        "Generate methods",IDC_STATIC,7,154,76,42
      CONTROL         "&initialize()",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | 
!                     WS_TABSTOP,16,164,44,10
      CONTROL         "&finalize()",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | 
!                     WS_TABSTOP,16,178,41,10
!     GROUPBOX        "Getter style",IDC_STATIC,101,154,195,42
      CONTROL         "&Simple",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | 
!                     WS_GROUP | WS_TABSTOP,110,163,39,8
      CONTROL         "&Template method",IDC_RADIO2,"Button",
!                     BS_AUTORADIOBUTTON,110,173,72,8
!     CONTROL         "&Both",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,110,183,
                      39,8
!     CONTROL         "VC version &greater than 7.1",IDC_CHECKVERS71,"Button",
!                     BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,211,173,81,
!                     18
!     DEFPUSHBUTTON   "OK",IDOK,32,208,50,14
!     PUSHBUTTON      "Cancel",IDCANCEL,233,206,50,14
  END
  
--- 163,205 ----
      EDITTEXT        IDC_EDIT4,18,132,261,13,ES_AUTOHSCROLL
      PUSHBUTTON      "...",IDC_BUTTON4,283,133,10,11
!     LTEXT           "Visitor method's signature:",IDC_STATIC,17,148,82,8
!     CONTROL         "visitNamespaceElement(...)",IDC_RADIOVISITSIGN1,"Button",
!                     BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,104,149,101,
!                     10
!     CONTROL         "visitElement(...)",IDC_RADIOVISITSIGN2,"Button",
!                     BS_AUTORADIOBUTTON,104,158,63,10
!     GROUPBOX        "Generate methods",IDC_STATIC,7,173,188,53
      CONTROL         "&initialize()",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | 
!                     WS_TABSTOP,16,183,44,10
      CONTROL         "&finalize()",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | 
!                     WS_TABSTOP,16,193,41,10
!     CONTROL         "&accept() with traversal code",IDC_CHECK4,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,62,183,129,10
!     CONTROL         "&accept(CustomVisitor *v)",IDC_CHECK6,"Button",
!                     BS_AUTOCHECKBOX | WS_TABSTOP,62,193,93,10
!     CONTROL         "returns void",IDC_RADIOSPACCRETURNSVOID,"Button",
!                     BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,73,205,53,10
!     CONTROL         "returns bool",IDC_RADIOSPACCRETURNSBOOL,"Button",
!                     BS_AUTORADIOBUTTON,73,215,53,10
!     GROUPBOX        "Getter style",IDC_STATIC,202,173,96,53
!     CONTROL         "VC ver. 6",IDC_CHECKVERS60,"Button",BS_AUTOCHECKBOX | 
!                     BS_MULTILINE | WS_TABSTOP,248,172,46,11
      CONTROL         "&Simple",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | 
!                     WS_GROUP | WS_TABSTOP,208,187,39,8
      CONTROL         "&Template method",IDC_RADIO2,"Button",
!                     BS_AUTORADIOBUTTON,208,199,72,8
!     CONTROL         "&Both",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,208,211,
                      39,8
!     EDITTEXT        IDC_EDIT6,162,238,126,14,ES_AUTOHSCROLL
!     CONTROL         "S&ame file",IDC_RADIOSAMEFILE,"Button",
!                     BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,162,255,49,8
!     CONTROL         "S&eparate files",IDC_RADIOSEPAFILE,"Button",
!                     BS_AUTORADIOBUTTON,162,266,79,8
!     DEFPUSHBUTTON   "OK",IDOK,74,285,50,14
!     PUSHBUTTON      "Cancel",IDCANCEL,185,285,50,14
!     GROUPBOX        "Misc",IDC_STATIC,7,226,291,53
!     LTEXT           "Classes will be generated into namespace:",IDC_STATIC,
!                     17,240,134,8
!     LTEXT           "Output custom classes to:",IDC_STATIC,17,254,82,8
  END
  

Index: LogStream.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/LogStream.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LogStream.cpp	31 Dec 2004 19:51:16 -0000	1.2
--- LogStream.cpp	22 Sep 2006 16:05:47 -0000	1.3
***************
*** 4,7 ****
--- 4,10 ----
  #include "BONImpl.h"
  
+ #include "globals.h"
+ extern Globals global_vars;
+ 
  LogStream::LogStream()
  	: m_proj( BON::Project())
***************
*** 69,73 ****
  	if( r.find('\n') != std::string::npos)
  	{
! 		stream.m_proj->consoleMsg( stream.m_buff, stream.m_msgtype);
  		stream.m_buff = "";
  	}
--- 72,79 ----
  	if( r.find('\n') != std::string::npos)
  	{
! 		if( !global_vars.silent_mode) {
! 			try { stream.m_proj->consoleMsg( stream.m_buff, stream.m_msgtype); }
! 			catch( ... ) { } // will throw if invoked without the Gui up&running
! 		}
  		stream.m_buff = "";
  	}

Index: BON2Component.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/BON2Component.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** BON2Component.h	30 Jul 2004 20:21:04 -0000	1.10
--- BON2Component.h	22 Sep 2006 16:05:47 -0000	1.11
***************
*** 82,88 ****
--- 82,93 ----
  	EquivBag m_equivBag;
  
+ 	std::set<Model> m_setOfParShs;
+ 
  private: // methods
  	void initMembers( Project& project);
+ public:
+ 	void finiMembers();
  
+ private:
  	void scanProject( Project& project);
  	void scanModels( const Model& model, const Folder& parent);

Index: resource.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/resource.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** resource.h	16 Jun 2004 18:35:00 -0000	1.3
--- resource.h	22 Sep 2006 16:05:47 -0000	1.4
***************
*** 1,4 ****
  //{{NO_DEPENDENCIES}}
! // Microsoft Developer Studio generated include file.
  // Used by Component.rc
  //
--- 1,4 ----
  //{{NO_DEPENDENCIES}}
! // Microsoft Visual C++ generated include file.
  // Used by Component.rc
  //
***************
*** 13,16 ****
--- 13,17 ----
  #define IDC_CHECK2                      213
  #define IDC_CHECK3                      214
+ #define IDC_CHECK4                      215
  #define IDC_EDIT1                       216
  #define IDC_CHECK5                      217
***************
*** 19,22 ****
--- 20,24 ----
  #define IDC_EDIT4                       220
  #define IDC_EDIT5                       221
+ #define IDC_CHECK6                      222
  #define IDC_BUTTON1                     223
  #define IDC_BUTTON2                     224
***************
*** 27,31 ****
--- 29,44 ----
  #define IDC_RADIO2                      229
  #define IDC_RADIO3                      230
+ #define IDC_RADIOSAMEFILE               231
+ #define IDC_RADIOSEPAFILE               232
  #define IDC_CHECKVERS71                 233
+ #define IDC_CHECKVERS60                 233
+ #define IDC_DESELECTALLBTN              234
+ #define IDC_SELECTALLBTN                235
+ #define IDC_EDIT6                       235
+ #define IDC_RADIOVISITSIGN1             237
+ #define IDC_RADIOVISITSIGN2             238
+ #define IDC_RADIOSPACCRETURNSVOID       239
+ #define IDC_RADIOSPVISRETURNSBOOL       240
+ #define IDC_RADIOSPACCRETURNSBOOL       240
  
  // Next default values for new objects
***************
*** 35,39 ****
  #define _APS_NEXT_RESOURCE_VALUE        205
  #define _APS_NEXT_COMMAND_VALUE         32768
! #define _APS_NEXT_CONTROL_VALUE         234
  #define _APS_NEXT_SYMED_VALUE           101
  #endif
--- 48,52 ----
  #define _APS_NEXT_RESOURCE_VALUE        205
  #define _APS_NEXT_COMMAND_VALUE         32768
! #define _APS_NEXT_CONTROL_VALUE         240
  #define _APS_NEXT_SYMED_VALUE           101
  #endif

Index: logger.h
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/logger.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** logger.h	30 Jul 2004 20:21:04 -0000	1.3
--- logger.h	22 Sep 2006 16:05:47 -0000	1.4
***************
*** 35,43 ****
  
  bool existsFile( const char * src_name);
  int makeFileCopy( const char * src_name, const char * dst_name);
  std::string shortFileName( const std::string& long_name);
  std::string cutExtension( const std::string& filename);
  std::string capitalizeString( const std::string& name);
! 
  
  #endif // LOGGER_H
--- 35,46 ----
  
  bool existsFile( const char * src_name);
+ bool fileExists( const char * file_name);
  int makeFileCopy( const char * src_name, const char * dst_name);
+ int makeFileMove( const char * src_name, const char * dst_name);
  std::string shortFileName( const std::string& long_name);
  std::string cutExtension( const std::string& filename);
  std::string capitalizeString( const std::string& name);
! bool directoryExists( const char * dir);
! bool directoryCreate( const char * dir);
  
  #endif // LOGGER_H

Index: logger.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/Paradigms/MetaGME/BonExtension/logger.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** logger.cpp	30 Jul 2004 20:21:04 -0000	1.3
--- logger.cpp	22 Sep 2006 16:05:47 -0000	1.4
***************
*** 40,43 ****
--- 40,78 ----
  }
  
+ int makeFileMove( const char * src_name, const char * dst_name)
+ {
+ 	if( !fileExists( src_name)) return 1; // src nonexistent, done
+ 
+ 	BOOL dres = TRUE;
+ 	if( fileExists( dst_name)) // exists and not read only
+ 	{
+ 		dres = DeleteFile( dst_name); // must delete before move
+ 	}
+ 	
+ 	if( !dres) return 0; // failure?, move won't succeed, return
+ 		
+ 	// either dst didn't exist or successful deletion
+ 	dres = MoveFile( src_name, dst_name);
+ 	return dres == TRUE? 1: 0;
+ }
+ 
+ 
+ bool fileExists( const char * file)
+ {
+ 	bool res = false;
+ 	CFileStatus stat;
+ 	if( file                              // not-empty string
+ 		&& CFile::GetStatus( file, stat)) // status fetched succesfully
+ 	{
+ 		if( (stat.m_attribute & CFile::directory) == 0     // it is NOT a directory
+ 			&& (stat.m_attribute & CFile::readOnly)  == 0) // not read only
+ 		{
+ 			res = true;
+ 		}
+ 	}
+ 
+ 	return res;
+ }
+ 
  std::string shortFileName( const std::string& long_name)
  {
***************
*** 72,73 ****
--- 107,130 ----
  	return capitalized_name;
  }
+ 
+ bool directoryExists( const char * dir)
+ {
+ 	bool res = false;
+ 	CFileStatus stat;
+ 	if( dir                              // not-empty string
+ 		&& CFile::GetStatus( dir, stat)) // status fetched succesfully
+ 	{
+ 		if( (stat.m_attribute & CFile::directory) == CFile::directory // it is a directory
+ 			&& (stat.m_attribute & CFile::readOnly)  == 0) // not read only
+ 		{
+ 			res = true;
+ 		}
+ 	}
+ 
+ 	return res;
+ }
+ 
+ bool directoryCreate( const char * dir)
+ {
+ 	return CreateDirectory( dir, NULL) == TRUE;
+ }
\ No newline at end of file



More information about the GME-commit mailing list