Example #1
0
bool FSNode::operator<(const FSNode& node) const {
    // Directories come before files, i.e., are "lower".
    if (isDirectory() != node.isDirectory())
        return isDirectory();

    // If both nodes are of the same type (two files or two dirs),
    // then sort by name, ignoring case.
    return getDisplayName().compareToIgnoreCase(node.getDisplayName()) < 0;
}
Example #2
0
bool FSNode::operator<(const FSNode& node) const {
	if (isDirectory() != node.isDirectory())
		return isDirectory();

	return getDisplayName().compareToIgnoreCase(node.getDisplayName()) < 0;
}