Major update:

- Rename Function LocalIO -> Channel (Parameters & Methods)
This commit is contained in:
Charl Wentzel
2016-08-23 13:19:43 +02:00
parent 5ea05d119e
commit 7564e6a288
6 changed files with 146 additions and 147 deletions

View File

@@ -63,7 +63,7 @@ CFileCore::~CFileCore()
}
//---------------------------------------------------------------------------
TFileHandle * CFileCore::AddFile( const char * Name, const char * Path, bool Append, bool CreateLocalIO )
TFileHandle * CFileCore::AddFile( const char * Name, const char * Path, bool Append, bool CreateChannel )
{
TFileHandle ** FileHandle = NULL;
@@ -91,9 +91,9 @@ TFileHandle * CFileCore::AddFile( const char * Name, const char * Path, bool Ap
strcpy( (*FileHandle)->Path, Path );
}
// Create IO if necessary
if (CreateLocalIO) {
AddLocalIO( Name );
// Create Channel if necessary
if (CreateChannel) {
AddChannel( Name );
}
// Set Parameters
@@ -265,29 +265,29 @@ int CFileCore::WriteToFD( int FD, const char * Data, int Len )
//---------------------------------------------------------------------------
// Manual Data Input/Output
int CFileCore::Input( const char * IOName, const char * Data, int MaxLen )
int CFileCore::Input( const char * ChannelName, const char * Data, int MaxLen )
{
TFileHandle * FileHandle = NULL;
int BytesWritten = 0;
// Validate
if (!IOName || !Data) {
if (!ChannelName || !Data) {
return 0;
}
else if (MaxLen == -1) {
MaxLen = strlen( Data );
};
// Get IO
if (!(FileHandle = GetFile( IOName )))
// Get Channel
if (!(FileHandle = GetFile( ChannelName )))
{
// Log event
if (Log) Log->Message( DebugLevel, dlHigh, "%s: Local IO '%s' - Input rejected, Local IO not found", Name, IOName );
if (Log) Log->Message( DebugLevel, dlHigh, "%s: Channel '%s' - Input rejected, Channel not found", Name, ChannelName );
return 0;
}
// Log event
//ShowOutput( DebugLevel, dlHigh, OutputDisplay, Data, MaxLen, "%s: Local IO '%s' - IN:", Name, IOName );
//ShowOutput( DebugLevel, dlHigh, OutputDisplay, Data, MaxLen, "%s: Channel '%s' - IN:", Name, ChannelName );
// Open file
if (!OpenFile( FileHandle )) {