1;(function() 2{ 3 // CommonJS 4 SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 5 6 function Brush() 7 { 8 // Copyright 2006 Shin, YoungJin 9 10 var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + 11 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + 12 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + 13 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + 14 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + 15 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + 16 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + 17 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + 18 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + 19 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + 20 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + 21 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + 22 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + 23 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + 24 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + 25 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + 26 'char char16_t char32_t bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + 27 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + 28 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + 29 '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + 30 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + 31 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + 32 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + 33 'va_list wchar_t wctrans_t wctype_t wint_t signed'; 34 35 var keywords = 'alignas alignof auto break case catch class const constexpr decltype __finally __exception __try ' + 36 'const_cast continue private public protected __declspec ' + 37 'default delete deprecated dllexport dllimport do dynamic_cast ' + 38 'else enum explicit extern if for friend goto inline ' + 39 'mutable naked namespace new noinline noreturn nothrow noexcept nullptr ' + 40 'ref register reinterpret_cast return selectany ' + 41 'sizeof static static_cast static_assert struct switch template this ' + 42 'thread thread_local throw true false try typedef typeid typename union ' + 43 'using uuid virtual void volatile whcar_t while'; 44 45 var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + 46 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + 47 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + 48 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + 49 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + 50 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + 51 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + 52 'fwrite getc getchar gets perror printf putc putchar puts remove ' + 53 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + 54 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + 55 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + 56 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + 57 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + 58 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + 59 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + 60 'clock ctime difftime gmtime localtime mktime strftime time'; 61 62 this.regexList = [ 63 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 64 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 65 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 66 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 67 { regex: /^ *#.*/gm, css: 'preprocessor' }, 68 { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, 69 { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, 70 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } 71 ]; 72 }; 73 74 Brush.prototype = new SyntaxHighlighter.Highlighter(); 75 Brush.aliases = ['cpp', 'cc', 'c++', 'c', 'h', 'hpp', 'h++']; 76 77 SyntaxHighlighter.brushes.Cpp = Brush; 78 79 // CommonJS 80 typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 81})(); 82