XRootD
Loading...
Searching...
No Matches
Macaroons Namespace Reference

Classes

class  Authz
 
class  Handler
 

Enumerations

enum  LogMask {
  Debug = 0x01 ,
  Info = 0x02 ,
  Warning = 0x04 ,
  Error = 0x08 ,
  All = 0xff
}
 

Functions

std::string NormalizeSlashes (const std::string &)
 

Enumeration Type Documentation

◆ LogMask

Enumerator
Debug 
Info 
Warning 
Error 
All 

Definition at line 15 of file XrdMacaroonsHandler.hh.

15 {
16 Debug = 0x01,
17 Info = 0x02,
18 Warning = 0x04,
19 Error = 0x08,
20 All = 0xff
21};

Function Documentation

◆ NormalizeSlashes()

std::string Macaroons::NormalizeSlashes ( const std::string & input)

Definition at line 54 of file XrdMacaroonsHandler.cc.

55{
56 std::string output;
57 // In most cases, the output should be "about as large"
58 // as the input
59 output.reserve(input.size());
60 char prior_chr = '\0';
61 size_t output_idx = 0;
62 for (size_t idx = 0; idx < input.size(); idx++) {
63 char chr = input[idx];
64 if (prior_chr == '/' && chr == '/') {
65 output_idx++;
66 continue;
67 }
68 output += input[output_idx];
69 prior_chr = chr;
70 output_idx++;
71 }
72 return output;
73}