|
Revision 2067, 0.8 kB
(checked in by karpet, 6 months ago)
|
initial import
|
| Line | |
|---|
| 1 |
SWISH::Prog notes |
|---|
| 2 |
============================= |
|---|
| 3 |
|
|---|
| 4 |
base class - keep it simple |
|---|
| 5 |
SWISH::Prog->new = |
|---|
| 6 |
|
|---|
| 7 |
indexer handle |
|---|
| 8 |
UA handle |
|---|
| 9 |
fetch() method returns SWISH::Prog::Doc object, reads doc into buffer, headers, etc. |
|---|
| 10 |
index() method hands to indexer and can take either string or Doc object |
|---|
| 11 |
filter() - takes a Doc object, called in index() |
|---|
| 12 |
ok() - takes a Doc object, called in index() |
|---|
| 13 |
|
|---|
| 14 |
SWISH::Prog::Doc methods |
|---|
| 15 |
|
|---|
| 16 |
each method corresponds to a Header line, plus content() |
|---|
| 17 |
url() |
|---|
| 18 |
modtime() |
|---|
| 19 |
mime() / type() (alias-> mime) -- use File::Type |
|---|
| 20 |
parser() - use parser map |
|---|
| 21 |
content() |
|---|
| 22 |
|
|---|
| 23 |
as_string() returns object as scalar string, ready for indexer |
|---|
| 24 |
|
|---|
| 25 |
print $Doc should stringify same as as_string() |
|---|
| 26 |
|
|---|
| 27 |
use overload |
|---|
| 28 |
( |
|---|
| 29 |
'""' => \&as_string, |
|---|
| 30 |
fallback => 1, |
|---|
| 31 |
); |
|---|
| 32 |
|
|---|
| 33 |
|
|---|