about summary refs log tree commit diff
path: root/docs/tool/Modules/NaturalDocs/SourceDB/Extension.pm
blob: c247ea02467c455b7d72e614d8be47ebdb0be1d9 (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
###############################################################################
#
#   Package: NaturalDocs::SourceDB::Extension
#
###############################################################################
#
#   A base package for all <SourceDB> extensions.
#
###############################################################################

# 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::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;