xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdPfcPrint.hh
Go to the documentation of this file.
1 #ifndef __XRDFILECACHE_PRINT_HH__
2 #define __XRDFILECACHE_PRINT_HH__
3 //----------------------------------------------------------------------------------
4 // Copyright (c) 2014 by Board of Trustees of the Leland Stanford, Jr., University
5 // Author: Alja Mrak-Tadel
6 //----------------------------------------------------------------------------------
7 // XRootD is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // XRootD is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19 //----------------------------------------------------------------------------------
20 
21 #include "XrdOuc/XrdOucEnv.hh"
22 
23 class XrdOss;
24 class XrdOssDF;
25 
26 namespace XrdPfc
27 {
28 class Print {
29 public:
30  //------------------------------------------------------------------------
32  //------------------------------------------------------------------------
33  Print(XrdOss* oss, char u, bool v, bool j, int i, const char* path);
34 
35 private:
40  char m_unit[3];
41  bool m_verbose;
42  bool m_json;
43  int m_indent;
44  const char* m_ossUser;
45 
46  //---------------------------------------------------------------------
48  //---------------------------------------------------------------------
49  bool isInfoFile(const char* path);
50 
51  //---------------------------------------------------------------------
53  //---------------------------------------------------------------------
54  void printFileJson(const std::string& path);
55 
56  //---------------------------------------------------------------------
58  //---------------------------------------------------------------------
59  void printFile(const std::string& path);
60 
61  //---------------------------------------------------------------------
63  //---------------------------------------------------------------------
64  void printDir(XrdOssDF* iOssDF, const std::string& path);
65 };
66 }
67 
68 #endif
int m_unit_shift
env used by file system
Definition: XrdPfcPrint.hh:38
bool m_verbose
unit for regular printout (not JSON)
Definition: XrdPfcPrint.hh:41
void printFileJson(const std::string &path)
Print information in meta-data file in json format.
Definition: XrdOucEnv.hh:41
bool isInfoFile(const char *path)
file system user
XrdOss * m_oss
Definition: XrdPfcPrint.hh:36
bool m_json
print each block
Definition: XrdPfcPrint.hh:42
void printFile(const std::string &path)
Print information in meta-data file.
const char * m_ossUser
indent for json dump
Definition: XrdPfcPrint.hh:44
XrdOucEnv m_env
file system
Definition: XrdPfcPrint.hh:37
Definition: XrdPfcPrint.hh:28
Definition: XrdOss.hh:497
Definition: XrdOss.hh:62
int m_indent
print in json format
Definition: XrdPfcPrint.hh:43
int m_unit_width
bitshift for byte-size fields
Definition: XrdPfcPrint.hh:39
Print(XrdOss *oss, char u, bool v, bool j, int i, const char *path)
Constructor.
char m_unit[3]
width of byte-size fields
Definition: XrdPfcPrint.hh:40
void printDir(XrdOssDF *iOssDF, const std::string &path)
Print information in meta-data file recursivly.