📄 filesections.h
字号:
#ifndef FILESECTIONS_H
#define FILESECTIONS_H
#include "utils/ExpArr.hpp"
#include "utils/StringBuffer.h"
// Read a text file, looking for sections:
// ##%% ASectionName %%##
// text to read here
// ##%% end %%##
class FileSections {
public:
FileSections( const char *path=NULL );
~FileSections( );
bool AddFile( const char *path );
bool SubstSection( const char *name, const StrBuf &sb_fr, StrBuf &out );
StrBuf& GetSection( const char *name, bool &b_ok ){
int ix = m_names.FindIndexOf(name);
if( ix<0 ){
static StrBuf sb_dummy;
b_ok = false;
return sb_dummy;
}
b_ok = true;
return *m_sections[ix];
}
protected:
StrBuf m_names;
ExpArrP<StrBuf*> m_sections;
};
#endif // FILESECTIONS_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -