/*
//
//   ADOBE SYSTEMS INCORPORATED
//   Copyright (C) 2000-2003 Adobe Systems Incorporated
//   All rights reserved.
//
//   NOTICE: Adobe permits you to use, modify, and distribute this file
//   in accordance with the terms of the Adobe license agreement
//   accompanying it. If you have received this file from a source other
//   than Adobe, then your use, modification, or distribution of it
//   requires the prior written permission of Adobe.
//
*/
#ifndef _WatchFolder_h_
#define _WatchFolder_h_

#include "ASCalls.h"
#include "PDCalls.h"
#include <vector>
#include <string>
#include "SDKThreads.h"
class  WatchFolder;

typedef   struct  ThreadArgs  {
                char  *tName;
                WatchFolder  *  watchFolder;
}  ThreadArgs;

/* Line endings - lineend is defined so that it is correct for Mac, Win, UNIX */
#ifdef WIN_ENV
#define lineend "\r\n"
#elif MAC_ENV
#define lineend "\r"
#else
#define lineend "\n"
#endif

using namespace  std;

class  WatchFolder  {
public :
                WatchFolder(ASPathName  folderToWatch,  ASInt32  numFiles);
                virtual   ~WatchFolder();
                const   char  *  getFile();


                void   watchFolder();

private :
                void   addFile(ASPathName  newPath);
                ASTimeRec   folderModDate;
                ASPathName   folder;
               vector<char *>  dirContents;
               vector<char *>  doneFiles;
                CSMutex   watchFolderMutex;

                string   folderName;

public :
                ASInt32   numToReturn;
};

#endif