create a class Edn::File that manage the modification of the falineme to get the real filename in the system ==> dit not work corectly...

This commit is contained in:
2011-08-04 18:18:54 +02:00
parent 55681d1dac
commit ff055b88d4
12 changed files with 105 additions and 149 deletions

View File

@@ -44,7 +44,7 @@ Buffer::Buffer()
m_fileModify = true;
m_haveName = false;
Edn::String mString = "No-Name";
m_fileName.SetCompleateName(mString);
SetFileName(mString);
}
/**
@@ -58,8 +58,7 @@ Buffer::Buffer()
Buffer::Buffer(Edn::String &newFileName)
{
m_fileModify = false;
m_haveName = true;
m_fileName.SetCompleateName(newFileName);
SetFileName(newFileName);
}
/**
@@ -95,85 +94,6 @@ void Buffer::SetModify(bool status)
}
}
Edn::File Buffer::GetFileName(void)
{
return m_fileName;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Edn::String Buffer::GetName(void)
{
// nothing to do
return m_fileName.GetCompleateName();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Edn::String Buffer::GetShortName(void)
{
// nothing to do
return m_fileName.GetShortFilename();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
Edn::String Buffer::GetFolder(void)
{
// nothing to do
return m_fileName.GetFolder();
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
bool Buffer::HaveName(void)
{
// nothing to do
return true;
}
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void Buffer::SetName(Edn::String &newName)
{
// nothing to do
}
/**
* @brief
*

View File

@@ -47,13 +47,30 @@ class Buffer {
Buffer(void);
Buffer(Edn::String &filename);
virtual ~Buffer(void);
Edn::File GetFileName(void);
virtual Edn::String GetName(void);
virtual Edn::String GetShortName(void);
virtual Edn::String GetFolder(void);
virtual void SetName(Edn::String &newName);
Edn::File GetFileName(void)
{
return m_fileName;
};
void SetFileName(Edn::File &newName)
{
m_fileName = newName;
m_haveName = true;
};
void SetFileName(Edn::String &newName)
{
m_fileName.SetCompleateName(newName);
m_haveName = true;
};
bool HaveName(void)
{
return m_haveName;
}
virtual void Save(void);
virtual bool HaveName(void);
bool IsModify(void);
protected:
void SetModify(bool status);

View File

@@ -242,7 +242,7 @@ int32_t BufferManager::GetId(Edn::String &filename)
for (iii=0; iii < listBuffer.Size(); iii++) {
// check if the buffer already existed
if (NULL != listBuffer[iii]) {
if ( listBuffer[iii]->GetName() == filename) {
if ( listBuffer[iii]->GetFileName().GetCompleateName() == filename) {
return iii;
}
}