[DEV] update to etk::FSNode
This commit is contained in:
@@ -49,17 +49,17 @@ Highlight::Highlight(etk::UString &xmlFilename)
|
||||
{
|
||||
TiXmlDocument XmlDocument;
|
||||
|
||||
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
|
||||
etk::FSNode fileName(etk::UString("DATA:") + xmlFilename);
|
||||
if (false == fileName.Exist()) {
|
||||
APPL_ERROR("File Does not exist : " << fileName);
|
||||
return;
|
||||
}
|
||||
int32_t fileSize = fileName.Size();
|
||||
int32_t fileSize = fileName.FileSize();
|
||||
if (0==fileSize) {
|
||||
APPL_ERROR("This file is empty : " << fileName);
|
||||
return;
|
||||
}
|
||||
if (false == fileName.fOpenRead()) {
|
||||
if (false == fileName.FileOpenRead()) {
|
||||
APPL_ERROR("Can not open the file : " << fileName);
|
||||
return;
|
||||
}
|
||||
@@ -71,9 +71,9 @@ Highlight::Highlight(etk::UString &xmlFilename)
|
||||
}
|
||||
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
|
||||
// load data from the file :
|
||||
fileName.fRead(fileBuffer, 1, fileSize);
|
||||
fileName.FileRead(fileBuffer, 1, fileSize);
|
||||
// close the file:
|
||||
fileName.fClose();
|
||||
fileName.FileClose();
|
||||
// load the XML from the memory
|
||||
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
|
||||
if (false == loadError) {
|
||||
@@ -191,15 +191,15 @@ bool Highlight::HasExtention(etk::UString &ext)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Highlight::FileNameCompatible(etk::File &fileName)
|
||||
bool Highlight::FileNameCompatible(etk::FSNode &fileName)
|
||||
{
|
||||
int32_t i;
|
||||
etk::UString extention;
|
||||
if (true == fileName.HasExtention() ) {
|
||||
if (true == fileName.FileHasExtention() ) {
|
||||
extention = "*.";
|
||||
extention += fileName.GetExtention();
|
||||
extention += fileName.FileGetExtention();
|
||||
} else {
|
||||
extention = fileName.GetShortFilename();
|
||||
extention = fileName.GetNameFile();
|
||||
}
|
||||
APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");
|
||||
|
||||
|
@@ -42,7 +42,7 @@ extern "C" {
|
||||
} colorInformation_ts;
|
||||
}
|
||||
|
||||
#include <etk/os/File.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <HighlightPattern.h>
|
||||
#include <Colorize.h>
|
||||
#include <EdnVectorBuf.h>
|
||||
@@ -54,7 +54,7 @@ class Highlight {
|
||||
Highlight(etk::UString &xmlFilename);
|
||||
~Highlight(void);
|
||||
bool HasExtention(etk::UString &ext);
|
||||
bool FileNameCompatible(etk::File &fileName);
|
||||
bool FileNameCompatible(etk::FSNode &fileName);
|
||||
void Display(void);
|
||||
void ReloadColor(void);
|
||||
void Parse(int32_t start,
|
||||
|
@@ -89,7 +89,7 @@ class localClassHighlightManager: public ewol::EObject
|
||||
*/
|
||||
}
|
||||
|
||||
Highlight* Get(etk::File &fileName)
|
||||
Highlight* Get(etk::FSNode &fileName)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i<listHighlight.Size(); i++) {
|
||||
@@ -100,7 +100,7 @@ class localClassHighlightManager: public ewol::EObject
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool Exist(etk::File &fileName)
|
||||
bool Exist(etk::FSNode &fileName)
|
||||
{
|
||||
if (NULL != Get(fileName) ) {
|
||||
return true;
|
||||
@@ -201,7 +201,7 @@ void HighlightManager::loadLanguages(void)
|
||||
localManager->loadLanguages();
|
||||
}
|
||||
|
||||
Highlight* HighlightManager::Get(etk::File &fileName)
|
||||
Highlight* HighlightManager::Get(etk::FSNode &fileName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return NULL;
|
||||
@@ -209,7 +209,7 @@ Highlight* HighlightManager::Get(etk::File &fileName)
|
||||
return localManager->Get(fileName);
|
||||
}
|
||||
|
||||
bool HighlightManager::Exist(etk::File &fileName)
|
||||
bool HighlightManager::Exist(etk::FSNode &fileName)
|
||||
{
|
||||
if (NULL == localManager) {
|
||||
return false;
|
||||
|
@@ -36,8 +36,8 @@ namespace HighlightManager{
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
void loadLanguages(void);
|
||||
Highlight* Get(etk::File &fileName);
|
||||
bool Exist(etk::File &fileName);
|
||||
Highlight* Get(etk::FSNode &fileName);
|
||||
bool Exist(etk::FSNode &fileName);
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user