public abstract class FileContent extends Object
Modifier and Type | Field and Description |
---|---|
static long |
NULL_FILE_SIZE |
static long |
NULL_TIMESTAMP |
Constructor and Description |
---|
FileContent() |
Modifier and Type | Method and Description |
---|---|
static FileContent |
adapt(CodeReader reader)
Deprecated.
|
static FileContent |
create(org.eclipse.core.resources.IFile file)
Creates a file content for a workspace header file.
|
static FileContent |
create(IIndexFileLocation ifl)
Creates a file content object for an index file location.
|
static FileContent |
create(ITranslationUnit tu)
Creates a file content object for a translation-unit, which may be a working copy.
|
static FileContent |
create(String filePath,
boolean isSource,
char[] contents)
Creates a file content object for a fixed buffer.
|
static FileContent |
create(String filePath,
char[] contents)
Creates a file content object for a fixed buffer.
|
static FileContent |
createForExternalFileLocation(String fileLocation)
Creates a file content object for a header file that is not part of the workspace.
|
static FileContent |
createForExternalFileLocation(String fileLocation,
boolean isSource,
String encoding)
Creates a file content object for a header or a source file that is not part of the workspace.
|
static FileContent |
createForExternalFileLocation(String fileLocation,
String encoding)
Creates a file content object for a header file that is not part of the workspace.
|
abstract long |
getContentsHash()
Returns a 64-bit hash value of the file contents.
|
abstract String |
getFileLocation()
Returns the location of this file content as it will appear in
IASTFileLocation.getFileName() |
abstract long |
getFileSize()
Returns the size of the file, or NULL_FILE_SIZE if the content does not originate from
a file.
|
abstract long |
getReadTime()
Returns time when the file was read.
|
abstract long |
getTimestamp()
Returns the modification time of the file containing the content, or NULL_TIMESTAMP if
the content does not originate from a file.
|
abstract boolean |
hasError()
Returns
true if there were I/O errors while retrieving contents of this file. |
public static final long NULL_TIMESTAMP
public static final long NULL_FILE_SIZE
public abstract String getFileLocation()
IASTFileLocation.getFileName()
public abstract long getTimestamp()
public abstract long getReadTime()
public abstract long getFileSize()
public abstract boolean hasError()
true
if there were I/O errors while retrieving contents of this file.public abstract long getContentsHash()
public static FileContent create(String filePath, char[] contents)
filePath
- the path of the file as it will appear in IASTFileLocation.getFileName()
contents
- the actual content.public static FileContent create(String filePath, boolean isSource, char[] contents)
filePath
- the path of the file as it will appear in IASTFileLocation.getFileName()
contents
- the actual content.public static FileContent create(ITranslationUnit tu)
public static FileContent create(IIndexFileLocation ifl)
public static FileContent create(org.eclipse.core.resources.IFile file)
public static FileContent createForExternalFileLocation(String fileLocation)
public static FileContent createForExternalFileLocation(String fileLocation, String encoding)
public static FileContent createForExternalFileLocation(String fileLocation, boolean isSource, String encoding)
@Deprecated public static FileContent adapt(CodeReader reader)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.