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 53 of file XrdMacaroonsHandler.cc.

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