Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP] C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sun Mar 09, 2008 1:44 am    Post subject: [HELP] C++ Reply with quote

how do i copy file by type?? like for example i want to copy all .bmp files in my documents to another folder.
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Mar 09, 2008 2:49 am    Post subject: Reply with quote

Iterate the files in the directory, check the filename with regex and write a function for copying files.
Back to top
View user's profile Send private message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sun Mar 09, 2008 3:00 am    Post subject: Reply with quote

care to give an actual sample code on iterating and checking filename?
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Mar 09, 2008 7:42 am    Post subject: Reply with quote

ShurikeN wrote:
care to give an actual sample code on iterating and checking filename?
Code:
   wxRegEx *reItem = new wxRegEx( wxT("[.]*.bmp") );
   wxDir *dir = new wxDir( wxGetCwd() );
   wxString *item = new wxString();
   bool bItrFlag = 1;

   for( dir->GetFirst( item ); bItrFlag; bItrFlag = dir->GetNext( item ) ) {
      if( reItem->Matches( *item ) )
         wxPuts( wxT("Copy ") + *item );
   }
Or something like that... If I recall correctly [.]* won't cause any problems, like .* would.

EDIT: You should check the regex syntax yourself. I can't think clearly atm :P
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites