function out = getDerivedExtensions(h,strict)
%

%   Copyright 2014 The MathWorks, Inc.

out = [  ];
tools = h.getAllTools();
for i = 1:numel( tools )
    tool = tools{ i };
    dExts = tool.DerivedFileExtensions;
    if nargin==2 && strict && ~isempty( dExts )
        % Strict:
        % Remove extensions that are empty
        exts = tool.FileExtensions.keys();
        numeExts = numel( exts );
        ext = struct( 'token', cell( 1, numeExts ), 'value', cell( 1, numeExts ) );
        for j = 1:numeExts
            ext( j ).token = tool.getFileExtensionToken( exts{ j } );
            ext( j ).value = tool.getFileExtension( exts{ j } );
        end
        temp = [  ];
        for j = 1:numel( dExts )
            foundIdx = find( strcmp( dExts{ j }, { ext.token } ) );
            if isempty( foundIdx ) || ~isempty( ext( foundIdx ).value )
                temp{ end + 1 } = dExts{ j };  %#ok<AGROW>
            end
        end
        dExts = temp;
    end
    out = horzcat( out, dExts );  %#ok<AGROW>
end
out = unique( out );
end
