OSDN Git Service

Remove unused (only usage was in unused code) sbuffer class.
authorKimmo Varis <kimmov@gmail.com>
Wed, 30 Jul 2008 12:09:30 +0000 (12:09 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 30 Jul 2008 12:09:30 +0000 (12:09 +0000)
Src/Common/UniFile.cpp
Src/Common/UniFile.h
Src/Common/sbuffer.h [deleted file]
Src/Merge.vcproj

index fb3075c..6c56e2c 100644 (file)
@@ -923,16 +923,6 @@ BOOL UniStdioFile::ReadString(String & line, String & eol, bool * lossy)
        ASSERT(0); // unimplemented -- currently cannot read from a UniStdioFile!
        return FALSE;
 }
-BOOL UniStdioFile::ReadString(sbuffer & sline, bool * lossy)
-{
-       ASSERT(0); // unimplemented -- currently cannot read from a UniStdioFile!
-       return FALSE;
-}
-BOOL UniStdioFile::ReadString(sbuffer & sline, String & eol, bool * lossy)
-{
-       ASSERT(0); // unimplemented -- currently cannot read from a UniStdioFile!
-       return FALSE;
-}
 
 /** @brief Write BOM (byte order mark) if Unicode file */
 int UniStdioFile::WriteBom()
index 1bcafc7..7c7ea0d 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef UniFile_h_included
 #define UniFile_h_included
 
-#include "sbuffer.h"
 #include "unicoder.h"
 
 /**
@@ -191,10 +190,8 @@ public:
 protected:
        virtual BOOL ReadString(String & line, bool * lossy);
        virtual BOOL ReadString(String & line, String & eol, bool * lossy);
-public:
-       virtual BOOL ReadString(sbuffer & line, bool * lossy);
-       virtual BOOL ReadString(sbuffer & line, String & eol, bool * lossy);
 
+public:
        virtual __int64 GetPosition() const;
 
        virtual int WriteBom();
diff --git a/Src/Common/sbuffer.h b/Src/Common/sbuffer.h
deleted file mode 100644 (file)
index 550eb10..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/** 
- * @file  sbuffer.h
- *
- * @brief Declaration file for sbuffer class
- *
- * @date  Created: 2003-10-09 (Perry Rapp)
- */
-// RCS ID line follows -- this is updated by CVS
-// $Id$
-
-#ifndef sbuffer_h_included
-#define sbuffer_h_included
-
-
-/**
- * @brief Primitive string that grows with exponential allocation
- */
-class sbuffer
-{
-public:
-       sbuffer(UINT init)
-               {
-                       m_size = init;
-                       m_buff = new TCHAR[m_size];
-                       m_len = 0;
-               }
-       ~sbuffer()
-               {
-                       delete m_buff;
-                       m_buff = 0;
-               }
-       void Append(LPCTSTR sz)
-               {
-                       CString str = sz;
-                       Append(str);
-               }
-       void Append(const CString & s)
-               {
-                       if (s.GetLength() + m_len > m_size-1)
-                       {
-                               do
-                               {
-                                       m_size = m_size * 2;
-                               }
-                               while (s.GetLength() + m_len > m_size-1);
-                               TCHAR * newbuff = new TCHAR[m_size];
-                               _tcscpy(newbuff, m_buff);
-                               delete[] m_buff;
-                               m_buff = newbuff;
-                       }
-                       _tcscpy(&m_buff[m_len], s);
-                       m_len += s.GetLength();
-               }
-       void Clear() { m_buff[0] = 0; m_len = 0; }
-       void Set(LPCTSTR sztext)
-               {
-                       Clear();
-                       Append(sztext);
-               }
-       BOOL StartsWithInsensitive(const CString & prefix)
-               {
-                       return (0 == _tcsnicmp(GetData(), prefix, prefix.GetLength()));
-               }
-       CString Left(int len)
-               {
-                       CString s;
-                       LPTSTR sz = s.GetBuffer(len+1);
-                       _tcsncpy(sz, GetData(), len);
-                       sz[len] = 0;
-                       s.ReleaseBuffer();
-                       return s;
-               }
-       // get data length
-       int GetLength() const { return m_len; }
-
-       // TRUE if zero length
-       BOOL IsEmpty() const { return m_len==0; }
-       
-       LPCTSTR GetData() const { return m_buff; }
-
-// Implementation data
-private:
-       TCHAR * m_buff;
-       UINT m_len;
-       UINT m_size;
-};
-
-#endif // sbuffer_h_included
index 48c3e1b..de0dc9e 100644 (file)
                                RelativePath="SaveClosingDlg.h">
                        </File>
                        <File
-                               RelativePath="Common\sbuffer.h">
-                       </File>
-                       <File
                                RelativePath="Common\scbarcf.h">
                        </File>
                        <File