Commit a17089b9 authored by Siebers, Michael's avatar Siebers, Michael
Browse files

introduce aux predicate for absolute path type

parent 57098570
...@@ -71,8 +71,9 @@ all_items_external_(_Key-Value,Item) :- ...@@ -71,8 +71,9 @@ all_items_external_(_Key-Value,Item) :-
% %
% Generates the type definition for an item (that is a file or a directory). Type is a valid type as defined by types:check_type_def/1. % Generates the type definition for an item (that is a file or a directory). Type is a valid type as defined by types:check_type_def/1.
item_type(anyof([DirectoryType,FileType])) :- item_type(anyof([DirectoryType,FileType])) :-
abs_path_type(AbsPathType),
CommonKeys=[ CommonKeys=[
abs_path: atom('^(/|.*[^/])$'), abs_path: AbsPathType,
creation_time: integer creation_time: integer
], ],
FileType = dict([ FileType = dict([
......
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
% @error api_error(_, implementation_error) if checking the irrelevance itself % @error api_error(_, implementation_error) if checking the irrelevance itself
% throws an exception. % throws an exception.
do_handle_irrelevant_file(Parameters,AbsPath) :- do_handle_irrelevant_file(Parameters,AbsPath) :-
abs_path_type(AbsPathType),
parse_parameters(Parameters, parse_parameters(Parameters,
dict([abs_path:atom]), dict([abs_path:AbsPathType]),
Parsed), Parsed),
AbsPath=Parsed.abs_path, AbsPath=Parsed.abs_path,
catch(user:irrelevant(AbsPath), catch(user:irrelevant(AbsPath),
......
...@@ -99,3 +99,8 @@ parse_parameters(In, Type, Out) :- ...@@ -99,3 +99,8 @@ parse_parameters(In, Type, Out) :-
throw(Exception) throw(Exception)
) )
). ).
%! abs_path_type(-Type) is det.
%
% Return the type definition for an absolute path used to identify items.
abs_path_type(atom('^(/|.*[^/])$')).
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment