MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / GetNewRotationName

Method GetNewRotationName

source/fdb.cpp:113–146  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

111}
112//---------------------------------------------------------------------------
113String TStorageFile::GetNewRotationName(void)
114{
115 String f = rotation_name;
116 try
117 {
118 for(int i=1, l=f.Length(); i<=l; i++)
119 {
120 if( f[i] == '{' )
121 {
122 // find '}'
123 for(int j=i+1; j<=l; j++)
124 {
125 if( f[j] == '}' )
126 {
127 String mask = f.SubString(i+1, j-i-1);
128 String r = FormatDateTime(mask, Now());
129 f.Delete(i, j-i+1);
130 f.Insert(r, i);
131 l = f.Length();
132 i += r.Length() - 1;
133 break;
134 }
135 }
136 }
137 }
138 }
139 catch(...)
140 {
141 WriteToLogError("GetNewRotationName error");
142 }
143 if( f.Length() > 0 && ExtractFilePath(f).Length() == 0 )
144 return WorkDir + f;
145 return f;
146}
147//---------------------------------------------------------------------------
148bool TStorageFile::IsNeedRenameAfterRotate(void)
149{

Callers

nothing calls this directly

Calls 3

WriteToLogErrorFunction · 0.85
DeleteMethod · 0.80
InsertMethod · 0.80

Tested by

no test coverage detected