git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52222 954022d7-b5bf-4e40-9824-e11837661b57

This commit is contained in:
Sergey.Kirillov
2013-11-19 15:46:07 +00:00
committed by Alexander Trofimov
parent 3779f31d9e
commit 255aae9fb4
193 changed files with 65 additions and 65 deletions

View File

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="HTMLReaderTest"
ProjectGUID="{C9CCE28F-28AC-47BC-ACE8-1919AA22627D}"
RootNamespace="HTMLReaderTest"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="true"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{4D78DBB6-81D3-4CE0-89CD-8AF12EF36DB3}"
RelativePathToProject=".\AVSOfficeHtmlFile\prj\AVSOfficeHtmlFile2005.vcproj"
/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\test.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,104 @@
#include "../HTMLReaderLib/LiteHTMLReader.h"
//#include <sys\types.h>
#include <sys\stat.h>
#include "atlbase.h"
#include "atlstr.h"
int FileSize (const char * szFileName)
{
struct stat fileStat;
int err = stat( szFileName, &fileStat );
if (0 != err)
return 0;
return fileStat.st_size;
}
CLiteHTMLElemAttr::CNamedColors CLiteHTMLElemAttr::_namedColors(166 /* block size */);
class CHTMLReaderTest: public ILiteHTMLReaderEvents
{
protected:
CLiteHTMLReader m_oReader;
public:
CHTMLReaderTest ()
{
m_oReader.setEventHandler (this);
}
UINT Read (LPCTSTR aHtml)
{
return m_oReader.Read (aHtml);
}
UINT ReadFile (HANDLE aFile)
{
return m_oReader.ReadFile (aFile);
}
public:
virtual void BeginParse(DWORD dwAppData, bool &bAbort)
{
ATLTRACE2 (_T("BeginParse\n"));
bAbort = false;
}
virtual void StartTag(CLiteHTMLTag *pTag, DWORD dwAppData, bool &bAbort)
{
bAbort = false;
ATLTRACE2 (_T("StartTag: %s\n"), pTag->getTagName());
}
virtual void EndTag(CLiteHTMLTag *pTag, DWORD dwAppData, bool &bAbort)
{
bAbort = false;
ATLTRACE2 (_T("EndTag: %s\n"), pTag->getTagName());
}
virtual void Characters(const CString &rText, DWORD dwAppData, bool &bAbort)
{
bAbort = false;
ATLTRACE2 (_T("Characters: %s\n"), rText);
}
virtual void Comment(const CString &rComment, DWORD dwAppData, bool &bAbort)
{
bAbort = false;
ATLTRACE2 (_T("Comment: %s\n"), rComment);
}
virtual void EndParse(DWORD dwAppData, bool bIsAborted)
{
ATLTRACE2 (_T("EndParse\n"));
}
};
int main (int argc, char *argv[ ], char *envp[ ])
{
CHTMLReaderTest oTest;
if (argc < 2)
{
ATLTRACE2 (_T("no parameters found!"));
return -1;
}
// remove "" from begin and end of string
CStringA sFileNameA = argv[1];
CString sFileName;
sFileName = sFileNameA;
HANDLE hFile = ::CreateFile (sFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (INVALID_HANDLE_VALUE == hFile)
{
ATLTRACE2 (_T("Can't open file!! (last error: 0x%x)"), GetLastError());
return -2;
}
UINT uiOpened = oTest.ReadFile (hFile);
CloseHandle (hFile);
return 0;
}