My Templates file is getting large (~ 500k bytes)
It's getting harder to find code that I wish to insert into my program.
So I've decided that I have to build a search engine for the Templates.prefs file.
Is there a way to get the format of this file?
Templates file format
Templates file format
- It was too lonely at the top.
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Re: Templates file format
Its a rather simple format:
- First line must be "TEMPLATES:1.0" (case sensitive, without the quotes)
- Following lines are either in the form "keyword:data" or just "keyword" where:
- whitespace around keyword and data is ignored
- the keyword is case insensitive
- Possible keywords are:
- Directory - starts a new directory. The data is the directory name
- Expanded - if directly following a "Directory", this means that the directory is expanded in the view
- CloseDirectory - end of a directory
- Template - defines a template. The data is the template name
- Comment - defines the comment for the most recent template (optional). The data is the comment (escaped)
- Code - defines the code for the most recent template. The data is the code (escaped) on one line
- Anything that does not match one of these keywors (like empty lines) is simply ignored
- Replacing every "\" with "\\"
- Replacing every newline with "\n"
- No other special chars are escaped
quidquid Latine dictum sit altum videtur
Re: Templates file format
Thanks Freak.. That's enough to get me started.
- It was too lonely at the top.
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem