The Meta-Environment API

text-utils.tb

Go to the documentation of this file.
00001 #ifndef __TEXT_UTILS__
00002 #define __TEXT_UTILS__
00003 
00004 #include <io-utils.tb>
00005 #include <undefined.h>
00006 
00007 #define TEXT_REPOSITORY "text-repository"
00008  
00009 process ReadText(Path: str, Contents: str?) is
00010 let
00011   Value: term
00012 in
00013   GetCachedValue(TEXT_REPOSITORY, Path, Value?)
00014   .
00015   if equal(Value, UNDEFINED) then
00016     ReadFile(Path, Contents?)
00017     . PutCachedValue(TEXT_REPOSITORY, Path, Contents)
00018   else
00019     Contents := Value
00020   fi
00021 endlet
00022 
00023 toolbus(InitCache(TEXT_REPOSITORY))
00024 
00025 #endif /*__TEXT_UTILS__*/

Generated on Fri Sep 12 13:08:53 2008 for meta by  doxygen 1.4.6