StoreFileSystem.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 92 Storage File System */
10 
11 #include "squid.h"
12 #include "StoreFileSystem.h"
13 
14 std::vector<StoreFileSystem*> *StoreFileSystem::_FileSystems = nullptr;
15 
16 void
18 {
19  iterator i = GetFileSystems().begin();
20 
21  while (i != GetFileSystems().end()) {
22  assert(strcmp((*i)->type(), instance.type()) != 0);
23  ++i;
24  }
25 
26  GetFileSystems().push_back (&instance);
27 }
28 
29 std::vector<StoreFileSystem *> const &
31 {
32  return GetFileSystems();
33 }
34 
35 std::vector<StoreFileSystem*> &
37 {
38  if (!_FileSystems)
39  _FileSystems = new std::vector<StoreFileSystem *>;
40 
41  return *_FileSystems;
42 }
43 
45 StoreFileSystem::FindByType(const char *type)
46 {
47  for (const auto fs: FileSystems()) {
48  if (strcasecmp(type, fs->type()) == 0)
49  return fs;
50  }
51  return nullptr;
52 }
53 
static std::vector< StoreFileSystem * > * _FileSystems
static void FsAdd(StoreFileSystem &)
static StoreFileSystem * FindByType(const char *type)
#define assert(EX)
Definition: assert.h:17
static std::vector< StoreFileSystem * > & GetFileSystems()
std::vector< StoreFileSystem * >::iterator iterator
virtual const char * type() const =0
static const std::vector< StoreFileSystem * > & FileSystems()

 

Introduction

Documentation

Support

Miscellaneous