File: Extension.pm

package info (click to toggle)
naturaldocs 1.51-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,304 kB
  • sloc: perl: 17,534; javascript: 1,925; makefile: 6; sh: 1
file content (85 lines) | stat: -rw-r--r-- 2,339 bytes parent folder | download | duplicates (6)
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
###############################################################################
#
#   Package: NaturalDocs::SourceDB::Extension
#
###############################################################################
#
#   A base package for all <SourceDB> extensions.
#
###############################################################################

# This file is part of Natural Docs, which is Copyright  2003-2010 Greg Valure
# Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
# Refer to License.txt for the complete details

use strict;
use integer;


package NaturalDocs::SourceDB::Extension;


###############################################################################
# Group: Interface Functions
# These functions must be overridden by the derived class.


#
#   Function: Register
#
#   Override this function to register the package with <NaturalDocs::SourceDB->RegisterExtension()>.
#
sub Register
    {
    die "Called SourceDB::Extension->Register().  This function should be overridden by every extension.";
    };


#
#   Function: Load
#
#   Called by <NaturalDocs::SourceDB->Load()> to load the extension's data.  Returns whether it was successful.
#
#   *This function might not be called.*  If there's a situation that would cause all the source files to be reparsed anyway,
#   <NaturalDocs::SourceDB> may skip calling Load() for the remaining extensions.  You should *not* depend on this function
#   for any critical initialization that needs to happen every time regardless.
#
sub Load # => bool
    {
    return 1;
    };


#
#   Function: Save
#
#   Called by <NaturalDocs::SourceDB->Save()> to save the extension's data.
#
sub Save
    {
    };


#
#   Function: OnDeletedDefinition
#
#   Called for each definition deleted by <NaturalDocs::SourceDB>.  This is called *after* the definition has been deleted from
#   the database, so don't expect to be able to read it.
#
sub OnDeletedDefinition #(string itemString, FileName file, bool wasLastDefinition)
    {
    };


#
#   Function: OnChangedDefinition
#
#   Called for each definition changed by <NaturalDocs::SourceDB>.  This is called *after* the definition has been changed, so
#   don't expect to be able to read the original value.
#
sub OnChangedDefinition #(string itemString, FileName file)
    {
    };


1;