Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
FileManager Class Reference

#include <filemanager.h>

Inheritance diagram for FileManager:
Collaboration diagram for FileManager:

Public Member Functions

 FileManager ()
 
 ~FileManager () override
 
cb_must_consume_result LoaderBaseLoad (const wxString &file, bool reuseEditors=false)
 Loads a file, once this function is called, the actually loading process is done in the worker thread(BackgroundThread). More...
 
bool Save (const wxString &file, const wxString &data, wxFontEncoding encoding, bool bom)
 

Private Member Functions

bool SaveUTF8 (const wxString &file, const char *data, size_t len)
 
bool WriteWxStringToFile (wxFile &f, const wxString &data, wxFontEncoding encoding, bool bom)
 

Private Attributes

BackgroundThread fileLoaderThread
 
BackgroundThread uncLoaderThread
 
BackgroundThread urlLoaderThread
 

Friends

bool TinyXML::SaveDocument (const wxString &, TiXmlDocument *)
 

Additional Inherited Members

- Static Public Member Functions inherited from Mgr< FileManager >
static bool Valid ()
 
static FileManagerGet ()
 
static void Free ()
 
- Protected Member Functions inherited from Mgr< FileManager >
 Mgr ()
 
virtual ~Mgr ()
 

Detailed Description

Definition at line 112 of file filemanager.h.

Constructor & Destructor Documentation

◆ FileManager()

FileManager::FileManager ( )

Definition at line 122 of file filemanager.cpp.

◆ ~FileManager()

FileManager::~FileManager ( )
override

Definition at line 129 of file filemanager.cpp.

Member Function Documentation

◆ Load()

LoaderBase * FileManager::Load ( const wxString file,
bool  reuseEditors = false 
)

Loads a file, once this function is called, the actually loading process is done in the worker thread(BackgroundThread).

Parameters
filethe file path, it can an absolute file path, an unc file, or a url file
reuseEditorsif true, we try to use the file contents in the editor if the file is modified in the editor.
Returns
a loader pointer holding the loader, user must delete it later, otherwise memory leak will happen.

Definition at line 136 of file filemanager.cpp.

References _T, fileLoaderThread, Manager::Get(), EditorManager::GetBuiltinEditor(), cbEditor::GetControl(), EditorManager::GetEditor(), Manager::GetEditorManager(), EditorManager::GetEditorsCount(), EditorBase::GetFilename(), cbEditor::GetModified(), wxScintilla::GetText(), wxString::length(), BackgroundThread::Queue(), wxString::StartsWith(), uncLoaderThread, and urlLoaderThread.

Referenced by EditorColourSet::LoadAvailableSets(), cbProject::LoadLayout(), CodeBlocksApp::OnInit(), EditorManager::Open(), cbEditor::Open(), and Parser::Parse().

◆ Save()

bool FileManager::Save ( const wxString file,
const wxString data,
wxFontEncoding  encoding,
bool  bom 
)

◆ SaveUTF8()

bool FileManager::SaveUTF8 ( const wxString file,
const char *  data,
size_t  len 
)
private

◆ WriteWxStringToFile()

bool FileManager::WriteWxStringToFile ( wxFile f,
const wxString data,
wxFontEncoding  encoding,
bool  bom 
)
private

Friends And Related Function Documentation

◆ TinyXML::SaveDocument

bool TinyXML::SaveDocument ( const wxString ,
TiXmlDocument *   
)
friend

Member Data Documentation

◆ fileLoaderThread

BackgroundThread FileManager::fileLoaderThread
private

Definition at line 114 of file filemanager.h.

Referenced by Load().

◆ uncLoaderThread

BackgroundThread FileManager::uncLoaderThread
private

Definition at line 115 of file filemanager.h.

Referenced by Load().

◆ urlLoaderThread

BackgroundThread FileManager::urlLoaderThread
private

Definition at line 116 of file filemanager.h.

Referenced by Load().


The documentation for this class was generated from the following files: