blob: c7396f4a7af0796f024a23165de7916acb934fba [file] [log] [blame]
Alexander Afanasyev0a30a0c2013-01-29 17:25:42 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012-2013 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 * Zhenkai Zhu <zhenkai@cs.ucla.edu>
20 */
21
22#ifndef FILE_STATE_H
23#define FILE_STATE_H
24
25#include "file-item.pb.h"
26#include "hash-helper.h"
27
28#include <boost/tuple/tuple.hpp>
29#include <boost/exception/all.hpp>
30
31#include <list>
32
33typedef std::list<FileItem> FileItems;
34typedef boost::shared_ptr<FileItem> FileItemPtr;
35typedef boost::shared_ptr<FileItems> FileItemsPtr;
36
37
38class FileState
39{
40public:
41 virtual FileItemPtr
42 LookupFile (const std::string &filename) = 0;
43
44 virtual FileItemsPtr
45 LookupFilesForHash (const Hash &hash) = 0;
46
47 virtual FileItemsPtr
48 LookupFilesInFolder (const std::string &folder) = 0;
49
50 virtual FileItemsPtr
51 LookupFilesInFolderRecursively (const std::string &folder) = 0;
52};
53
54namespace Error {
55struct FileState : virtual boost::exception, virtual std::exception { };
56}
57
58
59#endif // ACTION_LOG_H