blob: fd649d9c1e5c3d968855b7b2c649fad0b93390f0 (
plain)
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
103
104
105
106
107
108
109
110
111
112
113
|
###############################################################################
#
# Class: NaturalDocs::Project::SourceFile
#
###############################################################################
#
# A simple information class about project files.
#
###############################################################################
# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
# Natural Docs is licensed under the GPL
use strict;
use integer;
package NaturalDocs::Project::SourceFile;
###############################################################################
# Group: Implementation
#
# Constants: Members
#
# The class is implemented as a blessed arrayref. The following constants are used as indexes.
#
# HAS_CONTENT - Whether the file contains Natural Docs content or not.
# LAST_MODIFIED - The integer timestamp of when the file was last modified.
# STATUS - <FileStatus> since the last build.
# DEFAULT_MENU_TITLE - The file's default title in the menu.
#
# DEPENDENCY: New() depends on its parameter list being in the same order as these constants. If the order changes, New()
# needs to be changed.
use NaturalDocs::DefineMembers 'HAS_CONTENT', 'LAST_MODIFIED', 'STATUS', 'DEFAULT_MENU_TITLE';
###############################################################################
# Group: Functions
#
# Function: New
#
# Creates and returns a new file object.
#
# Parameters:
#
# hasContent - Whether the file contains Natural Docs content or not.
# lastModified - The integer timestamp of when the file was last modified.
# status - The <FileStatus> since the last build.
# defaultMenuTitle - The file's title in the menu.
#
# Returns:
#
# A reference to the new object.
#
sub New #(hasContent, lastModified, status, defaultMenuTitle)
{
# DEPENDENCY: This function depends on its parameter list being in the same order as the member constants. If either order
# changes, this function needs to be changed.
my $package = shift;
my $object = [ @_ ];
bless $object, $package;
return $object;
};
# Function: HasContent
# Returns whether the file contains Natural Docs content or not.
sub HasContent
{ return $_[0]->[HAS_CONTENT]; };
# Function: SetHasContent
# Sets whether the file contains Natural Docs content or not.
sub SetHasContent #(hasContent)
{ $_[0]->[HAS_CONTENT] = $_[1]; };
# Function: LastModified
# Returns the integer timestamp of when the file was last modified.
sub LastModified
{ return $_[0]->[LAST_MODIFIED]; };
# Function: SetLastModified
# Sets the file's last modification timestamp.
sub SetLastModified #(lastModified)
{ $_[0]->[LAST_MODIFIED] = $_[1]; };
# Function: Status
# Returns the <FileStatus> since the last build.
sub Status
{ return $_[0]->[STATUS]; };
# Function: SetStatus
# Sets the <FileStatus> since the last build.
sub SetStatus #(status)
{ $_[0]->[STATUS] = $_[1]; };
# Function: DefaultMenuTitle
# Returns the file's default title on the menu.
sub DefaultMenuTitle
{ return $_[0]->[DEFAULT_MENU_TITLE]; };
# Function: SetDefaultMenuTitle
# Sets the file's default title on the menu.
sub SetDefaultMenuTitle #(menuTitle)
{ $_[0]->[DEFAULT_MENU_TITLE] = $_[1]; };
1;
|