NaturalDocs::Project::ImageFile

A simple information class about project image files.

Summary
NaturalDocs::Project::ImageFileA simple information class about project image files.
Implementation
MembersThe class is implemented as a blessed arrayref.
WasUsed versus ReferencesWasUsed() is a simple true/false that notes whether this image file was used the last time Natural Docs was run.
Functions
NewCreates and returns a new file object.
LastModifiedReturns the integer timestamp of when the file was last modified.
SetLastModifiedSets the file’s last modification timestamp.
StatusReturns the FileStatus since the last build.
SetStatusSets the FileStatus since the last build.
ReferenceCountReturns the current number of references to this image file during this Natural Docs execution.
AddReferenceIncreases the number of references to this image file by one.
DeleteReferenceDecreases the number of references to this image file by one.
WasUsedReturns whether this image file was used during the last Natural Docs execution.
SetWasUsedSets whether this image file was used during the last Natural Docs execution.
WidthReturns the width in pixels, undef if it can’t be determined, and -1 if determination hasn’t been attempted yet.
HeightReturns the width in pixels, undef if it can’t be determined, and -1 if determination hasn’t been attempted yet.
SetDimensionsSets the width and height of the image.

Implementation

Members

The class is implemented as a blessed arrayref.  The following constants are used as indexes.

LAST_MODIFIEDThe integer timestamp of when the file was last modified.
STATUSFileStatus since the last build.
REFERENCE_COUNTThe number of references to the image from the source files.
WAS_USEDWhether the image was used the last time Natural Docs was run.
WIDTHThe image width.  Undef if can’t be determined, -1 if haven’t attempted to determine yet.
HEIGHTThe image height.  Undef if can’t be determined, -1 if haven’t attempted to determine yet.

WasUsed versus References

WasUsed() is a simple true/false that notes whether this image file was used the last time Natural Docs was run.  ReferenceCount() is a counter for the number of times it’s used this run.  As such, it starts at zero regardless of whether WasUsed() is set or not.

Functions

New

sub New #(timestamp lastModified,
FileStatus status,
bool wasUsed)

Creates and returns a new file object.

Parameters

lastModifiedThe image file’s last modification timestamp
statusThe FileStatus.
wasUsedWhether this image file was used the last time Natural Docs was run.

LastModified

Returns the integer timestamp of when the file was last modified.

SetLastModified

Sets the file’s last modification timestamp.

Status

Returns the FileStatus since the last build.

SetStatus

Sets the FileStatus since the last build.

ReferenceCount

Returns the current number of references to this image file during this Natural Docs execution.

AddReference

sub AddReference

Increases the number of references to this image file by one.  Returns the new reference count.

DeleteReference

sub DeleteReference

Decreases the number of references to this image file by one.  Returns the new reference count.

WasUsed

Returns whether this image file was used during the last Natural Docs execution.

SetWasUsed

Sets whether this image file was used during the last Natural Docs execution.

Width

Returns the width in pixels, undef if it can’t be determined, and -1 if determination hasn’t been attempted yet.

Height

Returns the width in pixels, undef if it can’t be determined, and -1 if determination hasn’t been attempted yet.

SetDimensions

sub SetDimensions #(int width,
int height)

Sets the width and height of the image.  Set to undef if they can’t be determined.

Returns whether this image file was used during the last Natural Docs execution.
sub New #(timestamp lastModified,
FileStatus status,
bool wasUsed)
Creates and returns a new file object.
What happened to a file since Natural Docs’ last execution.
sub AddReference
Increases the number of references to this image file by one.
sub DeleteReference
Decreases the number of references to this image file by one.
sub SetDimensions #(int width,
int height)
Sets the width and height of the image.
Returns the current number of references to this image file during this Natural Docs execution.
Close