Exemple #1
0
PathList Path::children() const
{
  PathList children;

#if WENDY_SYSTEM_WIN32
  WIN32_FIND_DATA data;
  HANDLE search;

  search = FindFirstFile(m_string.c_str(), &data);
  if (search == INVALID_HANDLE_VALUE)
    return PathList();

  do
  {
    children.push_back(operator + (data.cFileName));
  }
  while (FindNextFile(search, &data));

  FindClose(search);
#else
  DIR* stream;
  dirent* entry;

  stream = opendir(m_string.c_str());
  if (!stream)
    return PathList();

  while ((entry = readdir(stream)))
    children.push_back(operator + (entry->d_name));

  closedir(stream);
#endif

  return children;
}
Exemple #2
0
/*	FillPathMenu(MenuHandle theMenu, char *match, char *options, int afterItem)

	Puts names of Igor paths into theMenu.
	match and options are as for the Igor PathList() function:
		match = "*" for all paths
		options = "" for all paths
	
	afterItem is as for FillMenu, described above.
	
	In contrast to Macintosh menu manager routines, this routine does not
	treat any characters as meta-characters.
	
	NOTE: You should not call this routine to update the contents of an existing
		  dialog popup menu item. Use FillPathPopMenu instead.
	
	Thread Safety: FillPathMenu is not thread-safe.
*/
int
FillPathMenu(MenuHandle theMenu, const char *match, const char *options, int afterItem)
{
	Handle listHandle;
	int result;	
	
	if (!CheckRunningInMainThread("FillPathMenu"))
		return NOT_IN_THREADSAFE;
	
	listHandle = NewHandle(0L);
	result = PathList(listHandle, match, ";", options);
	FillMenuNoMeta(theMenu, *listHandle, (int)GetHandleSize(listHandle), afterItem);
	DisposeHandle(listHandle);
	
	return(result);
}
Exemple #3
0
#define RELAX_BEGIN_COPY {if((isCopying) == (true)) return;\
                                    (isCopying) = (true);\
                                    emit (copyStarted());}

#define RELAX_END_COPY {(isCopying) = (false);\
                            emit (finalFinish());\
                            emit (checkUndo());}


void copyFiles(CopyPair &aPair); /*copies the file contained in aPair.first to aPair.second and then removes
                                         the file in aPair.first if copy was successful*/

/**
  * static data member definitions
  */
PathList RelaxEngine::paths = PathList();
bool RelaxEngine::isCopying = false;
bool RelaxEngine::pendingRefresh = false;
bool RelaxEngine::liveMode = true;
bool RelaxEngine::scanNested = false;
WatcherThread* RelaxEngine::watcher = new WatcherThread();
QFutureWatcher<void>* RelaxEngine::future = new QFutureWatcher<void>();

/**
  * static auxilliary function prototypes
  */

/**
  * @abstract get_nested_files() returns a list of files in a folder an its sub-directories
  *
  * @param path contains the path to the folder to scan for files