SmartFolder
1.0
SmartFolder is a way to search files on your system and group the results. The program will interpret search queries and create a folder with symbolic links to all the found matches.
|
Source file that contains the implementation of our Parser. More...
#include "Parser.h"
Functions | |
int | isValidPath (const char *path) |
struct timespec * | getTimeSpec (const char *date) |
searchType | getSearchType (const char *param, const char *arg) |
int | isBooleanOp (const char *word) |
int | isValidSearch (searchType st, const char *arg) |
int | evaluateAndSearch (const char **expression, int exprLen, char *folder, List **result) |
const void * | prepareArgument (searchType st, const char *arg) |
int | getSize (const char *sizeAsString) |
const char * | trimArgument (searchType st, const char *arg) |
Source file that contains the implementation of our Parser.
int evaluateAndSearch | ( | const char ** | expression, |
int | exprLen, | ||
char * | folder, | ||
List ** | result | ||
) |
Evaluates an expression and searches for matching files
expression | The expression to search with (as an array of terms) |
exprLen | The length of the expression |
folder | The folder to search from |
result | A List to put the results of the search in |
searchType getSearchType | ( | const char * | param, |
const char * | arg | ||
) |
Converts a search word to a searchType
param | the search word |
arg | the parameter linked to the search word |
int getSize | ( | const char * | sizeAsString | ) |
Converts a size with its Unit suffix (K, M, G, T) to the correct size
sizeAsString | The size with its suffix |
struct timespec* getTimeSpec | ( | const char * | date | ) |
Function to convert a date in YYYY-MM-DD format to a timespec
date | The date as a String in the format YYYY-MM-DD |
int isBooleanOp | ( | const char * | word | ) |
Checks if a word is a boolean operator
word | the word to check |
int isValidPath | ( | const char * | path | ) |
Function to check if a path is valid
path | The path we want to check |
int isValidSearch | ( | searchType | st, |
const char * | arg | ||
) |
Checks if a searchType has proper argument linked to it
st | The search type |
arg | The argument |
const void* prepareArgument | ( | searchType | st, |
const char * | arg | ||
) |
Function that returns a generic pointer to an argument for a search of a certain type It will actually return the pointer for the correct type depending on the search
st | The type of search |
arg | The argument as a string |
const char* trimArgument | ( | searchType | st, |
const char * | arg | ||
) |
Removes the + or - before a search argument if necessary
st | searchType |
arg | argument to trim |