⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesections.h

📁 The library provides supports for run-time loaded plugin classes in C++
💻 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 + -