|
SAGA API
v9.5
|
Go to the documentation of this file.
53 #include <wx/dynlib.h>
55 #include <wx/filename.h>
79 if( m_pLibrary->IsLoaded()
106 bool CSG_Tool_Library::_Destroy(
void)
135 if( m_pInterface != NULL )
137 return( m_pInterface->
Get_Info(Type) );
192 return( m_pInterface ? m_pInterface->
Create_Tool(Index, bWithGUI) : NULL );
200 int Index;
return( Name.
asInt(Index) ?
Create_Tool(Index, bWithGUI) : NULL );
211 return( m_pInterface ? m_pInterface->
Delete_Tool(pTool) :
false );
217 return( m_pInterface ? m_pInterface->
Delete_Tools() :
false );
230 return(
Get_Tool(i)->Get_MenuPath(
true) );
250 Reference +=
CSG_String::Format(
" <a href=\"%s\">%s</a>.", Link, Link_Text && *Link_Text ? Link_Text : Link);
255 m_References += Reference;
272 m_References.
Clear();
324 for(
int i=0; i<m_nLibraries; i++)
345 return( _Add_Tool_Chain(File) );
351 wxFileName fn(File.
c_str());
369 m_pLibraries[m_nLibraries++] = pLibrary;
396 int nOpened = 0; wxDir Dir;
398 if( Dir.Open(Directory.
c_str()) )
400 wxString FileName, DirName(Dir.GetName());
402 if( !bOnlySubDirectories && Dir.GetFirst(&FileName, wxEmptyString, wxDIR_FILES) )
405 {
if( FileName.Find(
"saga_") < 0 && FileName.Find(
"wx") < 0 )
411 while( Dir.GetNext(&FileName) );
414 if( Dir.GetFirst(&FileName, wxEmptyString, wxDIR_DIRS) )
418 if( FileName.CmpNoCase(
"dll") )
423 while( Dir.GetNext(&FileName) );
459 wxFileName fn(File.
c_str());
461 for(
int iLibrary=0; !pTool && iLibrary<
Get_Count(); iLibrary++)
494 if( !pTool || !pTool->
is_Okay() )
507 for(
int iLibrary=0; !pLibrary && iLibrary<
Get_Count(); iLibrary++)
519 m_pLibraries[m_nLibraries++] = pLibrary;
552 m_pLibraries[i]->m_pLibrary->Detach();
556 delete(m_pLibraries[i]);
592 delete(m_pLibraries[i]);
594 for(m_nLibraries--; i<m_nLibraries; i++)
596 m_pLibraries[i] = m_pLibraries[i + 1];
747 "#! /usr/bin/env python\n\n"
749 "Python Interface to SAGA Tools Library\n"
757 "from PySAGA.helper import Tool_Wrapper\n\n";
775 Stream.
Write(
"#! /usr/bin/env python\n\n'''\n");
776 Stream.
Write(
"Python Interface to SAGA Tools\n");
777 Stream.
Write(
"----------\n'''\n\n");
778 Stream.
Write(
"from PySAGA.helper import Tool_Wrapper\n\n");
830 for(
int iTool=0; iTool<pLibrary->
Get_Count(); iTool++)
885 for(
int iTool=0; iTool<pLibrary->
Get_Count(); iTool++)
virtual bool Open(const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
int Printf(const char *Format,...)
SAGA_API_DLL_EXPORT CSG_String SG_HTML_Tag_Replacer(const CSG_String &Text)
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
@ SG_UI_MSG_STYLE_SUCCESS
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &FileName, const CSG_String &Extension)
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
int Cmp(const CSG_String &String) const
@ SG_UI_MSG_STYLE_FAILURE
static void Initialize(void)
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
SAGA_API_DLL_EXPORT bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath=false)
void SG_UI_Process_Set_Text(const CSG_String &Text)
SAGA_API_DLL_EXPORT bool SG_Dir_List_Files(CSG_Strings &List, const CSG_String &Directory)
static CSG_String Format(const char *Format,...)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path)
bool Sort(bool Ascending=true)
int Printf(const char *Format,...)
bool is_Empty(void) const
bool SG_UI_Process_Set_Progress(int Position, int Range)
void * SG_UI_Get_Window_Main(void)
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
void SG_UI_ProgressAndMsg_Lock(bool bOn)
const SG_Char * c_str(void) const
size_t Write(void *Buffer, size_t Size, size_t Count=1) const
int Get_Count(void) const
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
void SG_UI_Msg_Add_Error(const char *Message)
bool Seek_End(void) const
void SG_UI_Msg_Add(const char *Message, bool bNewLine, TSG_UI_MSG_STYLE Style)