.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Code::TidyAll::CacheModel 3pm" .TH Code::TidyAll::CacheModel 3pm "2017-01-06" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Code::TidyAll::CacheModel \- Caching model for Code::TidyAll .SH "VERSION" .IX Header "VERSION" version 0.55 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& my $cache_model = Cody::TidyAll::CacheModel\->new( \& cache_engine => Code::TidyAll::Cache\->new(...), \& path => "/path/to/file/to/cache", \& ); \& \& # check cache \& print "Yes!" if $cache_model\->is_cached; \& \& # update cache \& $cache_model\->clear_file_contents; \& $cache_model\->update; \& \& # update the cache when you know the file contents \& $cache_model\->file_contents($new_content); \& $cache_model\->update; \& \& # force removal from cache \& $cache_model\->remove; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" A cache model for Code::TidyAll. Different subclasses can employ different caching techniques. .PP The basic model implemented here is simple; It stores in the cache a hash key of the file contents keyed by a hash key of the file's path. .SS "Attributes" .IX Subsection "Attributes" .IP "full_path (required, ro)" 4 .IX Item "full_path (required, ro)" The full path to the file on disk .IP "path (required, ro)" 4 .IX Item "path (required, ro)" The local path to the file (i.e. what the cache system will consider the canonical name of the file) .IP "cache_engine (optional, default undef, ro)" 4 .IX Item "cache_engine (optional, default undef, ro)" A \f(CW\*(C`Code::TidyAll::Cache\*(C'\fR compatible instance, or, if no caching is required undef. .IP "base_sig (optional, default empty string, ro)" 4 .IX Item "base_sig (optional, default empty string, ro)" A base signature. .IP "file_contents (optional, default loads file contents from disk, rw)" 4 .IX Item "file_contents (optional, default loads file contents from disk, rw)" .PD 0 .IP "is_cached (optional, default computed, rw)" 4 .IX Item "is_cached (optional, default computed, rw)" .PD A flag indicating if this is cached. By default checks that the cache key and cache value match the cache. .SS "Methods" .IX Subsection "Methods" .IP "cache_key" 4 .IX Item "cache_key" The computed cache key for the file .IP "cache_value" 4 .IX Item "cache_value" The computed cache value for the file .IP "update" 4 .IX Item "update" Updates the cache .IP "remove" 4 .IX Item "remove" Attempts to remove the value from the cache .SH "SUPPORT" .IX Header "SUPPORT" Bugs may be submitted through . .PP I am also usually active on \s-1IRC\s0 as 'drolsky' on \f(CW\*(C`irc://irc.perl.org\*(C'\fR. .SH "AUTHORS" .IX Header "AUTHORS" .IP "\(bu" 4 Jonathan Swartz .IP "\(bu" 4 Dave Rolsky .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2011 \- 2016 by Jonathan Swartz. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.