Return a list of methods for the side navigation

@param {Object} file
@return {Object} Object formatted for template nav helper
@api private
350449
function buildStructureForFile(file) {
  var names = [];
  var targetLink;

  if (file.dox.length === 0) { return false; }

  file.dox.forEach(function(method){
    if (method.ctx && !method.ignore) { names.push(method.ctx.name); }
  });

  // How deep is your love?
  // If the splitted currentFile (the file we are currently rendering) path got one folder
  // in the path or more, add ../ for each level found
  if(file.currentFile && file.currentFile.split(path.sep).length > 1 ){
    // Depth of current file
    var depth = file.currentFile.split(path.sep).length,
    // Create a prefix with n "../"
    prefix = new Array(depth).join('../');
    // Set up target link with prefix
    targetLink = prefix + file.targetFile;
  } else {
    // Link does not have to be altered
    targetLink = file.targetFile;
  }

  return {
    source: {
      full: file.sourceFile,
      dir: path.dirname(file.sourceFile),
      file: path.basename(file.sourceFile)
    },
    target: file.targetFile,
    methods: names,
    link : targetLink
  };
}
367743
function getDepList(file, added) {
        var depList = [];
        added = added || {};
        file.requires.forEach(function (depId) {
            if (added[depId]) {
                return false;
            }
            added[depId] = true;
            var dep = ret.ids[depId];
            if (!dep) {
                var isNotice = true;
                if (settings.notice && settings.notice.exclude) {
                    isNotice = fis.util.filter(file.subpath, null, settings.notice.exclude);
                }
                if (isNotice) {
                    fis.log.notice('can\'t find dep resource [' + depId + ']');
                }
                return false;
            }
            depList = depList.concat(getDepList(dep, added));
            depList.push(dep);
        });
        return depList;
    }
309705
function parser(file, callback) {
  // file exit conditions
  if(file.isNull()) {
    return callback(null, file); // pass along
  }

  if(file.isStream()) {
    return callback(new Error('Streaming not supported'));
  }

  try {

    var
      /** @type {string} */
      text     = String(file.contents.toString('utf8')),
      lines    = text.split('\n'),
      filename = file.path.substring(0, file.path.length - 4),
      key      = 'server/documents',
      position = filename.indexOf(key)
    ;

    // exit conditions
    if(!lines) {
      return;
    }
    if(position < 0) {
      return callback(null, file);
    }

    filename = filename.substring(position + key.length + 1, filename.length);

    var
      lineCount = lines.length,
      active    = false,
      yaml      = [],
      categories = [
        'UI Element',
        'UI Global',
        'UI Collection',
        'UI View',
        'UI Module',
        'UI Behavior'
      ],
      index,
      meta,
      line
    ;

    for(index = 0; index < lineCount; index++) {

      line = lines[index];

      // Wait for metadata block to begin
      if(!active) {
        if(startsWith(line, '---')) {
          active = true;
        }
        continue;
      }
      // End of metadata block, stop parsing.
      if(startsWith(line, '---')) {
        break;
      }
      yaml.push(line);
    }


    // Parse yaml.
    meta = YAML.parse(yaml.join('\n'));
    if(meta && meta.type && meta.title && inArray(meta.type, categories) ) {
      meta.category = meta.type;
      meta.filename = filename;
      meta.url      = '/' + filename;
      meta.title    = meta.title;
      // Primary key will by filepath
      data[meta.element] = meta;
    }
    else {
      // skip
      // console.log(meta);
    }


  }

  catch(error) {
    console.log(error, filename);
  }

  callback(null, file);

}
729004
function(file, list) {
        console.debug('replacing: ', file);
        try {
            var f;
            f =(f=file.split(/\//))[f.length-1];
            var isJS = /\.js/.test(f.substring(f.length-3));
            var isJSON = /\.js/.test(f.substring(f.length-5));

            if ( isJS || isJSON && /config\/app\.json/.test(file) ) {
                var contentFile = fs.readFileSync(file, 'utf8').toString();
                //var contentFile = require(file).toSource();
                var dic = {
                    "Bundle" : self.bundle.substring(0, 1).toUpperCase() + self.bundle.substring(1),
                    "bundle" : self.bundle
                };

                contentFile = whisper(dic, contentFile);//data
                //rewrite file
                fs.writeFileSync(file, contentFile)
            }

            if ( list != undefined && list.indexOf(file) > -1 ) { //end of current dir
                list.splice( list.indexOf(file), 1 )
            }
            return list

        } catch(err) {
            console.error(err.stack);
            process.exit(1)
        }
    }
1211974
public static File [] listFiles(File file) {
		if (file==null){
			return EMPTY_FILE_LIST;
		} 
		
		File ret[]=file.listFiles(FILE_FILTER);
		
		if (ret==null){
			return EMPTY_FILE_LIST;
		} else {
			return ret;
		}		
	}
220668
function globFile (file) {
    return stat(file).then(({ err, stats }) => {
      if (err) throw err
      if (stats.isDirectory()) {
        // TODO what if file is already slash-terminated?
        switch (file) {
          case './':
            return globPromise('./*.js')
          case 'bin':
            return globPromise('bin/*')
          default:
            return globPromise(`${file}/**/*.js`)
        }
      } else {
        return Promise.resolve(file)
      }
    })
  }
680020
function Navigation(beyond, pages, events) {
        "use strict";
    
        // Set pathname as a property of the navigation object.
        pathname(this, events);
        var root = this.root;
    
        var mode = 'pushState';
        if (location.protocol === 'file:') mode = 'hash';
        else if (location.pathname.substr(location.pathname.length - 11) === '/index.html') mode = 'hash';
    
        Object.defineProperty(this, 'mode', {
            'get': function () {
                return mode;
            }
        });
    
        var active, navigating;
        Object.defineProperty(this, 'active', {
            'get': function () {
                return active;
            }
        });
    
        function updateHref(pathname, state) {
    
            var url = pathname;
            if (mode === 'hash') url = '#' + pathname.substr(1);
            if (beyond.params.local) url = root + url;
    
            history.pushState(state, '', url);
    
        }
    
        // On any change in navigation, the variable navigationID increments.
        // Helps to process only the active navigation on asynchronous calls
        // of the pages.get method & the defaultUrl function.
        var navigationID = 0;
    
        var showPage = Delegate(this, function (pathname, search, state, callback) {
    
            if (active && active.pathname === this.pathname) {
                return;
            }
    
            if (active) {
                active.hide();
                active = undefined;
            }
    
            var callID = navigationID;
    
            // showTime defines when the new active page must be shown to give the time to the previous
            // page transition to finish.
            var showTime = Date.now() + 500;
    
            pages.get(pathname, state, function (response) {
    
                if (navigationID !== callID) {
                    // This is a callback function being called from a previous page show.
                    return;
                }
    
                // Response being a string means it is an error
                if (typeof response === 'string') {
                    console.error(response);
                    return;
                }
    
                var page = response.page;
                if (!page) {
                    console.error('Page undefined');
                    return;
                }
    
                history.replaceState(response.state, '', location.href);
    
                if (callback) {
    
                    var onRendered = function () {
                        callback();
                        page.unbind('rendered', onRendered);
                    };
                    page.bind('rendered', onRendered);
    
                }
    
                active = page;
    
                page.state = response.state;
                page.search = search;
                if (!page.initialised) {
                    page.initialise();
                }
                page.show(showTime);
    
            });
    
        });
    
        var defaultUrl = Delegate(this, function (callback) {
    
            var callID = navigationID;
    
            var timer;
            setTimeout(function () {
                if (callID !== navigationID) return;
                console.error('Routing event to get the default page is taking too much time to respond.');
            }, 5000);
    
            var event = {
                'event': 'routing',
                'cancellable': true,
                'async': true
            };
    
            events.trigger(event, '/', function (response) {
    
                clearTimeout(timer);
                if (callID !== navigationID) return;
    
                if (!response) {
                    console.error('Page default is not defined.', response);
                    return;
                }
                if (typeof response !== 'object' || typeof response.pathname !== 'string' || !response.pathname) {
                    console.error('Page default is invalid.', response);
                    return;
                }
                if (response.pathname === '/') {
                    console.error('Default pathname cannot be "/". It would result in an infinity loop.', response);
                    return;
                }
    
                callback(response);
    
            });
    
        });
    
        var navigateDefaultUrl = Delegate(this, function () {
    
            if (navigating === '/') return;
    
            navigationID++;
            navigating = '/';
    
            var callID = navigationID;
    
            defaultUrl(Delegate(this, function (response) {
    
                // In case another updateDefaultUrl call was made and this one is older.
                if (callID !== navigationID) return;
    
                updateHref(response.pathname, response.state);
                updateNavigation();
    
            }));
    
        });
    
        /*
         updateNavigation takes the history.state to use as the parameters to be sent to the page.
         Remember to update the state before calling this function.
         */
        var updateNavigation = Delegate(this, function (callback) {
    
            if (navigating === this.pathname) return;
            backToHome = false;
    
            navigationID++;
            navigating = this.pathname;
    
            var search;
            if (mode === 'hash') {
                var hash = location.hash;
                search = hash.substr(hash.indexOf('?'));
            }
            else {
                search = location.search;
            }
    
            showPage(this.pathname, search, history.state, callback);
    
        });
    
        var onpopstate = Delegate(this, function () {
    
            if (this.pathname === '/') {
                navigateDefaultUrl();
            }
            else {
                updateNavigation();
            }
    
        });
    
        this.navigate = function (pathname, state) {
    
            if (pathname === '/') {
    
                if (typeof state !== 'undefined') {
                    console.warn('Parameters can not be sent to the default page.');
                }
                navigateDefaultUrl();
    
            }
            else {
                updateHref(pathname, state);
                updateNavigation();
            }
    
        };
    
        beyond.done(Delegate(this, function () {
    
            window.addEventListener('popstate', onpopstate);
    
            // Hide the splashscreen
            beyond.phonegap.done(function () {
    
                if (navigator.splashscreen) {
                    setTimeout(function () {
                        navigator.splashscreen.hide();
                    }, 1000);
                }
    
            });
    
            if (location.hash) {
    
                var pathname = location.hash.substr(1);
                if (pathname.substr(0, 1) !== '/') {
                    pathname = '/' + pathname;
                }
    
                beyond.navigate(pathname);
                return;
    
            }
    
            if (this.pathname === '/') {
                navigateDefaultUrl();
            }
            else {
                updateNavigation(function () {
    
                    // Required by phantom
                    $('body').append('<div />').attr('id', 'phantom-ready');
    
                });
            }
    
        }));
    
        var backToHome;
        Object.defineProperty(this, 'backToHome', {
            'get': function () {
                return !!backToHome;
            },
            'set': function (value) {
                // normally this property is set before the navigate,
                // the navigate cleans the backToHome
                setTimeout(function () {
                    backToHome = !!value;
                }, 0);
            }
        });
        Object.defineProperty(beyond, 'backToHome', {
            'get': function () {
                return beyond.navigation.backToHome;
            },
            'set': function (value) {
                beyond.navigation.backToHome = value;
            }
        });
    
        function back() {
            if (!backToHome && history.length) {
                history.back();
            }
            else {
                backToHome = false;
                beyond.navigate('/');
            }
        }
    
        this.back = back;
        beyond.back = back;
    
    }
996197
function(file) {
    var data = file.data = parse(file.relative, {locales: options.locales});

    // data.locale
    data.locale || (data.locale = options.defaultLocale);

    // data.document
    if (~(options.dataExtensions || []).indexOf(data.extname)) {
      data.document = 'data';
    } else if (fm.test(file.contents.toString())) {
      data.document = 'text';
    } else {
      data.document = false;
    }

    // data.filepaths
    data.filepaths = [];
    data.filepaths.push(data.locale === options.defaultLocale ? null : data.locale);
    data.filepaths.push.apply(data.filepaths, data.dirnames);
    if (data.document) {
      data.filepaths.push(data.index ? null : data.slug);
      data.filepaths.push('index.html');
    } else {
      data.filepaths.push(data.slug + '.' + data.extname);
    }
    data.filepaths = data.filepaths.filter(function(x) { return x });

    // data.filepath
    data.filepath = path.join.apply(path, data.filepaths);

    // file.path
    file.path = path.join(file.base, data.filepath);

    return file;
  }
764761
function(file) {
      var type = file.type.toLowerCase(),
        sources = file.sources;

      $.each(sources, function(tmpSource) {
        if (_support[type][tmpSource]) {
          file = file.sources[tmpSource];
          file.type = type.toUpperCase();
          return false;
        }
      });
      if (file.source) {
        return file;
      } else {
        return false;
      }
    }
1132355
function loadTemplate (file, options) {
    // return cached template if caching enabled
    if (options.cache && GLOBAL.templates[file]) {
        return Promise.resolve(GLOBAL.templates[file])
    }
    // store promise to load template
    var promise = GLOBAL.templates[file] = fsp.readFile(file, 'utf8')
    // compile template file
    .then(data => {
        // replace entry in template cache with template function
        var template = GLOBAL.templates[file] = handlebars.compile(data)
        // resolve with template
        return template
    })
    // return promise
    return promise
}
319398
function(file) {
      var deferred = $q.defer();

      var reader = angular.extend(new FileReader(), {
        onload: function(e) {
          deferred.resolve(e.target.result);
          if (!$rootScope.$$phase) $rootScope.$apply();
        },
        onerror: function(e) {
          deferred.reject(e);
          if (!$rootScope.$$phase) $rootScope.$apply();
        },
        onabort: function(e) {
          deferred.reject(e);
          if (!$rootScope.$$phase) $rootScope.$apply();
        }
        // onprogress: Gee, it'd be great to get some progress support from $q...
      });
      reader.readAsDataURL(file);

      return angular.extend(deferred.promise, {
        abort: function() { reader.abort(); }
      });
    }
101252
def got_functions(file)
      arch = architecture(file)
      objdump_bin = find_objdump(arch)
      `#{::Shellwords.join([objdump_bin, '-T', file])} | grep -iPo 'GLIBC_.+?\\s+\\K.*'`.split
    end
565894
public Map<String, Object> processFile(File file) {
        ParserEngine engine = Engines.get(FileUtil.fileExt(file));
        if (engine==null) {
            LOGGER.error("Unable to find suitable markup engine for {}",file);
            return null;
        }

        return engine.parse(config, file);
    }
960114
function (file) {
        if (!this.ignore(file)) {
            file = this.map(file);
            file = utils.normalize(file);
            return file;
        }
    }
1319305
function(file, opts) {
	if (util.isObject(file) || util.isArray(file)) {
		return file;
	}

	var options = util.extend({
		asText: false, // true, false, 'pretty'
		javascript: false, // true, false
		scope: '', // directory to look for initial file
		variables: {
			// contains a key->value object with variables to @extends
		}
	}, opts);

	file = util.template(file, options.variables);

	/*****************************************************************************
	*  Initialize
	*****************************************************************************/

	var file_path;

	// If the file path is absolute use it
	// If not then prepend the current scope of the previous file.
	if (path.resolve(file) === path.normalize(file)) {
		file_path = path.normalize(file);
	}
	else {
		file_path = path.normalize(
			options.scope ? options.scope + '/' + file : file
		);
	}
	var class_json = parseFile(file_path, options);

	// Stores JSON objects of files that have to be merged together:
	// ["a", "b"]
	var file_list = util.isArray(class_json[indicators.EXTENDS]) ?
		class_json[indicators.EXTENDS] :
		class_json[indicators.EXTENDS] != null ?
			[ class_json[indicators.EXTENDS] ] :
			[];

	// Delete @extends from base_json to avoid infinitive recursion
	delete class_json[indicators.EXTENDS];

	// Push class_json to the path list:
	file_list.push(class_json);
	/*****************************************************************************
	*  Merge file by file
	*****************************************************************************/

	// default config for each file required:
	// set asText = false so we get an object returned
	// set scope = file's directory so there can be relative references
	var json_config = util.defaults({
		asText: false,
		scope: path.dirname(file_path),

		// _as is a hack so that we know its we are calling the function recursive
		_as: ANTI_SANITIZER
	}, options);

	// super_json is our output, start by containing first file in array
	var super_json = fromFile(file_list.shift(), json_config);

	// TODO: Figure out when to sanitize super_json hopefully we don't have to
	//   santize all returns. I'm not sure about this, and I'm not sure if we
	//   can even sanitize super_json when we return it.
	//   Is super_json used by anyone recursively?

	while (file_list.length) {
		var json = fromFile(file_list.shift(), json_config);

		merge(super_json, json);
	}

	// If this file is called from the outside eg json_merger.from...
	//   File('file_which_doesnt_extends_another_file.json')
	//   we need to sanitize the file and remove all indicators
	if (options._as != ANTI_SANITIZER) {
		super_json = util.sanitizeValue(super_json);
	}

	/*****************************************************************************
	*  Return super_json
	*****************************************************************************/
	if (options.asText) {
		return stringify(super_json, options);
	}
	else {
		return super_json;
	}
}
1007624
function getComponents(file) {
    var relativePath = file.relative;
    var pathParts = Path.dirname(relativePath).split(Path.sep);
    return {
        ext: Path.extname(relativePath).substr(1), // strip dot
        filename: Path.basename(relativePath),
        packageName: pathParts[0]
    };
}
180348
function(file) {
      var defer = new $.Deferred(),
        size = file.size,
        $image = $('<img>'),
        onImageLoaded = function() {

          log('File Loaded:' + src);
          _bytesLoaded += size;
          onElementLoaded(file, this);
          // removing the file from the array
          _files[_currentSegment].splice(0, 1);
          updatePercentage();
          defer.resolve();

        },
        onImageError = function() {
          log('File load error : ' + src);
          _bytesLoaded += size;
          // removing the file from the array
          _files[_currentSegment].splice(0, 1);
          updatePercentage();
          defer.resolve();
        },
        src;

      // load the svg or the fallback image
      if (file.source.toString() === '[object Object]') {
        if (file.source.svg && _support.svg) {
          src = file.source.svg;
        } else if (file.source.fallback) {
          src = file.source.fallback;
        }
      } else {
        src = file.source;
      }

      $image.on('load', onImageLoaded);
      $image.on('error', onImageError);
      $image.attr('src', src);

      // preventing a memory leak
      $image = null;

      return defer.promise();
    }