NaturalDocs:: Constants

Constants that are used throughout the script.  All are exported by default. 

Summary
Constants that are used throughout the script.
No constant here will ever be zero.
Constants representing all the types of Natural Docs sections.
Returns whether the topic is a list topic.
Returns what type the list topic is a list of.
Constants representing all the types of sections that can appear in the menu file.
The various flags that can apply to a menu entry.
An 8-bit constant that’s used as the first byte of binary data files.

Assumptions

No constant here will ever be zero. 

Topic Types

Constants representing all the types of Natural Docs sections. 

TOPIC_CLASSA class.  All topics until the next class or section become its members. 
TOPIC_SECTIONA main section of code or text.  Formats like a class but doesn’t provide scope.  Also ends the scope of a class. 
TOPIC_FILEA file.  Is always referenced as a global, but does not end a class scope. 
TOPIC_GROUPA subdivider for long lists. 
TOPIC_FUNCTIONA function.  The code immediately afterwards will be used as the prototype if it matches the name. 
TOPIC_VARIABLEA variable.  The code immediately afterwards will be used as the prototype if it matches the name. 
TOPIC_GENERICA generic topic. 
TOPIC_CLASS_LISTA list of classes where it’s not worth giving each its own entry.  Will not have scope. 
TOPIC_FILE_LISTA list of files where it’s not worth giving each its own entry. 
TOPIC_FUNCTION_LISTA list of functions where it’s not worth giving each its own entry.  Will not have prototypes. 
TOPIC_VARIABLE_LISTA list of variables where it’s not worth giving each its own entry.  Will not have prototypes. 
TOPIC_GENERIC_LISTA list of generic topics where it’s not worth giving each its own entry, such as constants. 

Dependency

NaturalDocs.m depends on these values all being able to fint into a UInt8, i.e.  <= 255. 

TopicIsList

sub TopicIsList #(topic)

Returns whether the topic is a list topic. 

TopicIsListOf

sub TopicIsListOf #(topic)

Returns what type the list topic is a list of.  Assumes the topic is a list topic. 

Menu Entry Types

Constants representing all the types of sections that can appear in the menu file. 

MENU_TITLEThe title of the menu. 
MENU_SUBTITLEThe sub-title of the menu. 
MENU_FILEA source file, relative to the source directory. 
MENU_GROUPA group. 
MENU_TEXTArbitrary text. 
MENU_LINKA web link. 
MENU_FOOTERFooter text. 
MENU_INDEXAn index. 
MENU_FORMATThe version of Natural Docs the menu file was generated with. 
MENU_ENDOFORIGINALA dummy entry that marks where the original group content ends.  This is used when automatically changing the groups so that the alphabetization or lack thereof can be detected without being affected by new entries tacked on to the end. 

Dependency

NaturalDocs.m depends on these values all being able to fit into a UInt8, i.e.  <= 255. 

Menu Entry Flags

The various flags that can apply to a menu entry.  You cannot mix flags of different types, since they may overlap. 

File Flags

MENU_FILE_NOAUTOTITLEWhether the file is auto-titled or not. 

Group Flags

MENU_GROUP_UPDATETITLESThe group should have its auto-titles regenerated. 
MENU_GROUP_UPDATESTRUCTUREThe group should be checked for structural changes, such as being removed or being split into subgroups. 
MENU_GROUP_UPDATEORDERThe group should be resorted. 
MENU_GROUP_HASENDOFORIGINALWhether the group contains a dummy MENU_ENDOFORIGINAL entry. 
MENU_GROUP_UNSORTEDThe group’s contents are not sorted. 
MENU_GROUP_FILESSORTEDThe group’s files are sorted alphabetically. 
MENU_GROUP_FILESANDGROUPSSORTEDThe group’s files and sub-groups are sorted alphabetically. 
MENU_GROUP_EVERYTHINGSORTEDAll entries in the group are sorted alphabetically. 

File Status Constants

FILE_NEWThe file has been added since the last run. 
FILE_CHANGEDThe file has been modified since the last run. 
FILE_SAMEThe file hasn’t been modified since the last run. 
FILE_DOESNTEXISTThe file doesn’t exist, or was deleted. 

BINARY_FORMAT

An 8-bit constant that’s used as the first byte of binary data files.  This is used so that you can easily distinguish between binary and old-style text data files.  It’s not a character that would appear in plain text files.