File: fakefileaccess.cpp

package info (click to toggle)
kdiff3 1.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,044 kB
  • sloc: cpp: 25,563; xml: 456; python: 145; makefile: 6; sh: 4
file content (102 lines) | stat: -rw-r--r-- 2,323 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
  SPDX-FileCopyrightText: 2002-2007 Joachim Eibl, joachim.eibl at gmx.de
  SPDX-FileCopyrightText: 2018-2020 Michael Reeves reeves.87@gmail.com
  SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "../src/fileaccess.h"

#include <QString>

FileAccess::FileAccess(const QString& name, bool bWantToWrite)
{
  assert(!bWantToWrite);

  m_name = name;
}

//   FileAccess( const QString& name, bool bWantToWrite=false ); // name: local file or dirname or url (when supported)
//   void setFile( const QString& name, bool bWantToWrite=false );
//
bool FileAccess::isValid() const
{
  return m_name.length() != 0;
}

//   bool isFile() const;
//   bool isDir() const;
//   bool isSymLink() const;
bool FileAccess::exists() const
{
    return true;
}
qint64 FileAccess::size() const
{
    return 64;
}

qint64 FileAccess::sizeForReading()
{
    return 64;
}

//   bool isReadable() const;
//   bool isWritable() const;
//   bool isExecutable() const;
//   bool isHidden() const;
//   QString readLink() const;
//
//   QDateTime   created()       const;
//   QDateTime   lastModified()  const;
//   QDateTime   lastRead()      const;
//
//   QString fileName() const; // Just the name-part of the path, without parent directories
//   QString filePath() const; // The path-string that was used during construction
QString FileAccess::prettyAbsPath() const
{
    return QString("");
}
//   KUrl url() const;
QString FileAccess::absoluteFilePath() const
{
  return "";
}

bool FileAccess::isLocal() const
{
  return true;
}

bool FileAccess::readFile(void* pDestBuffer, qint64 maxLength )
{
    Q_UNUSED(pDestBuffer)
    Q_UNUSED(maxLength);
    return true;
}
bool FileAccess::writeFile(const void* pSrcBuffer, qint64 length )
{
    Q_UNUSED(pSrcBuffer);
    Q_UNUSED(length);
    return true;
}

//   bool listDir( t_DirectoryList* pDirList, bool bRecursive, bool bFindHidden,
//                 const QString& filePattern, const QString& fileAntiPattern,
//                 const QString& dirAntiPattern, bool bFollowDirLinks, bool bUseCvsIgnore );
bool FileAccess::copyFile( const QString& destUrl )
{
    Q_UNUSED(destUrl);
    return true;
}
//   bool createBackup( const QString& bakExtension );
//
QString FileAccess::getTempName() const
{
    return QString("");
}

bool FileAccess::removeFile()
{
    return true;
}