Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Linq-To-XML Style of Node Creation for C++

, 7 Jun 2012
Linq-To-XML Node Creation for Native C++
elmax-84498.zip
BuildProcessTemplates
ElmaxNet
Properties
Elmax
Elmax.vcxproj.user
StringUtils
TestNativeElmax
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax
Properties
TestNetElmax.csproj.user
TryoutNet
Properties
Settings.settings
Tryout
res
Tryout.ico
Tryout.vcxproj.user
elmax-ver083.zip
Elmax.vcxproj.user
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
Settings.settings
Tryout.ico
Tryout.vcxproj.user
elmax-ver084.zip
Elmax.vcxproj.user
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
Settings.settings
Tryout.ico
Tryout.vcxproj.user
elmax-ver085.zip
Elmax.vcxproj.user
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
Settings.settings
Tryout.ico
Tryout.vcxproj.user
elmax-ver086.zip
Elmax.vcxproj.user
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
Settings.settings
Tryout.ico
Tryout.vcxproj.user
elmax-ver087.zip
Elmax.vcxproj.user
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
Settings.settings
Tryout.ico
Tryout.vcxproj.user
Elmax-ver089.zip
Elmax-ver089
Elmax.vsmdi
Elmax
Elmax.vcxproj.user
StringUtils
ElmaxNet
Properties
Local.testsettings
TestNativeElmax
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax
Properties
TestNetElmax.csproj.user
TraceAndTestImpact.testsettings
Tryout
res
Tryout.ico
Tryout.vcxproj.user
TryoutNet
Properties
Settings.settings
ElmaxSrcVer082.zip
Elmax.vcxproj.user
app.ico
TestNativeElmax.vcxproj.user
TestNetElmax.csproj.user
Settings.settings
Tryout.ico
Tryout.vcxproj.user
#pragma once


#include "DataType.h"
#include "DataTypeRef.h"
#include "SplitStrategy.h"

namespace Elmax
{

class StrUtil
{
public:
	StrUtil(void);
	~StrUtil(void);

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4, 
		DataType D5 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4, 
		DataType D5, 
		DataType D6 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4, 
		DataType D5, 
		DataType D6, 
		DataType D7 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4, 
		DataType D5, 
		DataType D6, 
		DataType D7, 
		DataType D8 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4, 
		DataType D5, 
		DataType D6, 
		DataType D7, 
		DataType D8, 
		DataType D9 );

	static std::wstring Format( 
		const wchar_t* fmt, 
		DataType D1, 
		DataType D2, 
		DataType D3, 
		DataType D4, 
		DataType D5, 
		DataType D6, 
		DataType D7, 
		DataType D8, 
		DataType D9, 
		DataType D10 );
private:
	static std::wstring Replace( 
		std::wstring& fmtstr, 
		std::vector<std::wstring>& vs );

	static std::wstring Anchor( int i );
public:
	void SetSplitStrategy( ISplitStrategy* pSplitStrategy )
	{
		m_pSplitStrategy = pSplitStrategy;
	}

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4,
		DataTypeRef D5 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4,
		DataTypeRef D5,
		DataTypeRef D6 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4,
		DataTypeRef D5,
		DataTypeRef D6,
		DataTypeRef D7 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4,
		DataTypeRef D5,
		DataTypeRef D6,
		DataTypeRef D7,
		DataTypeRef D8 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4,
		DataTypeRef D5,
		DataTypeRef D6,
		DataTypeRef D7,
		DataTypeRef D8,
		DataTypeRef D9 );

	size_t Split( 
		const std::wstring& StrToExtract,
		DataTypeRef D1,
		DataTypeRef D2,
		DataTypeRef D3,
		DataTypeRef D4,
		DataTypeRef D5,
		DataTypeRef D6,
		DataTypeRef D7,
		DataTypeRef D8,
		DataTypeRef D9,
		DataTypeRef D10 );

private:
	ISplitStrategy* m_pSplitStrategy;

};

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

About the Author

SV Wong
Software Developer
Singapore Singapore

Currently into areas like 3D graphics and application security. Hoping to revisit the cryptography and design pattern topics if time permits.


| Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 7 Jun 2012
Article Copyright 2011 by SV Wong
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid