blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
51859fecf58d9577e81ffac69277eaa581645451
b1df6b7fd6ec08a011ffcd6d07a7d42915c61e15
/project/source/game/GameComponent.h
f61c16e9b2b8f7a8b44961d9213ae545aa2d1fdd
[ "MIT" ]
permissive
Shdorsh/carpg
dbca0277d3182ce4852e21826e05f423a5d7dd6f
376130a1ed410116fc8a607601b327eae7dca383
refs/heads/devel
2022-06-17T04:01:27.682849
2018-12-01T21:23:58
2018-12-01T21:23:58
159,889,860
0
0
MIT
2022-06-02T07:12:48
2018-11-30T23:32:57
C++
UTF-8
C++
false
false
326
h
#pragma once //----------------------------------------------------------------------------- class GameComponent { public: virtual ~GameComponent() {} virtual void Prepare() {} virtual void InitOnce() {} virtual void LoadLanguage() {} virtual void LoadData() {} virtual void PostInit() {} virtual void Cleanup() {} };
[ "noreply@github.com" ]
noreply@github.com
5fe76e1826e03fc2a1a643aa48adc537d721003c
9f8245ba25bf794d176967a69dc18ccb92e814d5
/Leetcode1365.cpp
45b171d49f487a09663f0a2b80bc7a501ab53e1e
[ "MIT" ]
permissive
Biswajee/Codestore
80b86b9815cfd1d493105deec8512bc209f545d6
2428522b2af668d3797b98b57fc37419828c20b2
refs/heads/master
2023-07-04T04:18:22.242520
2021-08-07T15:51:05
2021-08-07T15:51:05
163,070,131
0
0
null
null
null
null
UTF-8
C++
false
false
417
cpp
class Solution { public: vector<int> smallerNumbersThanCurrent(vector<int>& nums) { vector<int> v = nums; vector<int> res; map<int, int> mp; sort(v.begin(),v.end()); for(int i=0; i<v.size(); i++) { if(!mp[v[i]]) mp[v[i]] = i+1; } for(int i=0; i<nums.size(); i++) { res.push_back(mp[nums[i]]-1); } return res; } };
[ "roy.biswajeet161@gmail.com" ]
roy.biswajeet161@gmail.com
fb28b57084fe6b7a76808a38489824f209672f04
1ab8e3c77ac32980b397fe3cd9b4f3b2b2a14a8c
/TcpCommands/system/getAllTcpCommands.cpp
c260cf2c156cd413f843a5c855175cad3adf01b1
[]
no_license
dbgtmaster/sepbackupmonitor-server
7250daebd8eb89aebf7f7723de857af3d7b6c6f4
da71b0de68cf0c14d4c2dc3fb48d9a24ae51c10c
refs/heads/master
2021-01-09T20:26:40.093660
2017-01-12T09:06:27
2017-01-12T09:06:27
61,314,757
0
0
null
null
null
null
UTF-8
C++
false
false
1,048
cpp
#include "TcpCommands/system/getAllTcpCommands.h" #include "Database/Database.h" #include "Database/DatabaseQuery.h" #include "Logger/Logger.h" TcpCommand_system_getAllTcpCommands::TcpCommand_system_getAllTcpCommands() : TcpAbstractCommand() { } /** * Führt den eigentlichen Tcp- Befehl aus... * Lesen: _dataStreamRead >> var; * Schreiben: _dataStreamWrite << var; * Socket close: _readSocket->close(); */ QVariant TcpCommand_system_getAllTcpCommands::exec() { DatabaseQuery q = _db->query("SELECT id, group_name, action_name, system_group_id FROM tcp_actions"); while(q.next()) { _streamWrite( quint32( q.row("id").toInt() ) ); // Id des Kommandos _streamWrite( q.row("group_name").toByteArray() ); // Gruppenzuordnung des Kommandos _streamWrite( q.row("action_name").toByteArray() ); // Kommandoname _streamWrite( quint32( q.row("system_group_id").toInt() ) ); // Fehler Systemgruppe das Kommando zugeordnet ist } return QVariant(); }
[ "root@siedl.net" ]
root@siedl.net
54e52396f2e7a0eabf770fba49882a46f76fc621
d73eb9e6b9450f5456d92c710c457fb36bbe8d59
/cdcAnim/AnimNodes/AnimEmptyFragmentNode.h
b6d6513c3fca392f7bbeb39a9744cf4b8fdf11d7
[]
no_license
rrika/cdcEngineDXHR
110cb9314f242e0cfe07c51d439da1045aec78a0
ff312d19663ca1f68881b46089c4a856c2ced0f5
refs/heads/main
2023-08-31T05:09:34.118694
2023-08-30T23:49:39
2023-08-30T23:49:39
474,729,623
192
7
null
null
null
null
UTF-8
C++
false
false
135
h
#pragma once #include "../AnimPipelineNode.h" namespace cdc { class AnimEmptyFragmentNode : public AnimPipelineNode { // TODO }; }
[ "adam.jensen@si.det.usa" ]
adam.jensen@si.det.usa
9dde9f49d33689d2b910ed52f9c662d30a69fc16
52b2f36c87847abad26e6a25f72b227e37e00717
/Effects11/Binary/SOParser.h
928dc362f4baeca3cb3e1635aecce5caedeb0217
[ "MIT" ]
permissive
nickdarnell/Hierarchical-Z-Buffer
874d56079e7bb0b8381f07ea9e818d9bd8c02d5e
dcd28ea7afbb0bcdd674041e25522c5501704e97
refs/heads/master
2021-01-10T06:22:39.356711
2016-01-01T02:17:52
2016-01-01T02:17:52
48,867,401
15
2
null
null
null
null
UTF-8
C++
false
false
8,758
h
////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2009 Microsoft Corporation. All Rights Reserved. // // File: SOParser.h // Content: D3DX11 Effects Stream Out Decl Parser // ////////////////////////////////////////////////////////////////////////////// #pragma once namespace D3DX11Effects { ////////////////////////////////////////////////////////////////////////// // CSOParser ////////////////////////////////////////////////////////////////////////// class CSOParser { CEffectVector<D3D11_SO_DECLARATION_ENTRY> m_vDecls; // Set of parsed decl entries D3D11_SO_DECLARATION_ENTRY m_newEntry; // Currently parsing entry LPSTR m_SemanticString[D3D11_SO_BUFFER_SLOT_COUNT]; // Copy of strings static const UINT MAX_ERROR_SIZE = 254; char m_pError[ MAX_ERROR_SIZE + 1 ]; // Error buffer public: CSOParser() { ZeroMemory(&m_newEntry, sizeof(m_newEntry)); ZeroMemory(m_SemanticString, sizeof(m_SemanticString)); m_pError[0] = 0; } ~CSOParser() { for( UINT Stream = 0; Stream < D3D11_SO_STREAM_COUNT; Stream++ ) { SAFE_DELETE_ARRAY( m_SemanticString[Stream] ); } } // Parse a single string, assuming stream 0 HRESULT Parse( __in_z LPCSTR pString ) { m_vDecls.Clear(); return Parse( 0, pString ); } // Parse all 4 streams HRESULT Parse( __in_z LPSTR pStreams[D3D11_SO_STREAM_COUNT] ) { HRESULT hr = S_OK; m_vDecls.Clear(); for( UINT iDecl=0; iDecl < D3D11_SO_STREAM_COUNT; ++iDecl ) { hr = Parse( iDecl, pStreams[iDecl] ); if( FAILED(hr) ) { char pStream[16]; StringCchPrintfA( pStream, 16, " in stream %d.", iDecl ); pStream[15] = 0; StringCchCatA( m_pError, MAX_ERROR_SIZE, pStream ); return hr; } } return hr; } // Return resulting declarations D3D11_SO_DECLARATION_ENTRY *GetDeclArray() { return &m_vDecls[0]; } char* GetErrorString() { return m_pError; } UINT GetDeclCount() { return m_vDecls.GetSize(); } // Return resulting buffer strides void GetStrides( UINT strides[4] ) { UINT len = GetDeclCount(); strides[0] = strides[1] = strides[2] = strides[3] = 0; for( UINT i=0; i < len; i++ ) { strides[m_vDecls[i].OutputSlot] += m_vDecls[i].ComponentCount * sizeof(float); } } protected: // Parse a single string "[<slot> :] <semantic>[<index>][.<mask>]; [[<slot> :] <semantic>[<index>][.<mask>][;]]" HRESULT Parse( UINT Stream, __in_z LPCSTR pString ) { HRESULT hr = S_OK; m_pError[0] = 0; if( pString == NULL ) return S_OK; UINT len = (UINT)strlen( pString ); if( len == 0 ) return S_OK; SAFE_DELETE_ARRAY( m_SemanticString[Stream] ); VN( m_SemanticString[Stream] = NEW char[len + 1] ); StringCchCopyA( m_SemanticString[Stream], len + 1, pString ); LPSTR pSemantic = m_SemanticString[Stream]; while( TRUE ) { // Each decl entry is delimited by a semi-colon LPSTR pSemi = strchr( pSemantic, ';' ); // strip leading and trailing spaces LPSTR pEnd; if( pSemi != NULL ) { *pSemi = '\0'; pEnd = pSemi - 1; } else { pEnd = pSemantic + strlen( pSemantic ); } while( isspace( (unsigned char)*pSemantic ) ) pSemantic++; while( pEnd > pSemantic && isspace( (unsigned char)*pEnd ) ) { *pEnd = '\0'; pEnd--; } if( *pSemantic != '\0' ) { VH( AddSemantic( pSemantic ) ); m_newEntry.Stream = Stream; VH( m_vDecls.Add( m_newEntry ) ); } if( pSemi == NULL ) break; pSemantic = pSemi + 1; } lExit: return hr; } // Parse a single decl "[<slot> :] <semantic>[<index>][.<mask>]" HRESULT AddSemantic( __inout_z LPSTR pSemantic ) { HRESULT hr = S_OK; D3DXASSERT( pSemantic ); ZeroMemory( &m_newEntry, sizeof(m_newEntry) ); VH( ConsumeOutputSlot( &pSemantic ) ); VH( ConsumeRegisterMask( pSemantic ) ); VH( ConsumeSemanticIndex( pSemantic ) ); // pSenantic now contains only the SemanticName (all other fields were consumed) if( strcmp( "$SKIP", pSemantic ) != 0 ) { m_newEntry.SemanticName = pSemantic; } lExit: return hr; } // Parse optional mask "[.<mask>]" HRESULT ConsumeRegisterMask( __inout_z LPSTR pSemantic ) { HRESULT hr = S_OK; const char *pFullMask1 = "xyzw"; const char *pFullMask2 = "rgba"; SIZE_T stringLength; SIZE_T startComponent = 0; LPCSTR p; D3DXASSERT( pSemantic ); pSemantic = strchr( pSemantic, '.' ); if( pSemantic == NULL ) { m_newEntry.ComponentCount = 4; return S_OK; } *pSemantic = '\0'; pSemantic++; stringLength = strlen( pSemantic ); p = strstr(pFullMask1, pSemantic ); if( p ) { startComponent = (UINT)( p - pFullMask1 ); } else { p = strstr( pFullMask2, pSemantic ); if( p ) startComponent = (UINT)( p - pFullMask2 ); else { StringCchPrintfA( m_pError, MAX_ERROR_SIZE, "ID3D10Effect::ParseSODecl - invalid mask declaration '%s'", pSemantic ); VH( E_FAIL ); } } if( stringLength == 0 ) stringLength = 4; m_newEntry.StartComponent = (BYTE)startComponent; m_newEntry.ComponentCount = (BYTE)stringLength; lExit: return hr; } // Parse optional output slot "[<slot> :]" HRESULT ConsumeOutputSlot( __deref_inout_z LPSTR* ppSemantic ) { D3DXASSERT( ppSemantic && *ppSemantic ); HRESULT hr = S_OK; LPSTR pColon = strchr( *ppSemantic, ':' ); if( pColon == NULL ) return S_OK; if( pColon == *ppSemantic ) { StringCchCopyA( m_pError, MAX_ERROR_SIZE, "ID3D10Effect::ParseSODecl - Invalid output slot" ); VH( E_FAIL ); } *pColon = '\0'; int outputSlot = atoi( *ppSemantic ); if( outputSlot < 0 || outputSlot > 255 ) { StringCchCopyA( m_pError, MAX_ERROR_SIZE, "ID3D10Effect::ParseSODecl - Invalid output slot" ); VH( E_FAIL ); } m_newEntry.OutputSlot = (BYTE)outputSlot; while( *ppSemantic < pColon ) { if( !isdigit( (unsigned char)**ppSemantic ) ) { StringCchPrintfA( m_pError, MAX_ERROR_SIZE, "ID3D10Effect::ParseSODecl - Non-digit '%c' in output slot", **ppSemantic ); VH( E_FAIL ); } (*ppSemantic)++; } // skip the colon (which is now '\0') (*ppSemantic)++; while( isspace( (unsigned char)**ppSemantic ) ) (*ppSemantic)++; lExit: return hr; } // Parse optional index "[<index>]" HRESULT ConsumeSemanticIndex( __inout_z LPSTR pSemantic ) { D3DXASSERT( pSemantic ); UINT uLen = (UINT)strlen( pSemantic ); // Grab semantic index while( uLen > 0 && isdigit( (unsigned char)pSemantic[uLen - 1] ) ) uLen--; if( isdigit( (unsigned char)pSemantic[uLen] ) ) { m_newEntry.SemanticIndex = atoi( pSemantic + uLen ); pSemantic[uLen] = '\0'; } else { m_newEntry.SemanticIndex = 0; } return S_OK; } }; } // end namespace D3DX11Effects
[ "NickDarnell@gmail.com" ]
NickDarnell@gmail.com
fb0ae779469f2c61ed103bd26f01d3c6512de369
9c67c720f62493adade9c90946951cea020ebc62
/core/RtTypes.cpp
df414f35bd062f1b20f76e3490a9c302f248e8b7
[]
no_license
gapost/rtlab-old
f222505550f201b1fc589effb0cbaf4518e273e5
d9da7711694b4d803f4ed1b0772cb20c2a03fdc5
refs/heads/master
2016-09-05T16:54:34.699367
2014-12-31T07:47:34
2014-12-31T07:47:34
27,383,475
0
0
null
null
null
null
UTF-8
C++
false
false
1,137
cpp
#include "RtTypes.h" #include <QScriptEngine> template <class Container> QScriptValue toScriptValue(QScriptEngine *eng, const Container &cont) { QScriptValue a = eng->newArray(); typename Container::const_iterator begin = cont.begin(); typename Container::const_iterator end = cont.end(); typename Container::const_iterator it; for (it = begin; it != end; ++it) a.setProperty(quint32(it - begin), qScriptValueFromValue(eng, *it)); return a; } template <class Container> void fromScriptValue(const QScriptValue &value, Container &cont) { quint32 len = value.property("length").toUInt32(); for (quint32 i = 0; i < len; ++i) { QScriptValue item = value.property(i); typedef typename Container::value_type ContainerValue; cont.push_back(qscriptvalue_cast<ContainerValue>(item)); } } int registerVectorTypes(QScriptEngine* eng) { return qScriptRegisterMetaType<RtIntVector>(eng,toScriptValue,fromScriptValue) & qScriptRegisterMetaType<RtUintVector>(eng,toScriptValue,fromScriptValue) & qScriptRegisterMetaType<RtDoubleVector>(eng,toScriptValue,fromScriptValue); }
[ "gapost@ipta.demokritos.gr" ]
gapost@ipta.demokritos.gr
5985938816d6f98f756805c3e5f713a73e127dad
c0214137a486809784230f7a2f54aba41c565fa7
/include/utils/colorspaces.hpp
c13ae7402a8cb5554d0198b8343ffda22ecfa102
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nsk/polybar
4d9d6288d1beed3ec76e0652538a10fe36101043
61f3e1d138cc43ceccf86557f60349b468f2d3f0
refs/heads/master
2023-02-06T01:35:06.513704
2020-12-22T02:41:46
2020-12-22T02:41:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,610
hpp
#pragma once #include <string> #include "common.hpp" #include "errors.hpp" POLYBAR_NS DEFINE_ERROR(color_error); struct rgba; struct double3 { double a, b, c; explicit double3(double a, double b, double c) : a(a), b(b), c(c) {} explicit double3(const string& str); explicit double3(const rgba& src); double3() {} void copy_to(rgba& dest) const; string to_string() const; }; namespace colorspaces { enum class type { none = 0, XYZ = 0b11111111, RGB = 0b00001001, HSL = 0b00000001, Jzazbz = 0b00000110, Jch = 0b00000010, }; inline type operator~(type t) { return static_cast<type>(~static_cast<int>(t)); } inline type operator&(type a, type b) { return static_cast<type>(static_cast<int>(a) & static_cast<int>(b)); } inline type operator|(type a, type b) { return static_cast<type>(static_cast<int>(a) | static_cast<int>(b)); } class color { private: type colorspace; public: double3 data; color() {} color(const rgba& src, type t) : colorspace(t), data(src) {} void set_colorspace(type t); }; void rgb_hsl(const double3& input, double3& output); void hsl_rgb(const double3& input, double3& output); void xyz_rgb(const double3& input, double3& output, double white_lum = 1); void rgb_xyz(const double3& input, double3& output, double white_lum = 1); void xyz_jzazbz(const double3& input, double3& output); void jzazbz_xyz(const double3& input, double3& output); void ab_ch(const double3& input, double3& output); void ch_ab(const double3& input, double3& output); } POLYBAR_NS_END
[ "quandangv@gmail.com" ]
quandangv@gmail.com
f4baaf3443cf928f61ef93153d0f2e6870d4447d
5ac13fa1746046451f1989b5b8734f40d6445322
/minimangalore/Nebula2/code/nebula2/src/kernel/nobject_cmds.cc
7c59348de99ecce84f054a954e5ff23c4d768e0e
[]
no_license
moltenguy1/minimangalore
9f2edf7901e7392490cc22486a7cf13c1790008d
4d849672a6f25d8e441245d374b6bde4b59cbd48
refs/heads/master
2020-04-23T08:57:16.492734
2009-08-01T09:13:33
2009-08-01T09:13:33
35,933,330
0
0
null
null
null
null
UTF-8
C++
false
false
6,793
cc
//------------------------------------------------------------------------------ // (c) 2004 Vadim Macagon // Refactored out of nRoot. //------------------------------------------------------------------------------ #include "kernel/nkernelserver.h" #include "kernel/ncmdproto.h" #include "kernel/nobject.h" #include "kernel/nref.h" static void n_saveas(void *, nCmd *); static void n_clone(void *, nCmd *); static void n_getrefcount(void *, nCmd *); static void n_getclass(void *, nCmd *); static void n_getclasses(void *, nCmd *); static void n_isa(void *, nCmd *); static void n_isinstanceof(void *, nCmd *); static void n_getcmds(void *, nCmd *); static void n_getinstancesize(void*, nCmd*); //------------------------------------------------------------------- /** @scriptclass nobject @cppclass nObject @superclass --- @classinfo nobject is the superclass of all higher level Nebula classes and defines this basic behavior and properties for all nobject derived classes: - runtime type information - object persistency - language independent scripting interface */ void n_initcmds(nClass *cl) { cl->BeginCmds(); cl->AddCmd("b_saveas_s", 'SVAS', n_saveas); cl->AddCmd("o_clone_s", 'CLON', n_clone); cl->AddCmd("i_getrefcount_v", 'GRCT', n_getrefcount); cl->AddCmd("s_getclass_v", 'GCLS', n_getclass); cl->AddCmd("l_getclasses_v", 'GCLL', n_getclasses); cl->AddCmd("b_isa_s", 'ISA_', n_isa); cl->AddCmd("b_isinstanceof_s", 'ISIO', n_isinstanceof); cl->AddCmd("l_getcmds_v", 'GMCD', n_getcmds); cl->AddCmd("i_getinstancesize_v", 'GISZ', n_getinstancesize); n_initcmds_nsignalemitter(cl); cl->EndCmds(); } //------------------------------------------------------------------- /** @cmd saveas @input s (Name) @output b (Success) @info Save the object under a given name into a file. */ static void n_saveas(void *o, nCmd *cmd) { nObject *self = (nObject *) o; cmd->Out()->SetB(self->SaveAs(cmd->In()->GetS())); } //------------------------------------------------------------------- /** @cmd clone @input s (CloneName) @output o (CloneHandle) @info Creates a clone of this object. - If the object's class hierarchy doesn't contain nroot then 'CloneName' is ignored. Otherwise 'CloneName' is the name given to the new cloned object. - If the original object has child objects, they will be cloned as well. */ static void n_clone(void *o, nCmd *cmd) { nObject *self = (nObject *) o; cmd->Out()->SetO(self->Clone(cmd->In()->GetS())); } //------------------------------------------------------------------- /** @cmd getrefcount @input v @output i (Refcount) @info Return current ref count of object. */ static void n_getrefcount(void *o, nCmd *cmd) { nObject *self = (nObject *) o; cmd->Out()->SetI(self->GetRefCount()); } //------------------------------------------------------------------- /** @cmd getclass @input v @output s (Classname) @info Return name of class which the object is an instance of. */ static void n_getclass(void *o, nCmd *cmd) { nObject *self = (nObject *) o; cmd->Out()->SetS(self->GetClass()->GetName()); } //------------------------------------------------------------------- /** @cmd getclasses @input v @output l (ClassnameList) @info Return the list of classes which the object is an instance of. */ static void n_getclasses(void *o, nCmd *cmd) { nObject *self = (nObject *) o; nClass* classObject; // count classes int numClasses = 0; for (classObject = self->GetClass(); classObject; classObject = classObject->GetSuperClass()) { numClasses++; } // Allocate nArg* args = n_new_array(nArg, numClasses); // And fill int i = 0; classObject = self->GetClass(); do { args[i++].SetS(classObject->GetName()); } while ((classObject = classObject->GetSuperClass())); cmd->Out()->SetL(args, numClasses); } //------------------------------------------------------------------- /** @cmd isa @input s (Classname) @output b (Success) @info Check whether the object is instantiated or derived from the class given by 'Classname'. */ static void n_isa(void* o, nCmd* cmd) { nObject* self = (nObject*)o; const char* arg0 = cmd->In()->GetS(); cmd->Out()->SetB(self->IsA(arg0)); } //------------------------------------------------------------------- /** @cmd isinstanceof @input s (Classname) @output b (Success) @info Check whether the object is an instance of the class given by 'Classname'. */ static void n_isinstanceof(void* o, nCmd* cmd) { nObject* self = (nObject*)o; const char* arg0 = cmd->In()->GetS(); cmd->Out()->SetB(self->IsInstanceOf(arg0)); } //------------------------------------------------------------------- /** @cmd getcmds @input v @output l (Commands) @info Return a list of all script command prototypes the object accepts. */ static void n_getcmds(void *o, nCmd *cmd) { nObject *self = (nObject *) o; nHashList cmdList; nHashNode* node; int numCmds = 0; self->GetCmdProtos(&cmdList); // count commands for (node = cmdList.GetHead(); node; node = node->GetSucc()) { numCmds++; } nArg* args = n_new_array(nArg, numCmds); int i = 0; while ((node = cmdList.RemHead())) { args[i++].SetS(((nCmdProto*) node->GetPtr())->GetProtoDef()); n_delete(node); } cmd->Out()->SetL(args, numCmds); } //------------------------------------------------------------------- /** @cmd getinstancesize @input v @output i (InstanceSize) @info Get byte size of this object. This may or may not accurate, depending on whether the object uses external allocated memory, and if the object's class takes this into account. */ static void n_getinstancesize(void* o, nCmd* cmd) { nObject* self = (nObject*)o; cmd->Out()->SetI(self->GetInstanceSize()); } //------------------------------------------------------------------- // EOF //-------------------------------------------------------------------
[ "BawooiT@d1c0eb94-fc07-11dd-a7be-4b3ef3b0700c" ]
BawooiT@d1c0eb94-fc07-11dd-a7be-4b3ef3b0700c
d05dbd702a4da087465ab42e98ef143b4670ff3f
7a4640a884d513dc60e66617802e95be9fe9b3f5
/Unity/Temp/il2cppOutput/il2cppOutput/Bulk_System_1.cpp
906954338444783d72424ec7f40cf6ece91d28d7
[]
no_license
eray-z/Game-Engine-Benchmarks
40e455c9eb04463fef1c9d11fdea80ecad4a6404
2b427d02a801a2c2c4fb496601a458634e646c8d
refs/heads/master
2020-12-25T14:13:36.908703
2016-06-03T16:05:24
2016-06-03T16:05:24
60,355,376
5
0
null
null
null
null
UTF-8
C++
false
false
620,532
cpp
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> // System.Text.RegularExpressions.LinkStack struct LinkStack_t4092128393; // System.Text.RegularExpressions.Match struct Match_t3797657504; // System.Text.RegularExpressions.Regex struct Regex_t3802381858; // System.Text.RegularExpressions.IMachine struct IMachine_t294675897; // System.String struct String_t; // System.Text.RegularExpressions.GroupCollection struct GroupCollection_t2158306392; // System.Text.RegularExpressions.MatchCollection struct MatchCollection_t318449694; // System.Object struct Il2CppObject; // System.Array struct Il2CppArray; // System.Collections.IEnumerator struct IEnumerator_t287207039; // System.Collections.ICollection struct ICollection_t3761522009; // System.Text.RegularExpressions.MatchCollection/Enumerator struct Enumerator_t1072804839; // System.Text.RegularExpressions.MRUList struct MRUList_t1475339785; // System.Text.RegularExpressions.MRUList/Node struct Node_t2433570; // System.Text.RegularExpressions.PatternCompiler struct PatternCompiler_t870195754; // System.Text.RegularExpressions.IMachineFactory struct IMachineFactory_t1224363367; // System.Collections.BitArray struct BitArray_t2687322878; // System.Text.RegularExpressions.LinkRef struct LinkRef_t1270295572; // System.Text.RegularExpressions.PatternCompiler/PatternLinkStack struct PatternLinkStack_t1510705438; // System.Text.RegularExpressions.QuickSearch struct QuickSearch_t1268643792; // System.Runtime.Serialization.SerializationInfo struct SerializationInfo_t2995724695; // System.Int32[] struct Int32U5BU5D_t1809983122; // System.String[] struct StringU5BU5D_t2956870243; // System.Collections.IDictionary struct IDictionary_t1654916945; // System.Text.RegularExpressions.Syntax.Alternation struct Alternation_t2772154573; // System.Text.RegularExpressions.Syntax.ExpressionCollection struct ExpressionCollection_t357621126; // System.Text.RegularExpressions.Syntax.Expression struct Expression_t1499093192; // System.Text.RegularExpressions.ICompiler struct ICompiler_t93500931; // System.Text.RegularExpressions.Syntax.AnchorInfo struct AnchorInfo_t1997143859; // System.Text.RegularExpressions.Syntax.Assertion struct Assertion_t324477170; // System.Text.RegularExpressions.Syntax.BackslashNumber struct BackslashNumber_t1411804623; // System.Collections.Hashtable struct Hashtable_t3875263730; // System.Text.RegularExpressions.Syntax.BalancingGroup struct BalancingGroup_t3928584086; // System.Text.RegularExpressions.Syntax.CapturingGroup struct CapturingGroup_t1439411180; // System.Text.RegularExpressions.Syntax.CaptureAssertion struct CaptureAssertion_t1074818188; // System.Text.RegularExpressions.Syntax.Literal struct Literal_t3148194463; // System.Text.RegularExpressions.Syntax.ExpressionAssertion struct ExpressionAssertion_t563003706; // System.Text.RegularExpressions.Syntax.CharacterClass struct CharacterClass_t630081023; // System.Text.RegularExpressions.Syntax.CompositeExpression struct CompositeExpression_t3952301679; // System.Text.RegularExpressions.Syntax.Group struct Group_t1370157167; // System.Text.RegularExpressions.Syntax.NonBacktrackingGroup struct NonBacktrackingGroup_t1448538980; // System.Text.RegularExpressions.Syntax.Parser struct Parser_t3684504143; // System.Text.RegularExpressions.Syntax.RegularExpression struct RegularExpression_t1734534468; // System.Collections.ArrayList struct ArrayList_t2121638921; // System.ArgumentException struct ArgumentException_t124305799; // System.Text.RegularExpressions.Syntax.PositionAssertion struct PositionAssertion_t3660056009; // System.Text.RegularExpressions.Syntax.Reference struct Reference_t2379893051; // System.Text.RegularExpressions.Syntax.Repetition struct Repetition_t693899937; // System.Uri struct Uri_t2776692961; // System.UriParser struct UriParser_t1660745760; // System.UriFormatException struct UriFormatException_t1145000641; #include "class-internals.h" #include "codegen/il2cpp-codegen.h" #include "mscorlib_System_Array2840145358.h" #include "System_System_Text_RegularExpressions_LinkStack4092128393.h" #include "System_System_Text_RegularExpressions_LinkStack4092128393MethodDeclarations.h" #include "mscorlib_System_Void2779279689.h" #include "System_System_Text_RegularExpressions_LinkRef1270295572MethodDeclarations.h" #include "mscorlib_System_Collections_Stack1623036922MethodDeclarations.h" #include "mscorlib_System_Collections_Stack1623036922.h" #include "mscorlib_System_Object837106420.h" #include "mscorlib_System_Boolean211005341.h" #include "mscorlib_System_Int322847414787.h" #include "System_System_Text_RegularExpressions_Mark3725932776.h" #include "System_System_Text_RegularExpressions_Mark3725932776MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Match3797657504.h" #include "System_System_Text_RegularExpressions_Match3797657504MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Group3792618586MethodDeclarations.h" #include "System_System_Text_RegularExpressions_GroupCollect2158306392MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Regex3802381858.h" #include "System_System_Text_RegularExpressions_GroupCollect2158306392.h" #include "System_System_Text_RegularExpressions_Group3792618586.h" #include "mscorlib_System_String968488902.h" #include "System_System_Text_RegularExpressions_Regex3802381858MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Capture1645813025MethodDeclarations.h" #include "System_System_Text_RegularExpressions_MatchCollecti318449694.h" #include "System_System_Text_RegularExpressions_MatchCollecti318449694MethodDeclarations.h" #include "mscorlib_System_Object837106420MethodDeclarations.h" #include "mscorlib_System_Collections_ArrayList2121638921MethodDeclarations.h" #include "mscorlib_System_Collections_ArrayList2121638921.h" #include "mscorlib_System_ArgumentOutOfRangeException3479058991MethodDeclarations.h" #include "mscorlib_System_ArgumentOutOfRangeException3479058991.h" #include "System_System_Text_RegularExpressions_MatchCollect1072804836MethodDeclarations.h" #include "System_System_Text_RegularExpressions_MatchCollect1072804836.h" #include "mscorlib_System_SystemException3155420757MethodDeclarations.h" #include "mscorlib_System_SystemException3155420757.h" #include "mscorlib_System_InvalidOperationException2420574324MethodDeclarations.h" #include "mscorlib_System_InvalidOperationException2420574324.h" #include "System_System_Text_RegularExpressions_MRUList1475339785.h" #include "System_System_Text_RegularExpressions_MRUList1475339785MethodDeclarations.h" #include "System_System_Text_RegularExpressions_MRUList_Node2433570.h" #include "System_System_Text_RegularExpressions_MRUList_Node2433570MethodDeclarations.h" #include "System_System_Text_RegularExpressions_OpCode1795817865.h" #include "System_System_Text_RegularExpressions_OpCode1795817865MethodDeclarations.h" #include "System_System_Text_RegularExpressions_OpFlags4096314113.h" #include "System_System_Text_RegularExpressions_OpFlags4096314113MethodDeclarations.h" #include "System_System_Text_RegularExpressions_PatternCompil870195754.h" #include "System_System_Text_RegularExpressions_PatternCompil870195754MethodDeclarations.h" #include "mscorlib_System_UInt16985925268.h" #include "System_System_Text_RegularExpressions_InterpreterF3964579659MethodDeclarations.h" #include "mscorlib_ArrayTypes.h" #include "System_System_Text_RegularExpressions_InterpreterF3964579659.h" #include "mscorlib_System_UInt32985925326.h" #include "mscorlib_System_Char2778706699.h" #include "mscorlib_System_Char2778706699MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Category3838697241.h" #include "mscorlib_System_Collections_BitArray2687322878.h" #include "mscorlib_System_Collections_BitArray2687322878MethodDeclarations.h" #include "mscorlib_System_String968488902MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Position241023812.h" #include "System_System_Text_RegularExpressions_LinkRef1270295572.h" #include "System_System_Text_RegularExpressions_PatternCompi1510705438MethodDeclarations.h" #include "System_System_Text_RegularExpressions_PatternCompi1510705438.h" #include "System_System_Text_RegularExpressions_PatternCompiler2368538.h" #include "System_System_Text_RegularExpressions_PatternCompiler2368538MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Position241023812MethodDeclarations.h" #include "System_System_Text_RegularExpressions_QuickSearch1268643792.h" #include "System_System_Text_RegularExpressions_QuickSearch1268643792MethodDeclarations.h" #include "mscorlib_System_Collections_Hashtable3875263730MethodDeclarations.h" #include "mscorlib_System_Byte2778693821.h" #include "mscorlib_System_Collections_Hashtable3875263730.h" #include "System_System_Text_RegularExpressions_RegexOptions2783621746.h" #include "mscorlib_System_ArgumentNullException3214793280MethodDeclarations.h" #include "mscorlib_System_ArgumentNullException3214793280.h" #include "mscorlib_System_Runtime_Serialization_Serializatio2995724695.h" #include "mscorlib_System_Runtime_Serialization_StreamingCont986364934.h" #include "mscorlib_System_Runtime_Serialization_Serializatio2995724695MethodDeclarations.h" #include "mscorlib_System_Type2779229935MethodDeclarations.h" #include "mscorlib_System_Type2779229935.h" #include "mscorlib_System_RuntimeTypeHandle1864875887.h" #include "System_System_Text_RegularExpressions_FactoryCache1981134515MethodDeclarations.h" #include "System_System_Text_RegularExpressions_FactoryCache1981134515.h" #include "System_System_Text_RegularExpressions_Syntax_Parse3684504143MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Parse3684504143.h" #include "System_System_Text_RegularExpressions_Syntax_Regul1734534468.h" #include "System_System_Text_RegularExpressions_Syntax_Regul1734534468MethodDeclarations.h" #include "mscorlib_System_Array2840145358MethodDeclarations.h" #include "mscorlib_System_Int322847414787MethodDeclarations.h" #include "System_System_Text_RegularExpressions_RegexOptions2783621746MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Alter2772154573.h" #include "System_System_Text_RegularExpressions_Syntax_Alter2772154573MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Compo3952301679MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Expres357621126.h" #include "System_System_Text_RegularExpressions_Syntax_Expre1499093192.h" #include "System_System_Text_RegularExpressions_Syntax_Expres357621126MethodDeclarations.h" #include "mscorlib_System_Collections_CollectionBase851261505MethodDeclarations.h" #include "mscorlib_System_Collections_CollectionBase851261505.h" #include "System_System_Text_RegularExpressions_Syntax_Expre1499093192MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Ancho1997143859.h" #include "System_System_Text_RegularExpressions_Syntax_Ancho1997143859MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Interval63637216.h" #include "System_System_Text_RegularExpressions_Interval63637216MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Assert324477170.h" #include "System_System_Text_RegularExpressions_Syntax_Assert324477170MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Backs1411804623.h" #include "System_System_Text_RegularExpressions_Syntax_Backs1411804623MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Refer2379893051MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Captu1439411180.h" #include "System_System_Text_RegularExpressions_Syntax_Liter3148194463MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Refer2379893051.h" #include "System_System_Text_RegularExpressions_Syntax_Balan3928584086.h" #include "System_System_Text_RegularExpressions_Syntax_Balan3928584086MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Captu1439411180MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Captu1074818188.h" #include "System_System_Text_RegularExpressions_Syntax_Captu1074818188MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Liter3148194463.h" #include "System_System_Text_RegularExpressions_Syntax_Expres563003706.h" #include "System_System_Text_RegularExpressions_Syntax_Expres563003706MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Group1370157167MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Group1370157167.h" #include "System_System_Text_RegularExpressions_Syntax_Charac630081023.h" #include "System_System_Text_RegularExpressions_Syntax_Charac630081023MethodDeclarations.h" #include "System_System_Text_RegularExpressions_IntervalColl2368501598MethodDeclarations.h" #include "System_System_Text_RegularExpressions_IntervalColl2368501598.h" #include "System_System_Text_RegularExpressions_IntervalColl3008899218MethodDeclarations.h" #include "mscorlib_System_Double534516614.h" #include "System_System_Text_RegularExpressions_IntervalColl3008899218.h" #include "mscorlib_System_IntPtr676692020.h" #include "System_System_Text_RegularExpressions_Syntax_Compo3952301679.h" #include "mscorlib_System_Text_StringBuilder3822575854MethodDeclarations.h" #include "mscorlib_System_Console1097803980MethodDeclarations.h" #include "mscorlib_System_Text_StringBuilder3822575854.h" #include "mscorlib_System_IO_TextWriter1689927879.h" #include "mscorlib_System_IO_TextWriter1689927879MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_NonBa1448538980.h" #include "System_System_Text_RegularExpressions_Syntax_NonBa1448538980MethodDeclarations.h" #include "mscorlib_System_IndexOutOfRangeException3760259642.h" #include "mscorlib_System_ArgumentException124305799.h" #include "System_System_Text_RegularExpressions_Syntax_Posit3660056009MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Repeti693899937MethodDeclarations.h" #include "System_System_Text_RegularExpressions_Syntax_Repeti693899937.h" #include "System_System_Text_RegularExpressions_Syntax_Posit3660056009.h" #include "System_System_Text_RegularExpressions_CategoryUtils557170734MethodDeclarations.h" #include "mscorlib_System_ArgumentException124305799MethodDeclarations.h" #include "mscorlib_System_Globalization_UnicodeCategory3612619569.h" #include "System_System_Uri2776692961.h" #include "System_System_Uri2776692961MethodDeclarations.h" #include "System_System_UriFormatException1145000641MethodDeclarations.h" #include "System_System_UriKind4268040853.h" #include "System_System_UriFormatException1145000641.h" #include "System_System_Uri_UriScheme3266528785MethodDeclarations.h" #include "System_ArrayTypes.h" #include "System_System_Uri_UriScheme3266528785.h" #include "System_System_UriPartial2544661034.h" #include "System_System_Net_IPAddress3220500535MethodDeclarations.h" #include "System_System_Net_IPv6Address256391031MethodDeclarations.h" #include "System_System_Net_IPAddress3220500535.h" #include "System_System_Net_IPv6Address256391031.h" #include "System_System_UriHostNameType4203425070.h" #include "mscorlib_System_UInt32985925326MethodDeclarations.h" #include "mscorlib_System_Globalization_CultureInfo3603717042MethodDeclarations.h" #include "mscorlib_System_Globalization_CultureInfo3603717042.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_ge190145395MethodDeclarations.h" #include "mscorlib_System_Collections_Generic_Dictionary_2_ge190145395.h" #include "mscorlib_System_Text_Encoding180559927MethodDeclarations.h" #include "mscorlib_System_Text_Encoding180559927.h" #include "System_Locale2281372282MethodDeclarations.h" #include "mscorlib_System_IO_Path2029632748.h" #include "mscorlib_System_IO_Path2029632748MethodDeclarations.h" #include "mscorlib_System_Globalization_NumberStyles3988678145.h" #include "System_System_UriParser1660745760.h" #include "System_System_DefaultUriParser625205023.h" #include "System_System_UriParser1660745760MethodDeclarations.h" #include "mscorlib_System_Exception1967233988MethodDeclarations.h" #include "mscorlib_System_Exception1967233988.h" #include "System_System_DefaultUriParser625205023MethodDeclarations.h" #include "mscorlib_System_FormatException2404802957MethodDeclarations.h" #include "System_System_UriHostNameType4203425070MethodDeclarations.h" #include "System_System_UriKind4268040853MethodDeclarations.h" #include "mscorlib_System_Threading_Monitor2071304733MethodDeclarations.h" #include "System_System_GenericUriParser2219856969.h" #include "System_System_UriPartial2544661034MethodDeclarations.h" #include "System_System_UriTypeConverter3286319.h" #include "System_System_UriTypeConverter3286319MethodDeclarations.h" // System.Int32 System.Array::BinarySearch<System.Int32>(!!0[],System.Int32,System.Int32,!!0) extern "C" int32_t Array_BinarySearch_TisInt32_t2847414787_m3080908590_gshared (Il2CppObject * __this /* static, unused */, Int32U5BU5D_t1809983122* p0, int32_t p1, int32_t p2, int32_t p3, const MethodInfo* method); #define Array_BinarySearch_TisInt32_t2847414787_m3080908590(__this /* static, unused */, p0, p1, p2, p3, method) (( int32_t (*) (Il2CppObject * /* static, unused */, Int32U5BU5D_t1809983122*, int32_t, int32_t, int32_t, const MethodInfo*))Array_BinarySearch_TisInt32_t2847414787_m3080908590_gshared)(__this /* static, unused */, p0, p1, p2, p3, method) #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.Text.RegularExpressions.LinkStack::.ctor() extern Il2CppClass* Stack_t1623036922_il2cpp_TypeInfo_var; extern const uint32_t LinkStack__ctor_m840569467_MetadataUsageId; extern "C" void LinkStack__ctor_m840569467 (LinkStack_t4092128393 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (LinkStack__ctor_m840569467_MetadataUsageId); s_Il2CppMethodIntialized = true; } { LinkRef__ctor_m2896599248(__this, /*hidden argument*/NULL); Stack_t1623036922 * L_0 = (Stack_t1623036922 *)il2cpp_codegen_object_new(Stack_t1623036922_il2cpp_TypeInfo_var); Stack__ctor_m1821673314(L_0, /*hidden argument*/NULL); __this->set_stack_0(L_0); return; } } // System.Void System.Text.RegularExpressions.LinkStack::Push() extern "C" void LinkStack_Push_m185806851 (LinkStack_t4092128393 * __this, const MethodInfo* method) { { Stack_t1623036922 * L_0 = __this->get_stack_0(); Il2CppObject * L_1 = VirtFuncInvoker0< Il2CppObject * >::Invoke(4 /* System.Object System.Text.RegularExpressions.LinkStack::GetCurrent() */, __this); NullCheck(L_0); VirtActionInvoker1< Il2CppObject * >::Invoke(17 /* System.Void System.Collections.Stack::Push(System.Object) */, L_0, L_1); return; } } // System.Boolean System.Text.RegularExpressions.LinkStack::Pop() extern "C" bool LinkStack_Pop_m192057428 (LinkStack_t4092128393 * __this, const MethodInfo* method) { { Stack_t1623036922 * L_0 = __this->get_stack_0(); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(9 /* System.Int32 System.Collections.Stack::get_Count() */, L_0); if ((((int32_t)L_1) <= ((int32_t)0))) { goto IL_0024; } } { Stack_t1623036922 * L_2 = __this->get_stack_0(); NullCheck(L_2); Il2CppObject * L_3 = VirtFuncInvoker0< Il2CppObject * >::Invoke(16 /* System.Object System.Collections.Stack::Pop() */, L_2); VirtActionInvoker1< Il2CppObject * >::Invoke(5 /* System.Void System.Text.RegularExpressions.LinkStack::SetCurrent(System.Object) */, __this, L_3); return (bool)1; } IL_0024: { return (bool)0; } } // System.Boolean System.Text.RegularExpressions.Mark::get_IsDefined() extern "C" bool Mark_get_IsDefined_m36891578 (Mark_t3725932776 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { int32_t L_0 = __this->get_Start_0(); if ((((int32_t)L_0) < ((int32_t)0))) { goto IL_001a; } } { int32_t L_1 = __this->get_End_1(); G_B3_0 = ((((int32_t)((((int32_t)L_1) < ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_001b; } IL_001a: { G_B3_0 = 0; } IL_001b: { return (bool)G_B3_0; } } // System.Int32 System.Text.RegularExpressions.Mark::get_Index() extern "C" int32_t Mark_get_Index_m4214982375 (Mark_t3725932776 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { int32_t L_0 = __this->get_Start_0(); int32_t L_1 = __this->get_End_1(); if ((((int32_t)L_0) >= ((int32_t)L_1))) { goto IL_001c; } } { int32_t L_2 = __this->get_Start_0(); G_B3_0 = L_2; goto IL_0022; } IL_001c: { int32_t L_3 = __this->get_End_1(); G_B3_0 = L_3; } IL_0022: { return G_B3_0; } } // System.Int32 System.Text.RegularExpressions.Mark::get_Length() extern "C" int32_t Mark_get_Length_m3639380819 (Mark_t3725932776 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { int32_t L_0 = __this->get_Start_0(); int32_t L_1 = __this->get_End_1(); if ((((int32_t)L_0) >= ((int32_t)L_1))) { goto IL_0023; } } { int32_t L_2 = __this->get_End_1(); int32_t L_3 = __this->get_Start_0(); G_B3_0 = ((int32_t)((int32_t)L_2-(int32_t)L_3)); goto IL_0030; } IL_0023: { int32_t L_4 = __this->get_Start_0(); int32_t L_5 = __this->get_End_1(); G_B3_0 = ((int32_t)((int32_t)L_4-(int32_t)L_5)); } IL_0030: { return G_B3_0; } } // Conversion methods for marshalling of: System.Text.RegularExpressions.Mark extern "C" void Mark_t3725932776_marshal_pinvoke(const Mark_t3725932776& unmarshaled, Mark_t3725932776_marshaled_pinvoke& marshaled) { marshaled.___Start_0 = unmarshaled.get_Start_0(); marshaled.___End_1 = unmarshaled.get_End_1(); marshaled.___Previous_2 = unmarshaled.get_Previous_2(); } extern "C" void Mark_t3725932776_marshal_pinvoke_back(const Mark_t3725932776_marshaled_pinvoke& marshaled, Mark_t3725932776& unmarshaled) { int32_t unmarshaled_Start_temp = 0; unmarshaled_Start_temp = marshaled.___Start_0; unmarshaled.set_Start_0(unmarshaled_Start_temp); int32_t unmarshaled_End_temp = 0; unmarshaled_End_temp = marshaled.___End_1; unmarshaled.set_End_1(unmarshaled_End_temp); int32_t unmarshaled_Previous_temp = 0; unmarshaled_Previous_temp = marshaled.___Previous_2; unmarshaled.set_Previous_2(unmarshaled_Previous_temp); } // Conversion method for clean up from marshalling of: System.Text.RegularExpressions.Mark extern "C" void Mark_t3725932776_marshal_pinvoke_cleanup(Mark_t3725932776_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: System.Text.RegularExpressions.Mark extern "C" void Mark_t3725932776_marshal_com(const Mark_t3725932776& unmarshaled, Mark_t3725932776_marshaled_com& marshaled) { marshaled.___Start_0 = unmarshaled.get_Start_0(); marshaled.___End_1 = unmarshaled.get_End_1(); marshaled.___Previous_2 = unmarshaled.get_Previous_2(); } extern "C" void Mark_t3725932776_marshal_com_back(const Mark_t3725932776_marshaled_com& marshaled, Mark_t3725932776& unmarshaled) { int32_t unmarshaled_Start_temp = 0; unmarshaled_Start_temp = marshaled.___Start_0; unmarshaled.set_Start_0(unmarshaled_Start_temp); int32_t unmarshaled_End_temp = 0; unmarshaled_End_temp = marshaled.___End_1; unmarshaled.set_End_1(unmarshaled_End_temp); int32_t unmarshaled_Previous_temp = 0; unmarshaled_Previous_temp = marshaled.___Previous_2; unmarshaled.set_Previous_2(unmarshaled_Previous_temp); } // Conversion method for clean up from marshalling of: System.Text.RegularExpressions.Mark extern "C" void Mark_t3725932776_marshal_com_cleanup(Mark_t3725932776_marshaled_com& marshaled) { } // System.Void System.Text.RegularExpressions.Match::.ctor() extern Il2CppClass* Group_t3792618586_il2cpp_TypeInfo_var; extern Il2CppClass* GroupCollection_t2158306392_il2cpp_TypeInfo_var; extern const uint32_t Match__ctor_m4051317828_MetadataUsageId; extern "C" void Match__ctor_m4051317828 (Match_t3797657504 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Match__ctor_m4051317828_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Group_t3792618586_il2cpp_TypeInfo_var); Group__ctor_m1893910730(__this, /*hidden argument*/NULL); __this->set_regex_6((Regex_t3802381858 *)NULL); __this->set_machine_7((Il2CppObject *)NULL); __this->set_text_length_8(0); GroupCollection_t2158306392 * L_0 = (GroupCollection_t2158306392 *)il2cpp_codegen_object_new(GroupCollection_t2158306392_il2cpp_TypeInfo_var); GroupCollection__ctor_m1062211994(L_0, 1, 1, /*hidden argument*/NULL); __this->set_groups_9(L_0); GroupCollection_t2158306392 * L_1 = __this->get_groups_9(); NullCheck(L_1); GroupCollection_SetValue_m3728413090(L_1, __this, 0, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Match::.ctor(System.Text.RegularExpressions.Regex,System.Text.RegularExpressions.IMachine,System.String,System.Int32,System.Int32,System.Int32,System.Int32) extern Il2CppClass* Group_t3792618586_il2cpp_TypeInfo_var; extern const uint32_t Match__ctor_m798974407_MetadataUsageId; extern "C" void Match__ctor_m798974407 (Match_t3797657504 * __this, Regex_t3802381858 * ___regex0, Il2CppObject * ___machine1, String_t* ___text2, int32_t ___text_length3, int32_t ___n_groups4, int32_t ___index5, int32_t ___length6, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Match__ctor_m798974407_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___text2; int32_t L_1 = ___index5; int32_t L_2 = ___length6; IL2CPP_RUNTIME_CLASS_INIT(Group_t3792618586_il2cpp_TypeInfo_var); Group__ctor_m3054050776(__this, L_0, L_1, L_2, /*hidden argument*/NULL); Regex_t3802381858 * L_3 = ___regex0; __this->set_regex_6(L_3); Il2CppObject * L_4 = ___machine1; __this->set_machine_7(L_4); int32_t L_5 = ___text_length3; __this->set_text_length_8(L_5); return; } } // System.Void System.Text.RegularExpressions.Match::.ctor(System.Text.RegularExpressions.Regex,System.Text.RegularExpressions.IMachine,System.String,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32) extern Il2CppClass* Group_t3792618586_il2cpp_TypeInfo_var; extern Il2CppClass* GroupCollection_t2158306392_il2cpp_TypeInfo_var; extern const uint32_t Match__ctor_m4138800752_MetadataUsageId; extern "C" void Match__ctor_m4138800752 (Match_t3797657504 * __this, Regex_t3802381858 * ___regex0, Il2CppObject * ___machine1, String_t* ___text2, int32_t ___text_length3, int32_t ___n_groups4, int32_t ___index5, int32_t ___length6, int32_t ___n_caps7, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Match__ctor_m4138800752_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___text2; int32_t L_1 = ___index5; int32_t L_2 = ___length6; int32_t L_3 = ___n_caps7; IL2CPP_RUNTIME_CLASS_INIT(Group_t3792618586_il2cpp_TypeInfo_var); Group__ctor_m3266526719(__this, L_0, L_1, L_2, L_3, /*hidden argument*/NULL); Regex_t3802381858 * L_4 = ___regex0; __this->set_regex_6(L_4); Il2CppObject * L_5 = ___machine1; __this->set_machine_7(L_5); int32_t L_6 = ___text_length3; __this->set_text_length_8(L_6); int32_t L_7 = ___n_groups4; Regex_t3802381858 * L_8 = ___regex0; NullCheck(L_8); int32_t L_9 = Regex_get_Gap_m2153899613(L_8, /*hidden argument*/NULL); GroupCollection_t2158306392 * L_10 = (GroupCollection_t2158306392 *)il2cpp_codegen_object_new(GroupCollection_t2158306392_il2cpp_TypeInfo_var); GroupCollection__ctor_m1062211994(L_10, L_7, L_9, /*hidden argument*/NULL); __this->set_groups_9(L_10); GroupCollection_t2158306392 * L_11 = __this->get_groups_9(); NullCheck(L_11); GroupCollection_SetValue_m3728413090(L_11, __this, 0, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Match::.cctor() extern Il2CppClass* Match_t3797657504_il2cpp_TypeInfo_var; extern const uint32_t Match__cctor_m554704873_MetadataUsageId; extern "C" void Match__cctor_m554704873 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Match__cctor_m554704873_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Match_t3797657504 * L_0 = (Match_t3797657504 *)il2cpp_codegen_object_new(Match_t3797657504_il2cpp_TypeInfo_var); Match__ctor_m4051317828(L_0, /*hidden argument*/NULL); ((Match_t3797657504_StaticFields*)Match_t3797657504_il2cpp_TypeInfo_var->static_fields)->set_empty_10(L_0); return; } } // System.Text.RegularExpressions.Match System.Text.RegularExpressions.Match::get_Empty() extern Il2CppClass* Match_t3797657504_il2cpp_TypeInfo_var; extern const uint32_t Match_get_Empty_m170222943_MetadataUsageId; extern "C" Match_t3797657504 * Match_get_Empty_m170222943 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Match_get_Empty_m170222943_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Match_t3797657504_il2cpp_TypeInfo_var); Match_t3797657504 * L_0 = ((Match_t3797657504_StaticFields*)Match_t3797657504_il2cpp_TypeInfo_var->static_fields)->get_empty_10(); return L_0; } } // System.Text.RegularExpressions.GroupCollection System.Text.RegularExpressions.Match::get_Groups() extern "C" GroupCollection_t2158306392 * Match_get_Groups_m445730348 (Match_t3797657504 * __this, const MethodInfo* method) { { GroupCollection_t2158306392 * L_0 = __this->get_groups_9(); return L_0; } } // System.Text.RegularExpressions.Match System.Text.RegularExpressions.Match::NextMatch() extern Il2CppClass* Match_t3797657504_il2cpp_TypeInfo_var; extern Il2CppClass* IMachine_t294675897_il2cpp_TypeInfo_var; extern const uint32_t Match_NextMatch_m3913445709_MetadataUsageId; extern "C" Match_t3797657504 * Match_NextMatch_m3913445709 (Match_t3797657504 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Match_NextMatch_m3913445709_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t G_B5_0 = 0; int32_t G_B8_0 = 0; int32_t G_B7_0 = 0; int32_t G_B9_0 = 0; int32_t G_B9_1 = 0; { IL2CPP_RUNTIME_CLASS_INIT(Match_t3797657504_il2cpp_TypeInfo_var); Match_t3797657504 * L_0 = Match_get_Empty_m170222943(NULL /*static, unused*/, /*hidden argument*/NULL); if ((!(((Il2CppObject*)(Match_t3797657504 *)__this) == ((Il2CppObject*)(Match_t3797657504 *)L_0)))) { goto IL_0011; } } { IL2CPP_RUNTIME_CLASS_INIT(Match_t3797657504_il2cpp_TypeInfo_var); Match_t3797657504 * L_1 = Match_get_Empty_m170222943(NULL /*static, unused*/, /*hidden argument*/NULL); return L_1; } IL_0011: { Regex_t3802381858 * L_2 = __this->get_regex_6(); NullCheck(L_2); bool L_3 = Regex_get_RightToLeft_m3494755007(L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_002c; } } { int32_t L_4 = Capture_get_Index_m2179527098(__this, /*hidden argument*/NULL); G_B5_0 = L_4; goto IL_0039; } IL_002c: { int32_t L_5 = Capture_get_Index_m2179527098(__this, /*hidden argument*/NULL); int32_t L_6 = Capture_get_Length_m669809376(__this, /*hidden argument*/NULL); G_B5_0 = ((int32_t)((int32_t)L_5+(int32_t)L_6)); } IL_0039: { V_0 = G_B5_0; int32_t L_7 = Capture_get_Length_m669809376(__this, /*hidden argument*/NULL); if (L_7) { goto IL_005f; } } { int32_t L_8 = V_0; Regex_t3802381858 * L_9 = __this->get_regex_6(); NullCheck(L_9); bool L_10 = Regex_get_RightToLeft_m3494755007(L_9, /*hidden argument*/NULL); G_B7_0 = L_8; if (!L_10) { G_B8_0 = L_8; goto IL_005c; } } { G_B9_0 = (-1); G_B9_1 = G_B7_0; goto IL_005d; } IL_005c: { G_B9_0 = 1; G_B9_1 = G_B8_0; } IL_005d: { V_0 = ((int32_t)((int32_t)G_B9_1+(int32_t)G_B9_0)); } IL_005f: { Il2CppObject * L_11 = __this->get_machine_7(); Regex_t3802381858 * L_12 = __this->get_regex_6(); String_t* L_13 = Capture_get_Text_m1823829274(__this, /*hidden argument*/NULL); int32_t L_14 = V_0; int32_t L_15 = __this->get_text_length_8(); NullCheck(L_11); Match_t3797657504 * L_16 = InterfaceFuncInvoker4< Match_t3797657504 *, Regex_t3802381858 *, String_t*, int32_t, int32_t >::Invoke(0 /* System.Text.RegularExpressions.Match System.Text.RegularExpressions.IMachine::Scan(System.Text.RegularExpressions.Regex,System.String,System.Int32,System.Int32) */, IMachine_t294675897_il2cpp_TypeInfo_var, L_11, L_12, L_13, L_14, L_15); return L_16; } } // System.Text.RegularExpressions.Regex System.Text.RegularExpressions.Match::get_Regex() extern "C" Regex_t3802381858 * Match_get_Regex_m1260760027 (Match_t3797657504 * __this, const MethodInfo* method) { { Regex_t3802381858 * L_0 = __this->get_regex_6(); return L_0; } } // System.Void System.Text.RegularExpressions.MatchCollection::.ctor(System.Text.RegularExpressions.Match) extern Il2CppClass* ArrayList_t2121638921_il2cpp_TypeInfo_var; extern const uint32_t MatchCollection__ctor_m1982569902_MetadataUsageId; extern "C" void MatchCollection__ctor_m1982569902 (MatchCollection_t318449694 * __this, Match_t3797657504 * ___start0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MatchCollection__ctor_m1982569902_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); Match_t3797657504 * L_0 = ___start0; __this->set_current_0(L_0); ArrayList_t2121638921 * L_1 = (ArrayList_t2121638921 *)il2cpp_codegen_object_new(ArrayList_t2121638921_il2cpp_TypeInfo_var); ArrayList__ctor_m1878432947(L_1, /*hidden argument*/NULL); __this->set_list_1(L_1); return; } } // System.Int32 System.Text.RegularExpressions.MatchCollection::get_Count() extern Il2CppClass* ICollection_t3761522009_il2cpp_TypeInfo_var; extern const uint32_t MatchCollection_get_Count_m4071817434_MetadataUsageId; extern "C" int32_t MatchCollection_get_Count_m4071817434 (MatchCollection_t318449694 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MatchCollection_get_Count_m4071817434_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = MatchCollection_get_FullList_m3038253348(__this, /*hidden argument*/NULL); NullCheck(L_0); int32_t L_1 = InterfaceFuncInvoker0< int32_t >::Invoke(0 /* System.Int32 System.Collections.ICollection::get_Count() */, ICollection_t3761522009_il2cpp_TypeInfo_var, L_0); return L_1; } } // System.Text.RegularExpressions.Match System.Text.RegularExpressions.MatchCollection::get_Item(System.Int32) extern Il2CppClass* ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var; extern Il2CppClass* Match_t3797657504_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral105; extern const uint32_t MatchCollection_get_Item_m2495033586_MetadataUsageId; extern "C" Match_t3797657504 * MatchCollection_get_Item_m2495033586 (MatchCollection_t318449694 * __this, int32_t ___i0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MatchCollection_get_Item_m2495033586_MetadataUsageId); s_Il2CppMethodIntialized = true; } Match_t3797657504 * G_B6_0 = NULL; { int32_t L_0 = ___i0; if ((((int32_t)L_0) < ((int32_t)0))) { goto IL_0013; } } { int32_t L_1 = ___i0; bool L_2 = MatchCollection_TryToGet_m1603574341(__this, L_1, /*hidden argument*/NULL); if (L_2) { goto IL_001e; } } IL_0013: { ArgumentOutOfRangeException_t3479058991 * L_3 = (ArgumentOutOfRangeException_t3479058991 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m2026296331(L_3, _stringLiteral105, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_3); } IL_001e: { int32_t L_4 = ___i0; ArrayList_t2121638921 * L_5 = __this->get_list_1(); NullCheck(L_5); int32_t L_6 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_5); if ((((int32_t)L_4) >= ((int32_t)L_6))) { goto IL_0045; } } { ArrayList_t2121638921 * L_7 = __this->get_list_1(); int32_t L_8 = ___i0; NullCheck(L_7); Il2CppObject * L_9 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_7, L_8); G_B6_0 = ((Match_t3797657504 *)CastclassClass(L_9, Match_t3797657504_il2cpp_TypeInfo_var)); goto IL_004b; } IL_0045: { Match_t3797657504 * L_10 = __this->get_current_0(); G_B6_0 = L_10; } IL_004b: { return G_B6_0; } } // System.Object System.Text.RegularExpressions.MatchCollection::get_SyncRoot() extern "C" Il2CppObject * MatchCollection_get_SyncRoot_m2333479705 (MatchCollection_t318449694 * __this, const MethodInfo* method) { { ArrayList_t2121638921 * L_0 = __this->get_list_1(); return L_0; } } // System.Void System.Text.RegularExpressions.MatchCollection::CopyTo(System.Array,System.Int32) extern Il2CppClass* ICollection_t3761522009_il2cpp_TypeInfo_var; extern const uint32_t MatchCollection_CopyTo_m2665262947_MetadataUsageId; extern "C" void MatchCollection_CopyTo_m2665262947 (MatchCollection_t318449694 * __this, Il2CppArray * ___array0, int32_t ___index1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MatchCollection_CopyTo_m2665262947_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = MatchCollection_get_FullList_m3038253348(__this, /*hidden argument*/NULL); Il2CppArray * L_1 = ___array0; int32_t L_2 = ___index1; NullCheck(L_0); InterfaceActionInvoker2< Il2CppArray *, int32_t >::Invoke(2 /* System.Void System.Collections.ICollection::CopyTo(System.Array,System.Int32) */, ICollection_t3761522009_il2cpp_TypeInfo_var, L_0, L_1, L_2); return; } } // System.Collections.IEnumerator System.Text.RegularExpressions.MatchCollection::GetEnumerator() extern Il2CppClass* Enumerator_t1072804839_il2cpp_TypeInfo_var; extern const uint32_t MatchCollection_GetEnumerator_m3446344180_MetadataUsageId; extern "C" Il2CppObject * MatchCollection_GetEnumerator_m3446344180 (MatchCollection_t318449694 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MatchCollection_GetEnumerator_m3446344180_MetadataUsageId); s_Il2CppMethodIntialized = true; } Il2CppObject * V_0 = NULL; Il2CppObject * G_B3_0 = NULL; { Match_t3797657504 * L_0 = __this->get_current_0(); NullCheck(L_0); bool L_1 = Group_get_Success_m3627958764(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_001d; } } { Enumerator_t1072804839 * L_2 = (Enumerator_t1072804839 *)il2cpp_codegen_object_new(Enumerator_t1072804839_il2cpp_TypeInfo_var); Enumerator__ctor_m2762289495(L_2, __this, /*hidden argument*/NULL); V_0 = L_2; Il2CppObject * L_3 = V_0; G_B3_0 = L_3; goto IL_0028; } IL_001d: { ArrayList_t2121638921 * L_4 = __this->get_list_1(); NullCheck(L_4); Il2CppObject * L_5 = VirtFuncInvoker0< Il2CppObject * >::Invoke(39 /* System.Collections.IEnumerator System.Collections.ArrayList::GetEnumerator() */, L_4); G_B3_0 = L_5; } IL_0028: { return G_B3_0; } } // System.Boolean System.Text.RegularExpressions.MatchCollection::TryToGet(System.Int32) extern "C" bool MatchCollection_TryToGet_m1603574341 (MatchCollection_t318449694 * __this, int32_t ___i0, const MethodInfo* method) { int32_t G_B7_0 = 0; { goto IL_0028; } IL_0005: { ArrayList_t2121638921 * L_0 = __this->get_list_1(); Match_t3797657504 * L_1 = __this->get_current_0(); NullCheck(L_0); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_0, L_1); Match_t3797657504 * L_2 = __this->get_current_0(); NullCheck(L_2); Match_t3797657504 * L_3 = Match_NextMatch_m3913445709(L_2, /*hidden argument*/NULL); __this->set_current_0(L_3); } IL_0028: { int32_t L_4 = ___i0; ArrayList_t2121638921 * L_5 = __this->get_list_1(); NullCheck(L_5); int32_t L_6 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_5); if ((((int32_t)L_4) <= ((int32_t)L_6))) { goto IL_0049; } } { Match_t3797657504 * L_7 = __this->get_current_0(); NullCheck(L_7); bool L_8 = Group_get_Success_m3627958764(L_7, /*hidden argument*/NULL); if (L_8) { goto IL_0005; } } IL_0049: { int32_t L_9 = ___i0; ArrayList_t2121638921 * L_10 = __this->get_list_1(); NullCheck(L_10); int32_t L_11 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_10); if ((((int32_t)L_9) < ((int32_t)L_11))) { goto IL_0067; } } { Match_t3797657504 * L_12 = __this->get_current_0(); NullCheck(L_12); bool L_13 = Group_get_Success_m3627958764(L_12, /*hidden argument*/NULL); G_B7_0 = ((int32_t)(L_13)); goto IL_0068; } IL_0067: { G_B7_0 = 1; } IL_0068: { return (bool)G_B7_0; } } // System.Collections.ICollection System.Text.RegularExpressions.MatchCollection::get_FullList() extern Il2CppClass* SystemException_t3155420757_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3611112382; extern const uint32_t MatchCollection_get_FullList_m3038253348_MetadataUsageId; extern "C" Il2CppObject * MatchCollection_get_FullList_m3038253348 (MatchCollection_t318449694 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MatchCollection_get_FullList_m3038253348_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = MatchCollection_TryToGet_m1603574341(__this, ((int32_t)2147483647LL), /*hidden argument*/NULL); if (!L_0) { goto IL_001b; } } { SystemException_t3155420757 * L_1 = (SystemException_t3155420757 *)il2cpp_codegen_object_new(SystemException_t3155420757_il2cpp_TypeInfo_var); SystemException__ctor_m3697314481(L_1, _stringLiteral3611112382, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_001b: { ArrayList_t2121638921 * L_2 = __this->get_list_1(); return L_2; } } // System.Void System.Text.RegularExpressions.MatchCollection/Enumerator::.ctor(System.Text.RegularExpressions.MatchCollection) extern "C" void Enumerator__ctor_m2762289495 (Enumerator_t1072804839 * __this, MatchCollection_t318449694 * ___coll0, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); MatchCollection_t318449694 * L_0 = ___coll0; __this->set_coll_1(L_0); __this->set_index_0((-1)); return; } } // System.Void System.Text.RegularExpressions.MatchCollection/Enumerator::System.Collections.IEnumerator.Reset() extern "C" void Enumerator_System_Collections_IEnumerator_Reset_m4262909997 (Enumerator_t1072804839 * __this, const MethodInfo* method) { { __this->set_index_0((-1)); return; } } // System.Object System.Text.RegularExpressions.MatchCollection/Enumerator::System.Collections.IEnumerator.get_Current() extern Il2CppClass* InvalidOperationException_t2420574324_il2cpp_TypeInfo_var; extern Il2CppClass* SystemException_t3155420757_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3925826948; extern Il2CppCodeGenString* _stringLiteral1551471050; extern Il2CppCodeGenString* _stringLiteral36292379; extern const uint32_t Enumerator_System_Collections_IEnumerator_get_Current_m360409_MetadataUsageId; extern "C" Il2CppObject * Enumerator_System_Collections_IEnumerator_get_Current_m360409 (Enumerator_t1072804839 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Enumerator_System_Collections_IEnumerator_get_Current_m360409_MetadataUsageId); s_Il2CppMethodIntialized = true; } Il2CppObject * G_B10_0 = NULL; { int32_t L_0 = __this->get_index_0(); if ((((int32_t)L_0) >= ((int32_t)0))) { goto IL_0017; } } { InvalidOperationException_t2420574324 * L_1 = (InvalidOperationException_t2420574324 *)il2cpp_codegen_object_new(InvalidOperationException_t2420574324_il2cpp_TypeInfo_var); InvalidOperationException__ctor_m1485483280(L_1, _stringLiteral3925826948, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0017: { int32_t L_2 = __this->get_index_0(); MatchCollection_t318449694 * L_3 = __this->get_coll_1(); NullCheck(L_3); ArrayList_t2121638921 * L_4 = L_3->get_list_1(); NullCheck(L_4); int32_t L_5 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_4); if ((((int32_t)L_2) <= ((int32_t)L_5))) { goto IL_003d; } } { SystemException_t3155420757 * L_6 = (SystemException_t3155420757 *)il2cpp_codegen_object_new(SystemException_t3155420757_il2cpp_TypeInfo_var); SystemException__ctor_m3697314481(L_6, _stringLiteral1551471050, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_6); } IL_003d: { int32_t L_7 = __this->get_index_0(); MatchCollection_t318449694 * L_8 = __this->get_coll_1(); NullCheck(L_8); ArrayList_t2121638921 * L_9 = L_8->get_list_1(); NullCheck(L_9); int32_t L_10 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_9); if ((!(((uint32_t)L_7) == ((uint32_t)L_10)))) { goto IL_0078; } } { MatchCollection_t318449694 * L_11 = __this->get_coll_1(); NullCheck(L_11); Match_t3797657504 * L_12 = L_11->get_current_0(); NullCheck(L_12); bool L_13 = Group_get_Success_m3627958764(L_12, /*hidden argument*/NULL); if (L_13) { goto IL_0078; } } { InvalidOperationException_t2420574324 * L_14 = (InvalidOperationException_t2420574324 *)il2cpp_codegen_object_new(InvalidOperationException_t2420574324_il2cpp_TypeInfo_var); InvalidOperationException__ctor_m1485483280(L_14, _stringLiteral36292379, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_14); } IL_0078: { int32_t L_15 = __this->get_index_0(); MatchCollection_t318449694 * L_16 = __this->get_coll_1(); NullCheck(L_16); ArrayList_t2121638921 * L_17 = L_16->get_list_1(); NullCheck(L_17); int32_t L_18 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_17); if ((((int32_t)L_15) >= ((int32_t)L_18))) { goto IL_00ae; } } { MatchCollection_t318449694 * L_19 = __this->get_coll_1(); NullCheck(L_19); ArrayList_t2121638921 * L_20 = L_19->get_list_1(); int32_t L_21 = __this->get_index_0(); NullCheck(L_20); Il2CppObject * L_22 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_20, L_21); G_B10_0 = L_22; goto IL_00b9; } IL_00ae: { MatchCollection_t318449694 * L_23 = __this->get_coll_1(); NullCheck(L_23); Match_t3797657504 * L_24 = L_23->get_current_0(); G_B10_0 = ((Il2CppObject *)(L_24)); } IL_00b9: { return G_B10_0; } } // System.Boolean System.Text.RegularExpressions.MatchCollection/Enumerator::System.Collections.IEnumerator.MoveNext() extern Il2CppClass* SystemException_t3155420757_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral1551471050; extern const uint32_t Enumerator_System_Collections_IEnumerator_MoveNext_m1106607422_MetadataUsageId; extern "C" bool Enumerator_System_Collections_IEnumerator_MoveNext_m1106607422 (Enumerator_t1072804839 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Enumerator_System_Collections_IEnumerator_MoveNext_m1106607422_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { int32_t L_0 = __this->get_index_0(); MatchCollection_t318449694 * L_1 = __this->get_coll_1(); NullCheck(L_1); ArrayList_t2121638921 * L_2 = L_1->get_list_1(); NullCheck(L_2); int32_t L_3 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_2); if ((((int32_t)L_0) <= ((int32_t)L_3))) { goto IL_0026; } } { SystemException_t3155420757 * L_4 = (SystemException_t3155420757 *)il2cpp_codegen_object_new(SystemException_t3155420757_il2cpp_TypeInfo_var); SystemException__ctor_m3697314481(L_4, _stringLiteral1551471050, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4); } IL_0026: { int32_t L_5 = __this->get_index_0(); MatchCollection_t318449694 * L_6 = __this->get_coll_1(); NullCheck(L_6); ArrayList_t2121638921 * L_7 = L_6->get_list_1(); NullCheck(L_7); int32_t L_8 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_7); if ((!(((uint32_t)L_5) == ((uint32_t)L_8)))) { goto IL_0058; } } { MatchCollection_t318449694 * L_9 = __this->get_coll_1(); NullCheck(L_9); Match_t3797657504 * L_10 = L_9->get_current_0(); NullCheck(L_10); bool L_11 = Group_get_Success_m3627958764(L_10, /*hidden argument*/NULL); if (L_11) { goto IL_0058; } } { return (bool)0; } IL_0058: { MatchCollection_t318449694 * L_12 = __this->get_coll_1(); int32_t L_13 = __this->get_index_0(); int32_t L_14 = ((int32_t)((int32_t)L_13+(int32_t)1)); V_0 = L_14; __this->set_index_0(L_14); int32_t L_15 = V_0; NullCheck(L_12); bool L_16 = MatchCollection_TryToGet_m1603574341(L_12, L_15, /*hidden argument*/NULL); return L_16; } } // System.Void System.Text.RegularExpressions.MRUList::.ctor() extern "C" void MRUList__ctor_m3161932411 (MRUList_t1475339785 * __this, const MethodInfo* method) { Node_t2433570 * V_0 = NULL; { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); V_0 = (Node_t2433570 *)NULL; __this->set_tail_1((Node_t2433570 *)NULL); Node_t2433570 * L_0 = V_0; __this->set_head_0(L_0); return; } } // System.Void System.Text.RegularExpressions.MRUList::Use(System.Object) extern Il2CppClass* Node_t2433570_il2cpp_TypeInfo_var; extern const uint32_t MRUList_Use_m4144664628_MetadataUsageId; extern "C" void MRUList_Use_m4144664628 (MRUList_t1475339785 * __this, Il2CppObject * ___o0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (MRUList_Use_m4144664628_MetadataUsageId); s_Il2CppMethodIntialized = true; } Node_t2433570 * V_0 = NULL; Node_t2433570 * V_1 = NULL; { Node_t2433570 * L_0 = __this->get_head_0(); if (L_0) { goto IL_0023; } } { Il2CppObject * L_1 = ___o0; Node_t2433570 * L_2 = (Node_t2433570 *)il2cpp_codegen_object_new(Node_t2433570_il2cpp_TypeInfo_var); Node__ctor_m3506872826(L_2, L_1, /*hidden argument*/NULL); V_0 = L_2; Node_t2433570 * L_3 = V_0; Node_t2433570 * L_4 = L_3; V_1 = L_4; __this->set_tail_1(L_4); Node_t2433570 * L_5 = V_1; __this->set_head_0(L_5); return; } IL_0023: { Node_t2433570 * L_6 = __this->get_head_0(); V_0 = L_6; goto IL_0036; } IL_002f: { Node_t2433570 * L_7 = V_0; NullCheck(L_7); Node_t2433570 * L_8 = L_7->get_previous_1(); V_0 = L_8; } IL_0036: { Node_t2433570 * L_9 = V_0; if (!L_9) { goto IL_004d; } } { Il2CppObject * L_10 = ___o0; Node_t2433570 * L_11 = V_0; NullCheck(L_11); Il2CppObject * L_12 = L_11->get_value_0(); NullCheck(L_10); bool L_13 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(0 /* System.Boolean System.Object::Equals(System.Object) */, L_10, L_12); if (!L_13) { goto IL_002f; } } IL_004d: { Node_t2433570 * L_14 = V_0; if (L_14) { goto IL_005f; } } { Il2CppObject * L_15 = ___o0; Node_t2433570 * L_16 = (Node_t2433570 *)il2cpp_codegen_object_new(Node_t2433570_il2cpp_TypeInfo_var); Node__ctor_m3506872826(L_16, L_15, /*hidden argument*/NULL); V_0 = L_16; goto IL_00ab; } IL_005f: { Node_t2433570 * L_17 = V_0; Node_t2433570 * L_18 = __this->get_head_0(); if ((!(((Il2CppObject*)(Node_t2433570 *)L_17) == ((Il2CppObject*)(Node_t2433570 *)L_18)))) { goto IL_006c; } } { return; } IL_006c: { Node_t2433570 * L_19 = V_0; Node_t2433570 * L_20 = __this->get_tail_1(); if ((!(((Il2CppObject*)(Node_t2433570 *)L_19) == ((Il2CppObject*)(Node_t2433570 *)L_20)))) { goto IL_0089; } } { Node_t2433570 * L_21 = V_0; NullCheck(L_21); Node_t2433570 * L_22 = L_21->get_next_2(); __this->set_tail_1(L_22); goto IL_009a; } IL_0089: { Node_t2433570 * L_23 = V_0; NullCheck(L_23); Node_t2433570 * L_24 = L_23->get_previous_1(); Node_t2433570 * L_25 = V_0; NullCheck(L_25); Node_t2433570 * L_26 = L_25->get_next_2(); NullCheck(L_24); L_24->set_next_2(L_26); } IL_009a: { Node_t2433570 * L_27 = V_0; NullCheck(L_27); Node_t2433570 * L_28 = L_27->get_next_2(); Node_t2433570 * L_29 = V_0; NullCheck(L_29); Node_t2433570 * L_30 = L_29->get_previous_1(); NullCheck(L_28); L_28->set_previous_1(L_30); } IL_00ab: { Node_t2433570 * L_31 = __this->get_head_0(); Node_t2433570 * L_32 = V_0; NullCheck(L_31); L_31->set_next_2(L_32); Node_t2433570 * L_33 = V_0; Node_t2433570 * L_34 = __this->get_head_0(); NullCheck(L_33); L_33->set_previous_1(L_34); Node_t2433570 * L_35 = V_0; NullCheck(L_35); L_35->set_next_2((Node_t2433570 *)NULL); Node_t2433570 * L_36 = V_0; __this->set_head_0(L_36); return; } } // System.Object System.Text.RegularExpressions.MRUList::Evict() extern "C" Il2CppObject * MRUList_Evict_m3673261069 (MRUList_t1475339785 * __this, const MethodInfo* method) { Il2CppObject * V_0 = NULL; { Node_t2433570 * L_0 = __this->get_tail_1(); if (L_0) { goto IL_000d; } } { return NULL; } IL_000d: { Node_t2433570 * L_1 = __this->get_tail_1(); NullCheck(L_1); Il2CppObject * L_2 = L_1->get_value_0(); V_0 = L_2; Node_t2433570 * L_3 = __this->get_tail_1(); NullCheck(L_3); Node_t2433570 * L_4 = L_3->get_next_2(); __this->set_tail_1(L_4); Node_t2433570 * L_5 = __this->get_tail_1(); if (L_5) { goto IL_0041; } } { __this->set_head_0((Node_t2433570 *)NULL); goto IL_004d; } IL_0041: { Node_t2433570 * L_6 = __this->get_tail_1(); NullCheck(L_6); L_6->set_previous_1((Node_t2433570 *)NULL); } IL_004d: { Il2CppObject * L_7 = V_0; return L_7; } } // System.Void System.Text.RegularExpressions.MRUList/Node::.ctor(System.Object) extern "C" void Node__ctor_m3506872826 (Node_t2433570 * __this, Il2CppObject * ___value0, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); Il2CppObject * L_0 = ___value0; __this->set_value_0(L_0); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::.ctor() extern Il2CppClass* ArrayList_t2121638921_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler__ctor_m640185722_MetadataUsageId; extern "C" void PatternCompiler__ctor_m640185722 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler__ctor_m640185722_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); ArrayList_t2121638921 * L_0 = (ArrayList_t2121638921 *)il2cpp_codegen_object_new(ArrayList_t2121638921_il2cpp_TypeInfo_var); ArrayList__ctor_m1878432947(L_0, /*hidden argument*/NULL); __this->set_pgm_0(L_0); return; } } // System.UInt16 System.Text.RegularExpressions.PatternCompiler::EncodeOp(System.Text.RegularExpressions.OpCode,System.Text.RegularExpressions.OpFlags) extern "C" uint16_t PatternCompiler_EncodeOp_m3438255148 (Il2CppObject * __this /* static, unused */, uint16_t ___op0, uint16_t ___flags1, const MethodInfo* method) { { uint16_t L_0 = ___op0; uint16_t L_1 = ___flags1; return (((int32_t)((uint16_t)((int32_t)((int32_t)L_0|(int32_t)((int32_t)((int32_t)L_1&(int32_t)((int32_t)65280)))))))); } } // System.Text.RegularExpressions.IMachineFactory System.Text.RegularExpressions.PatternCompiler::GetMachineFactory() extern Il2CppClass* UInt16U5BU5D_t3999484061_il2cpp_TypeInfo_var; extern Il2CppClass* InterpreterFactory_t3964579659_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_GetMachineFactory_m1519739313_MetadataUsageId; extern "C" Il2CppObject * PatternCompiler_GetMachineFactory_m1519739313 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_GetMachineFactory_m1519739313_MetadataUsageId); s_Il2CppMethodIntialized = true; } UInt16U5BU5D_t3999484061* V_0 = NULL; { ArrayList_t2121638921 * L_0 = __this->get_pgm_0(); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_0); V_0 = ((UInt16U5BU5D_t3999484061*)SZArrayNew(UInt16U5BU5D_t3999484061_il2cpp_TypeInfo_var, (uint32_t)L_1)); ArrayList_t2121638921 * L_2 = __this->get_pgm_0(); UInt16U5BU5D_t3999484061* L_3 = V_0; NullCheck(L_2); VirtActionInvoker1< Il2CppArray * >::Invoke(36 /* System.Void System.Collections.ArrayList::CopyTo(System.Array) */, L_2, (Il2CppArray *)(Il2CppArray *)L_3); UInt16U5BU5D_t3999484061* L_4 = V_0; InterpreterFactory_t3964579659 * L_5 = (InterpreterFactory_t3964579659 *)il2cpp_codegen_object_new(InterpreterFactory_t3964579659_il2cpp_TypeInfo_var); InterpreterFactory__ctor_m595479877(L_5, L_4, /*hidden argument*/NULL); return L_5; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitFalse() extern "C" void PatternCompiler_EmitFalse_m722778152 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { { PatternCompiler_Emit_m992741850(__this, 0, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitTrue() extern "C" void PatternCompiler_EmitTrue_m2656833483 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { { PatternCompiler_Emit_m992741850(__this, 1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitCount(System.Int32) extern "C" void PatternCompiler_EmitCount_m3183303781 (PatternCompiler_t870195754 * __this, int32_t ___count0, const MethodInfo* method) { uint32_t V_0 = 0; { int32_t L_0 = ___count0; V_0 = L_0; uint32_t L_1 = V_0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)((int32_t)((int32_t)L_1&(int32_t)((int32_t)65535)))))), /*hidden argument*/NULL); uint32_t L_2 = V_0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)((int32_t)((uint32_t)L_2>>((int32_t)16)))))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitCharacter(System.Char,System.Boolean,System.Boolean,System.Boolean) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_EmitCharacter_m3311297038_MetadataUsageId; extern "C" void PatternCompiler_EmitCharacter_m3311297038 (PatternCompiler_t870195754 * __this, uint16_t ___c0, bool ___negate1, bool ___ignore2, bool ___reverse3, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_EmitCharacter_m3311297038_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = ___negate1; bool L_1 = ___ignore2; bool L_2 = ___reverse3; uint16_t L_3 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, L_0, L_1, L_2, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, 5, L_3, /*hidden argument*/NULL); bool L_4 = ___ignore2; if (!L_4) { goto IL_001f; } } { uint16_t L_5 = ___c0; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); uint16_t L_6 = Char_ToLower_m3095077372(NULL /*static, unused*/, L_5, /*hidden argument*/NULL); ___c0 = L_6; } IL_001f: { uint16_t L_7 = ___c0; PatternCompiler_Emit_m2066671991(__this, L_7, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitCategory(System.Text.RegularExpressions.Category,System.Boolean,System.Boolean) extern "C" void PatternCompiler_EmitCategory_m2446864524 (PatternCompiler_t870195754 * __this, uint16_t ___cat0, bool ___negate1, bool ___reverse2, const MethodInfo* method) { { bool L_0 = ___negate1; bool L_1 = ___reverse2; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, L_0, (bool)0, L_1, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, 6, L_2, /*hidden argument*/NULL); uint16_t L_3 = ___cat0; PatternCompiler_Emit_m2066671991(__this, L_3, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitNotCategory(System.Text.RegularExpressions.Category,System.Boolean,System.Boolean) extern "C" void PatternCompiler_EmitNotCategory_m3974981937 (PatternCompiler_t870195754 * __this, uint16_t ___cat0, bool ___negate1, bool ___reverse2, const MethodInfo* method) { { bool L_0 = ___negate1; bool L_1 = ___reverse2; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, L_0, (bool)0, L_1, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, 7, L_2, /*hidden argument*/NULL); uint16_t L_3 = ___cat0; PatternCompiler_Emit_m2066671991(__this, L_3, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitRange(System.Char,System.Char,System.Boolean,System.Boolean,System.Boolean) extern "C" void PatternCompiler_EmitRange_m3212229739 (PatternCompiler_t870195754 * __this, uint16_t ___lo0, uint16_t ___hi1, bool ___negate2, bool ___ignore3, bool ___reverse4, const MethodInfo* method) { { bool L_0 = ___negate2; bool L_1 = ___ignore3; bool L_2 = ___reverse4; uint16_t L_3 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, L_0, L_1, L_2, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, 8, L_3, /*hidden argument*/NULL); uint16_t L_4 = ___lo0; PatternCompiler_Emit_m2066671991(__this, L_4, /*hidden argument*/NULL); uint16_t L_5 = ___hi1; PatternCompiler_Emit_m2066671991(__this, L_5, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitSet(System.Char,System.Collections.BitArray,System.Boolean,System.Boolean,System.Boolean) extern "C" void PatternCompiler_EmitSet_m2895987935 (PatternCompiler_t870195754 * __this, uint16_t ___lo0, BitArray_t2687322878 * ___set1, bool ___negate2, bool ___ignore3, bool ___reverse4, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; uint16_t V_2 = 0; int32_t V_3 = 0; { bool L_0 = ___negate2; bool L_1 = ___ignore3; bool L_2 = ___reverse4; uint16_t L_3 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, L_0, L_1, L_2, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, ((int32_t)9), L_3, /*hidden argument*/NULL); uint16_t L_4 = ___lo0; PatternCompiler_Emit_m2066671991(__this, L_4, /*hidden argument*/NULL); BitArray_t2687322878 * L_5 = ___set1; NullCheck(L_5); int32_t L_6 = BitArray_get_Length_m3443319207(L_5, /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)((int32_t)((int32_t)L_6+(int32_t)((int32_t)15)))>>(int32_t)4)); int32_t L_7 = V_0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_7))), /*hidden argument*/NULL); V_1 = 0; goto IL_007d; } IL_0035: { V_2 = 0; V_3 = 0; goto IL_006e; } IL_003e: { int32_t L_8 = V_1; BitArray_t2687322878 * L_9 = ___set1; NullCheck(L_9); int32_t L_10 = BitArray_get_Length_m3443319207(L_9, /*hidden argument*/NULL); if ((((int32_t)L_8) < ((int32_t)L_10))) { goto IL_004f; } } { goto IL_0076; } IL_004f: { BitArray_t2687322878 * L_11 = ___set1; int32_t L_12 = V_1; int32_t L_13 = L_12; V_1 = ((int32_t)((int32_t)L_13+(int32_t)1)); NullCheck(L_11); bool L_14 = BitArray_get_Item_m2410594623(L_11, L_13, /*hidden argument*/NULL); if (!L_14) { goto IL_006a; } } { uint16_t L_15 = V_2; int32_t L_16 = V_3; V_2 = (((int32_t)((uint16_t)((int32_t)((int32_t)L_15|(int32_t)(((int32_t)((uint16_t)((int32_t)((int32_t)1<<(int32_t)((int32_t)((int32_t)L_16&(int32_t)((int32_t)31))))))))))))); } IL_006a: { int32_t L_17 = V_3; V_3 = ((int32_t)((int32_t)L_17+(int32_t)1)); } IL_006e: { int32_t L_18 = V_3; if ((((int32_t)L_18) < ((int32_t)((int32_t)16)))) { goto IL_003e; } } IL_0076: { uint16_t L_19 = V_2; PatternCompiler_Emit_m2066671991(__this, L_19, /*hidden argument*/NULL); } IL_007d: { int32_t L_20 = V_0; int32_t L_21 = L_20; V_0 = ((int32_t)((int32_t)L_21-(int32_t)1)); if (L_21) { goto IL_0035; } } { return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitString(System.String,System.Boolean,System.Boolean) extern "C" void PatternCompiler_EmitString_m2313515668 (PatternCompiler_t870195754 * __this, String_t* ___str0, bool ___ignore1, bool ___reverse2, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; { bool L_0 = ___ignore1; bool L_1 = ___reverse2; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, (bool)0, L_0, L_1, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, 3, L_2, /*hidden argument*/NULL); String_t* L_3 = ___str0; NullCheck(L_3); int32_t L_4 = String_get_Length_m2979997331(L_3, /*hidden argument*/NULL); V_0 = L_4; int32_t L_5 = V_0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_5))), /*hidden argument*/NULL); bool L_6 = ___ignore1; if (!L_6) { goto IL_002d; } } { String_t* L_7 = ___str0; NullCheck(L_7); String_t* L_8 = String_ToLower_m2421900555(L_7, /*hidden argument*/NULL); ___str0 = L_8; } IL_002d: { V_1 = 0; goto IL_0045; } IL_0034: { String_t* L_9 = ___str0; int32_t L_10 = V_1; NullCheck(L_9); uint16_t L_11 = String_get_Chars_m3015341861(L_9, L_10, /*hidden argument*/NULL); PatternCompiler_Emit_m2066671991(__this, L_11, /*hidden argument*/NULL); int32_t L_12 = V_1; V_1 = ((int32_t)((int32_t)L_12+(int32_t)1)); } IL_0045: { int32_t L_13 = V_1; int32_t L_14 = V_0; if ((((int32_t)L_13) < ((int32_t)L_14))) { goto IL_0034; } } { return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitPosition(System.Text.RegularExpressions.Position) extern "C" void PatternCompiler_EmitPosition_m3189000342 (PatternCompiler_t870195754 * __this, uint16_t ___pos0, const MethodInfo* method) { { PatternCompiler_Emit_m1318559571(__this, 2, 0, /*hidden argument*/NULL); uint16_t L_0 = ___pos0; PatternCompiler_Emit_m2066671991(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitOpen(System.Int32) extern "C" void PatternCompiler_EmitOpen_m1906123864 (PatternCompiler_t870195754 * __this, int32_t ___gid0, const MethodInfo* method) { { PatternCompiler_Emit_m992741850(__this, ((int32_t)11), /*hidden argument*/NULL); int32_t L_0 = ___gid0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_0))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitClose(System.Int32) extern "C" void PatternCompiler_EmitClose_m2953485710 (PatternCompiler_t870195754 * __this, int32_t ___gid0, const MethodInfo* method) { { PatternCompiler_Emit_m992741850(__this, ((int32_t)12), /*hidden argument*/NULL); int32_t L_0 = ___gid0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_0))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitBalanceStart(System.Int32,System.Int32,System.Boolean,System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitBalanceStart_m153593536 (PatternCompiler_t870195754 * __this, int32_t ___gid0, int32_t ___balance1, bool ___capture2, LinkRef_t1270295572 * ___tail3, const MethodInfo* method) { PatternCompiler_t870195754 * G_B2_0 = NULL; PatternCompiler_t870195754 * G_B1_0 = NULL; int32_t G_B3_0 = 0; PatternCompiler_t870195754 * G_B3_1 = NULL; { LinkRef_t1270295572 * L_0 = ___tail3; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); PatternCompiler_Emit_m992741850(__this, ((int32_t)14), /*hidden argument*/NULL); int32_t L_1 = ___gid0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_1))), /*hidden argument*/NULL); int32_t L_2 = ___balance1; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_2))), /*hidden argument*/NULL); bool L_3 = ___capture2; G_B1_0 = __this; if (!L_3) { G_B2_0 = __this; goto IL_002d; } } { G_B3_0 = 1; G_B3_1 = G_B1_0; goto IL_002e; } IL_002d: { G_B3_0 = 0; G_B3_1 = G_B2_0; } IL_002e: { NullCheck(G_B3_1); PatternCompiler_Emit_m2066671991(G_B3_1, (((int32_t)((uint16_t)G_B3_0))), /*hidden argument*/NULL); LinkRef_t1270295572 * L_4 = ___tail3; PatternCompiler_EmitLink_m116538795(__this, L_4, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitBalance() extern "C" void PatternCompiler_EmitBalance_m1234756257 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { { PatternCompiler_Emit_m992741850(__this, ((int32_t)13), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitReference(System.Int32,System.Boolean,System.Boolean) extern "C" void PatternCompiler_EmitReference_m2226804289 (PatternCompiler_t870195754 * __this, int32_t ___gid0, bool ___ignore1, bool ___reverse2, const MethodInfo* method) { { bool L_0 = ___ignore1; bool L_1 = ___reverse2; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, (bool)0, L_0, L_1, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, 4, L_2, /*hidden argument*/NULL); int32_t L_3 = ___gid0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_3))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitIfDefined(System.Int32,System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitIfDefined_m1998800056 (PatternCompiler_t870195754 * __this, int32_t ___gid0, LinkRef_t1270295572 * ___tail1, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___tail1; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); PatternCompiler_Emit_m992741850(__this, ((int32_t)15), /*hidden argument*/NULL); LinkRef_t1270295572 * L_1 = ___tail1; PatternCompiler_EmitLink_m116538795(__this, L_1, /*hidden argument*/NULL); int32_t L_2 = ___gid0; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_2))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitSub(System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitSub_m1250623225 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___tail0, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___tail0; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); PatternCompiler_Emit_m992741850(__this, ((int32_t)16), /*hidden argument*/NULL); LinkRef_t1270295572 * L_1 = ___tail0; PatternCompiler_EmitLink_m116538795(__this, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitTest(System.Text.RegularExpressions.LinkRef,System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitTest_m3519274007 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___yes0, LinkRef_t1270295572 * ___tail1, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___yes0; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); LinkRef_t1270295572 * L_1 = ___tail1; PatternCompiler_BeginLink_m4071458319(__this, L_1, /*hidden argument*/NULL); PatternCompiler_Emit_m992741850(__this, ((int32_t)17), /*hidden argument*/NULL); LinkRef_t1270295572 * L_2 = ___yes0; PatternCompiler_EmitLink_m116538795(__this, L_2, /*hidden argument*/NULL); LinkRef_t1270295572 * L_3 = ___tail1; PatternCompiler_EmitLink_m116538795(__this, L_3, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitBranch(System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitBranch_m2313940051 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___next0, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___next0; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, ((int32_t)18), 0, /*hidden argument*/NULL); LinkRef_t1270295572 * L_1 = ___next0; PatternCompiler_EmitLink_m116538795(__this, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitJump(System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitJump_m4159061471 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___target0, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___target0; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, ((int32_t)19), 0, /*hidden argument*/NULL); LinkRef_t1270295572 * L_1 = ___target0; PatternCompiler_EmitLink_m116538795(__this, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitRepeat(System.Int32,System.Int32,System.Boolean,System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitRepeat_m3913724843 (PatternCompiler_t870195754 * __this, int32_t ___min0, int32_t ___max1, bool ___lazy2, LinkRef_t1270295572 * ___until3, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___until3; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); bool L_1 = ___lazy2; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, (bool)0, (bool)0, (bool)0, L_1, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, ((int32_t)20), L_2, /*hidden argument*/NULL); LinkRef_t1270295572 * L_3 = ___until3; PatternCompiler_EmitLink_m116538795(__this, L_3, /*hidden argument*/NULL); int32_t L_4 = ___min0; PatternCompiler_EmitCount_m3183303781(__this, L_4, /*hidden argument*/NULL); int32_t L_5 = ___max1; PatternCompiler_EmitCount_m3183303781(__this, L_5, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitUntil(System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitUntil_m2917116183 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___repeat0, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___repeat0; VirtActionInvoker1< LinkRef_t1270295572 * >::Invoke(33 /* System.Void System.Text.RegularExpressions.PatternCompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, __this, L_0); PatternCompiler_Emit_m992741850(__this, ((int32_t)21), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitFastRepeat(System.Int32,System.Int32,System.Boolean,System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitFastRepeat_m1340139951 (PatternCompiler_t870195754 * __this, int32_t ___min0, int32_t ___max1, bool ___lazy2, LinkRef_t1270295572 * ___tail3, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___tail3; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); bool L_1 = ___lazy2; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, (bool)0, (bool)0, (bool)0, L_1, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, ((int32_t)22), L_2, /*hidden argument*/NULL); LinkRef_t1270295572 * L_3 = ___tail3; PatternCompiler_EmitLink_m116538795(__this, L_3, /*hidden argument*/NULL); int32_t L_4 = ___min0; PatternCompiler_EmitCount_m3183303781(__this, L_4, /*hidden argument*/NULL); int32_t L_5 = ___max1; PatternCompiler_EmitCount_m3183303781(__this, L_5, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitIn(System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitIn_m2264896214 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___tail0, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___tail0; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); PatternCompiler_Emit_m992741850(__this, ((int32_t)10), /*hidden argument*/NULL); LinkRef_t1270295572 * L_1 = ___tail0; PatternCompiler_EmitLink_m116538795(__this, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitAnchor(System.Boolean,System.Int32,System.Text.RegularExpressions.LinkRef) extern "C" void PatternCompiler_EmitAnchor_m1283354284 (PatternCompiler_t870195754 * __this, bool ___reverse0, int32_t ___offset1, LinkRef_t1270295572 * ___tail2, const MethodInfo* method) { { LinkRef_t1270295572 * L_0 = ___tail2; PatternCompiler_BeginLink_m4071458319(__this, L_0, /*hidden argument*/NULL); bool L_1 = ___reverse0; uint16_t L_2 = PatternCompiler_MakeFlags_m1692978267(NULL /*static, unused*/, (bool)0, (bool)0, L_1, (bool)0, /*hidden argument*/NULL); PatternCompiler_Emit_m1318559571(__this, ((int32_t)23), L_2, /*hidden argument*/NULL); LinkRef_t1270295572 * L_3 = ___tail2; PatternCompiler_EmitLink_m116538795(__this, L_3, /*hidden argument*/NULL); int32_t L_4 = ___offset1; PatternCompiler_Emit_m2066671991(__this, (((int32_t)((uint16_t)L_4))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitInfo(System.Int32,System.Int32,System.Int32) extern "C" void PatternCompiler_EmitInfo_m2915026460 (PatternCompiler_t870195754 * __this, int32_t ___count0, int32_t ___min1, int32_t ___max2, const MethodInfo* method) { { PatternCompiler_Emit_m992741850(__this, ((int32_t)24), /*hidden argument*/NULL); int32_t L_0 = ___count0; PatternCompiler_EmitCount_m3183303781(__this, L_0, /*hidden argument*/NULL); int32_t L_1 = ___min1; PatternCompiler_EmitCount_m3183303781(__this, L_1, /*hidden argument*/NULL); int32_t L_2 = ___max2; PatternCompiler_EmitCount_m3183303781(__this, L_2, /*hidden argument*/NULL); return; } } // System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.PatternCompiler::NewLink() extern Il2CppClass* PatternLinkStack_t1510705438_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_NewLink_m629334431_MetadataUsageId; extern "C" LinkRef_t1270295572 * PatternCompiler_NewLink_m629334431 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_NewLink_m629334431_MetadataUsageId); s_Il2CppMethodIntialized = true; } { PatternLinkStack_t1510705438 * L_0 = (PatternLinkStack_t1510705438 *)il2cpp_codegen_object_new(PatternLinkStack_t1510705438_il2cpp_TypeInfo_var); PatternLinkStack__ctor_m451109823(L_0, /*hidden argument*/NULL); return L_0; } } // System.Void System.Text.RegularExpressions.PatternCompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) extern Il2CppClass* PatternLinkStack_t1510705438_il2cpp_TypeInfo_var; extern Il2CppClass* UInt16_t985925268_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_ResolveLink_m1754537234_MetadataUsageId; extern "C" void PatternCompiler_ResolveLink_m1754537234 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___lref0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_ResolveLink_m1754537234_MetadataUsageId); s_Il2CppMethodIntialized = true; } PatternLinkStack_t1510705438 * V_0 = NULL; { LinkRef_t1270295572 * L_0 = ___lref0; V_0 = ((PatternLinkStack_t1510705438 *)CastclassClass(L_0, PatternLinkStack_t1510705438_il2cpp_TypeInfo_var)); goto IL_002f; } IL_000c: { ArrayList_t2121638921 * L_1 = __this->get_pgm_0(); PatternLinkStack_t1510705438 * L_2 = V_0; NullCheck(L_2); int32_t L_3 = PatternLinkStack_get_OffsetAddress_m3032139717(L_2, /*hidden argument*/NULL); PatternLinkStack_t1510705438 * L_4 = V_0; int32_t L_5 = PatternCompiler_get_CurrentAddress_m1919164478(__this, /*hidden argument*/NULL); NullCheck(L_4); int32_t L_6 = PatternLinkStack_GetOffset_m222181543(L_4, L_5, /*hidden argument*/NULL); uint16_t L_7 = ((uint16_t)(((int32_t)((uint16_t)L_6)))); Il2CppObject * L_8 = Box(UInt16_t985925268_il2cpp_TypeInfo_var, &L_7); NullCheck(L_1); VirtActionInvoker2< int32_t, Il2CppObject * >::Invoke(19 /* System.Void System.Collections.ArrayList::set_Item(System.Int32,System.Object) */, L_1, L_3, L_8); } IL_002f: { PatternLinkStack_t1510705438 * L_9 = V_0; NullCheck(L_9); bool L_10 = LinkStack_Pop_m192057428(L_9, /*hidden argument*/NULL); if (L_10) { goto IL_000c; } } { return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitBranchEnd() extern "C" void PatternCompiler_EmitBranchEnd_m676018014 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { { return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitAlternationEnd() extern "C" void PatternCompiler_EmitAlternationEnd_m2098295803 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { { return; } } // System.Text.RegularExpressions.OpFlags System.Text.RegularExpressions.PatternCompiler::MakeFlags(System.Boolean,System.Boolean,System.Boolean,System.Boolean) extern "C" uint16_t PatternCompiler_MakeFlags_m1692978267 (Il2CppObject * __this /* static, unused */, bool ___negate0, bool ___ignore1, bool ___reverse2, bool ___lazy3, const MethodInfo* method) { uint16_t V_0 = 0; { V_0 = 0; bool L_0 = ___negate0; if (!L_0) { goto IL_0011; } } { uint16_t L_1 = V_0; V_0 = (((int32_t)((uint16_t)((int32_t)((int32_t)L_1|(int32_t)((int32_t)256)))))); } IL_0011: { bool L_2 = ___ignore1; if (!L_2) { goto IL_0020; } } { uint16_t L_3 = V_0; V_0 = (((int32_t)((uint16_t)((int32_t)((int32_t)L_3|(int32_t)((int32_t)512)))))); } IL_0020: { bool L_4 = ___reverse2; if (!L_4) { goto IL_002f; } } { uint16_t L_5 = V_0; V_0 = (((int32_t)((uint16_t)((int32_t)((int32_t)L_5|(int32_t)((int32_t)1024)))))); } IL_002f: { bool L_6 = ___lazy3; if (!L_6) { goto IL_003e; } } { uint16_t L_7 = V_0; V_0 = (((int32_t)((uint16_t)((int32_t)((int32_t)L_7|(int32_t)((int32_t)2048)))))); } IL_003e: { uint16_t L_8 = V_0; return L_8; } } // System.Void System.Text.RegularExpressions.PatternCompiler::Emit(System.Text.RegularExpressions.OpCode) extern "C" void PatternCompiler_Emit_m992741850 (PatternCompiler_t870195754 * __this, uint16_t ___op0, const MethodInfo* method) { { uint16_t L_0 = ___op0; PatternCompiler_Emit_m1318559571(__this, L_0, 0, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::Emit(System.Text.RegularExpressions.OpCode,System.Text.RegularExpressions.OpFlags) extern "C" void PatternCompiler_Emit_m1318559571 (PatternCompiler_t870195754 * __this, uint16_t ___op0, uint16_t ___flags1, const MethodInfo* method) { { uint16_t L_0 = ___op0; uint16_t L_1 = ___flags1; uint16_t L_2 = PatternCompiler_EncodeOp_m3438255148(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); PatternCompiler_Emit_m2066671991(__this, L_2, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::Emit(System.UInt16) extern Il2CppClass* UInt16_t985925268_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_Emit_m2066671991_MetadataUsageId; extern "C" void PatternCompiler_Emit_m2066671991 (PatternCompiler_t870195754 * __this, uint16_t ___word0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_Emit_m2066671991_MetadataUsageId); s_Il2CppMethodIntialized = true; } { ArrayList_t2121638921 * L_0 = __this->get_pgm_0(); uint16_t L_1 = ___word0; uint16_t L_2 = L_1; Il2CppObject * L_3 = Box(UInt16_t985925268_il2cpp_TypeInfo_var, &L_2); NullCheck(L_0); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_0, L_3); return; } } // System.Int32 System.Text.RegularExpressions.PatternCompiler::get_CurrentAddress() extern "C" int32_t PatternCompiler_get_CurrentAddress_m1919164478 (PatternCompiler_t870195754 * __this, const MethodInfo* method) { { ArrayList_t2121638921 * L_0 = __this->get_pgm_0(); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_0); return L_1; } } // System.Void System.Text.RegularExpressions.PatternCompiler::BeginLink(System.Text.RegularExpressions.LinkRef) extern Il2CppClass* PatternLinkStack_t1510705438_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_BeginLink_m4071458319_MetadataUsageId; extern "C" void PatternCompiler_BeginLink_m4071458319 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___lref0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_BeginLink_m4071458319_MetadataUsageId); s_Il2CppMethodIntialized = true; } PatternLinkStack_t1510705438 * V_0 = NULL; { LinkRef_t1270295572 * L_0 = ___lref0; V_0 = ((PatternLinkStack_t1510705438 *)CastclassClass(L_0, PatternLinkStack_t1510705438_il2cpp_TypeInfo_var)); PatternLinkStack_t1510705438 * L_1 = V_0; int32_t L_2 = PatternCompiler_get_CurrentAddress_m1919164478(__this, /*hidden argument*/NULL); NullCheck(L_1); PatternLinkStack_set_BaseAddress_m1841392820(L_1, L_2, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler::EmitLink(System.Text.RegularExpressions.LinkRef) extern Il2CppClass* PatternLinkStack_t1510705438_il2cpp_TypeInfo_var; extern const uint32_t PatternCompiler_EmitLink_m116538795_MetadataUsageId; extern "C" void PatternCompiler_EmitLink_m116538795 (PatternCompiler_t870195754 * __this, LinkRef_t1270295572 * ___lref0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternCompiler_EmitLink_m116538795_MetadataUsageId); s_Il2CppMethodIntialized = true; } PatternLinkStack_t1510705438 * V_0 = NULL; { LinkRef_t1270295572 * L_0 = ___lref0; V_0 = ((PatternLinkStack_t1510705438 *)CastclassClass(L_0, PatternLinkStack_t1510705438_il2cpp_TypeInfo_var)); PatternLinkStack_t1510705438 * L_1 = V_0; int32_t L_2 = PatternCompiler_get_CurrentAddress_m1919164478(__this, /*hidden argument*/NULL); NullCheck(L_1); PatternLinkStack_set_OffsetAddress_m2022131826(L_1, L_2, /*hidden argument*/NULL); PatternCompiler_Emit_m2066671991(__this, 0, /*hidden argument*/NULL); PatternLinkStack_t1510705438 * L_3 = V_0; NullCheck(L_3); LinkStack_Push_m185806851(L_3, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::.ctor() extern "C" void PatternLinkStack__ctor_m451109823 (PatternLinkStack_t1510705438 * __this, const MethodInfo* method) { { LinkStack__ctor_m840569467(__this, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::set_BaseAddress(System.Int32) extern "C" void PatternLinkStack_set_BaseAddress_m1841392820 (PatternLinkStack_t1510705438 * __this, int32_t ___value0, const MethodInfo* method) { { Link_t2368538 * L_0 = __this->get_address_of_link_1(); int32_t L_1 = ___value0; L_0->set_base_addr_0(L_1); return; } } // System.Int32 System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::get_OffsetAddress() extern "C" int32_t PatternLinkStack_get_OffsetAddress_m3032139717 (PatternLinkStack_t1510705438 * __this, const MethodInfo* method) { { Link_t2368538 * L_0 = __this->get_address_of_link_1(); int32_t L_1 = L_0->get_offset_addr_1(); return L_1; } } // System.Void System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::set_OffsetAddress(System.Int32) extern "C" void PatternLinkStack_set_OffsetAddress_m2022131826 (PatternLinkStack_t1510705438 * __this, int32_t ___value0, const MethodInfo* method) { { Link_t2368538 * L_0 = __this->get_address_of_link_1(); int32_t L_1 = ___value0; L_0->set_offset_addr_1(L_1); return; } } // System.Int32 System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::GetOffset(System.Int32) extern "C" int32_t PatternLinkStack_GetOffset_m222181543 (PatternLinkStack_t1510705438 * __this, int32_t ___target_addr0, const MethodInfo* method) { { int32_t L_0 = ___target_addr0; Link_t2368538 * L_1 = __this->get_address_of_link_1(); int32_t L_2 = L_1->get_base_addr_0(); return ((int32_t)((int32_t)L_0-(int32_t)L_2)); } } // System.Object System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::GetCurrent() extern Il2CppClass* Link_t2368538_il2cpp_TypeInfo_var; extern const uint32_t PatternLinkStack_GetCurrent_m3766647891_MetadataUsageId; extern "C" Il2CppObject * PatternLinkStack_GetCurrent_m3766647891 (PatternLinkStack_t1510705438 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternLinkStack_GetCurrent_m3766647891_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Link_t2368538 L_0 = __this->get_link_1(); Link_t2368538 L_1 = L_0; Il2CppObject * L_2 = Box(Link_t2368538_il2cpp_TypeInfo_var, &L_1); return L_2; } } // System.Void System.Text.RegularExpressions.PatternCompiler/PatternLinkStack::SetCurrent(System.Object) extern Il2CppClass* Link_t2368538_il2cpp_TypeInfo_var; extern const uint32_t PatternLinkStack_SetCurrent_m3645587320_MetadataUsageId; extern "C" void PatternLinkStack_SetCurrent_m3645587320 (PatternLinkStack_t1510705438 * __this, Il2CppObject * ___l0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PatternLinkStack_SetCurrent_m3645587320_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = ___l0; __this->set_link_1(((*(Link_t2368538 *)((Link_t2368538 *)UnBox (L_0, Link_t2368538_il2cpp_TypeInfo_var))))); return; } } // Conversion methods for marshalling of: System.Text.RegularExpressions.PatternCompiler/PatternLinkStack/Link extern "C" void Link_t2368538_marshal_pinvoke(const Link_t2368538& unmarshaled, Link_t2368538_marshaled_pinvoke& marshaled) { marshaled.___base_addr_0 = unmarshaled.get_base_addr_0(); marshaled.___offset_addr_1 = unmarshaled.get_offset_addr_1(); } extern "C" void Link_t2368538_marshal_pinvoke_back(const Link_t2368538_marshaled_pinvoke& marshaled, Link_t2368538& unmarshaled) { int32_t unmarshaled_base_addr_temp = 0; unmarshaled_base_addr_temp = marshaled.___base_addr_0; unmarshaled.set_base_addr_0(unmarshaled_base_addr_temp); int32_t unmarshaled_offset_addr_temp = 0; unmarshaled_offset_addr_temp = marshaled.___offset_addr_1; unmarshaled.set_offset_addr_1(unmarshaled_offset_addr_temp); } // Conversion method for clean up from marshalling of: System.Text.RegularExpressions.PatternCompiler/PatternLinkStack/Link extern "C" void Link_t2368538_marshal_pinvoke_cleanup(Link_t2368538_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: System.Text.RegularExpressions.PatternCompiler/PatternLinkStack/Link extern "C" void Link_t2368538_marshal_com(const Link_t2368538& unmarshaled, Link_t2368538_marshaled_com& marshaled) { marshaled.___base_addr_0 = unmarshaled.get_base_addr_0(); marshaled.___offset_addr_1 = unmarshaled.get_offset_addr_1(); } extern "C" void Link_t2368538_marshal_com_back(const Link_t2368538_marshaled_com& marshaled, Link_t2368538& unmarshaled) { int32_t unmarshaled_base_addr_temp = 0; unmarshaled_base_addr_temp = marshaled.___base_addr_0; unmarshaled.set_base_addr_0(unmarshaled_base_addr_temp); int32_t unmarshaled_offset_addr_temp = 0; unmarshaled_offset_addr_temp = marshaled.___offset_addr_1; unmarshaled.set_offset_addr_1(unmarshaled_offset_addr_temp); } // Conversion method for clean up from marshalling of: System.Text.RegularExpressions.PatternCompiler/PatternLinkStack/Link extern "C" void Link_t2368538_marshal_com_cleanup(Link_t2368538_marshaled_com& marshaled) { } // System.Void System.Text.RegularExpressions.QuickSearch::.ctor(System.String,System.Boolean,System.Boolean) extern Il2CppClass* QuickSearch_t1268643792_il2cpp_TypeInfo_var; extern const uint32_t QuickSearch__ctor_m2383021006_MetadataUsageId; extern "C" void QuickSearch__ctor_m2383021006 (QuickSearch_t1268643792 * __this, String_t* ___str0, bool ___ignore1, bool ___reverse2, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (QuickSearch__ctor_m2383021006_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); String_t* L_0 = ___str0; __this->set_str_0(L_0); String_t* L_1 = ___str0; NullCheck(L_1); int32_t L_2 = String_get_Length_m2979997331(L_1, /*hidden argument*/NULL); __this->set_len_1(L_2); bool L_3 = ___ignore1; __this->set_ignore_2(L_3); bool L_4 = ___reverse2; __this->set_reverse_3(L_4); bool L_5 = ___ignore1; if (!L_5) { goto IL_0035; } } { String_t* L_6 = ___str0; NullCheck(L_6); String_t* L_7 = String_ToLower_m2421900555(L_6, /*hidden argument*/NULL); ___str0 = L_7; } IL_0035: { int32_t L_8 = __this->get_len_1(); IL2CPP_RUNTIME_CLASS_INIT(QuickSearch_t1268643792_il2cpp_TypeInfo_var); int32_t L_9 = ((QuickSearch_t1268643792_StaticFields*)QuickSearch_t1268643792_il2cpp_TypeInfo_var->static_fields)->get_THRESHOLD_6(); if ((((int32_t)L_8) <= ((int32_t)L_9))) { goto IL_004b; } } { QuickSearch_SetupShiftTable_m73996795(__this, /*hidden argument*/NULL); } IL_004b: { return; } } // System.Void System.Text.RegularExpressions.QuickSearch::.cctor() extern Il2CppClass* QuickSearch_t1268643792_il2cpp_TypeInfo_var; extern const uint32_t QuickSearch__cctor_m3095711897_MetadataUsageId; extern "C" void QuickSearch__cctor_m3095711897 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (QuickSearch__cctor_m3095711897_MetadataUsageId); s_Il2CppMethodIntialized = true; } { ((QuickSearch_t1268643792_StaticFields*)QuickSearch_t1268643792_il2cpp_TypeInfo_var->static_fields)->set_THRESHOLD_6(5); return; } } // System.Int32 System.Text.RegularExpressions.QuickSearch::get_Length() extern "C" int32_t QuickSearch_get_Length_m2171114063 (QuickSearch_t1268643792 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_len_1(); return L_0; } } // System.Int32 System.Text.RegularExpressions.QuickSearch::Search(System.String,System.Int32,System.Int32) extern "C" int32_t QuickSearch_Search_m3059452826 (QuickSearch_t1268643792 * __this, String_t* ___text0, int32_t ___start1, int32_t ___end2, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; { int32_t L_0 = ___start1; V_0 = L_0; bool L_1 = __this->get_reverse_3(); if (!L_1) { goto IL_0107; } } { int32_t L_2 = ___start1; int32_t L_3 = ___end2; if ((((int32_t)L_2) >= ((int32_t)L_3))) { goto IL_0016; } } { return (-1); } IL_0016: { int32_t L_4 = V_0; String_t* L_5 = ___text0; NullCheck(L_5); int32_t L_6 = String_get_Length_m2979997331(L_5, /*hidden argument*/NULL); if ((((int32_t)L_4) <= ((int32_t)L_6))) { goto IL_0029; } } { String_t* L_7 = ___text0; NullCheck(L_7); int32_t L_8 = String_get_Length_m2979997331(L_7, /*hidden argument*/NULL); V_0 = L_8; } IL_0029: { int32_t L_9 = __this->get_len_1(); if ((!(((uint32_t)L_9) == ((uint32_t)1)))) { goto IL_0067; } } { goto IL_005a; } IL_003a: { String_t* L_10 = __this->get_str_0(); NullCheck(L_10); uint16_t L_11 = String_get_Chars_m3015341861(L_10, 0, /*hidden argument*/NULL); String_t* L_12 = ___text0; int32_t L_13 = V_0; NullCheck(L_12); uint16_t L_14 = String_get_Chars_m3015341861(L_12, L_13, /*hidden argument*/NULL); uint16_t L_15 = QuickSearch_GetChar_m2212630365(__this, L_14, /*hidden argument*/NULL); if ((!(((uint32_t)L_11) == ((uint32_t)L_15)))) { goto IL_005a; } } { int32_t L_16 = V_0; return L_16; } IL_005a: { int32_t L_17 = V_0; int32_t L_18 = ((int32_t)((int32_t)L_17-(int32_t)1)); V_0 = L_18; int32_t L_19 = ___end2; if ((((int32_t)L_18) >= ((int32_t)L_19))) { goto IL_003a; } } { return (-1); } IL_0067: { int32_t L_20 = ___end2; int32_t L_21 = __this->get_len_1(); if ((((int32_t)L_20) >= ((int32_t)L_21))) { goto IL_007d; } } { int32_t L_22 = __this->get_len_1(); ___end2 = ((int32_t)((int32_t)L_22-(int32_t)1)); } IL_007d: { int32_t L_23 = V_0; V_0 = ((int32_t)((int32_t)L_23-(int32_t)1)); goto IL_00fb; } IL_0086: { int32_t L_24 = __this->get_len_1(); V_1 = ((int32_t)((int32_t)L_24-(int32_t)1)); goto IL_00aa; } IL_0094: { int32_t L_25 = V_1; int32_t L_26 = ((int32_t)((int32_t)L_25-(int32_t)1)); V_1 = L_26; if ((((int32_t)L_26) >= ((int32_t)0))) { goto IL_00aa; } } { int32_t L_27 = V_0; int32_t L_28 = __this->get_len_1(); return ((int32_t)((int32_t)((int32_t)((int32_t)L_27-(int32_t)L_28))+(int32_t)1)); } IL_00aa: { String_t* L_29 = __this->get_str_0(); int32_t L_30 = V_1; NullCheck(L_29); uint16_t L_31 = String_get_Chars_m3015341861(L_29, L_30, /*hidden argument*/NULL); String_t* L_32 = ___text0; int32_t L_33 = V_0; int32_t L_34 = __this->get_len_1(); int32_t L_35 = V_1; NullCheck(L_32); uint16_t L_36 = String_get_Chars_m3015341861(L_32, ((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_33-(int32_t)L_34))+(int32_t)1))+(int32_t)L_35)), /*hidden argument*/NULL); uint16_t L_37 = QuickSearch_GetChar_m2212630365(__this, L_36, /*hidden argument*/NULL); if ((((int32_t)L_31) == ((int32_t)L_37))) { goto IL_0094; } } { int32_t L_38 = V_0; int32_t L_39 = ___end2; if ((((int32_t)L_38) <= ((int32_t)L_39))) { goto IL_00f6; } } { int32_t L_40 = V_0; String_t* L_41 = ___text0; int32_t L_42 = V_0; int32_t L_43 = __this->get_len_1(); NullCheck(L_41); uint16_t L_44 = String_get_Chars_m3015341861(L_41, ((int32_t)((int32_t)L_42-(int32_t)L_43)), /*hidden argument*/NULL); int32_t L_45 = QuickSearch_GetShiftDistance_m2673548988(__this, L_44, /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)L_40-(int32_t)L_45)); goto IL_00fb; } IL_00f6: { goto IL_0102; } IL_00fb: { int32_t L_46 = V_0; int32_t L_47 = ___end2; if ((((int32_t)L_46) >= ((int32_t)L_47))) { goto IL_0086; } } IL_0102: { goto IL_01d6; } IL_0107: { int32_t L_48 = __this->get_len_1(); if ((!(((uint32_t)L_48) == ((uint32_t)1)))) { goto IL_0145; } } { goto IL_013c; } IL_0118: { String_t* L_49 = __this->get_str_0(); NullCheck(L_49); uint16_t L_50 = String_get_Chars_m3015341861(L_49, 0, /*hidden argument*/NULL); String_t* L_51 = ___text0; int32_t L_52 = V_0; NullCheck(L_51); uint16_t L_53 = String_get_Chars_m3015341861(L_51, L_52, /*hidden argument*/NULL); uint16_t L_54 = QuickSearch_GetChar_m2212630365(__this, L_53, /*hidden argument*/NULL); if ((!(((uint32_t)L_50) == ((uint32_t)L_54)))) { goto IL_0138; } } { int32_t L_55 = V_0; return L_55; } IL_0138: { int32_t L_56 = V_0; V_0 = ((int32_t)((int32_t)L_56+(int32_t)1)); } IL_013c: { int32_t L_57 = V_0; int32_t L_58 = ___end2; if ((((int32_t)L_57) <= ((int32_t)L_58))) { goto IL_0118; } } { return (-1); } IL_0145: { int32_t L_59 = ___end2; String_t* L_60 = ___text0; NullCheck(L_60); int32_t L_61 = String_get_Length_m2979997331(L_60, /*hidden argument*/NULL); int32_t L_62 = __this->get_len_1(); if ((((int32_t)L_59) <= ((int32_t)((int32_t)((int32_t)L_61-(int32_t)L_62))))) { goto IL_0167; } } { String_t* L_63 = ___text0; NullCheck(L_63); int32_t L_64 = String_get_Length_m2979997331(L_63, /*hidden argument*/NULL); int32_t L_65 = __this->get_len_1(); ___end2 = ((int32_t)((int32_t)L_64-(int32_t)L_65)); } IL_0167: { goto IL_01cf; } IL_016c: { int32_t L_66 = __this->get_len_1(); V_2 = ((int32_t)((int32_t)L_66-(int32_t)1)); goto IL_0187; } IL_017a: { int32_t L_67 = V_2; int32_t L_68 = ((int32_t)((int32_t)L_67-(int32_t)1)); V_2 = L_68; if ((((int32_t)L_68) >= ((int32_t)0))) { goto IL_0187; } } { int32_t L_69 = V_0; return L_69; } IL_0187: { String_t* L_70 = __this->get_str_0(); int32_t L_71 = V_2; NullCheck(L_70); uint16_t L_72 = String_get_Chars_m3015341861(L_70, L_71, /*hidden argument*/NULL); String_t* L_73 = ___text0; int32_t L_74 = V_0; int32_t L_75 = V_2; NullCheck(L_73); uint16_t L_76 = String_get_Chars_m3015341861(L_73, ((int32_t)((int32_t)L_74+(int32_t)L_75)), /*hidden argument*/NULL); uint16_t L_77 = QuickSearch_GetChar_m2212630365(__this, L_76, /*hidden argument*/NULL); if ((((int32_t)L_72) == ((int32_t)L_77))) { goto IL_017a; } } { int32_t L_78 = V_0; int32_t L_79 = ___end2; if ((((int32_t)L_78) >= ((int32_t)L_79))) { goto IL_01ca; } } { int32_t L_80 = V_0; String_t* L_81 = ___text0; int32_t L_82 = V_0; int32_t L_83 = __this->get_len_1(); NullCheck(L_81); uint16_t L_84 = String_get_Chars_m3015341861(L_81, ((int32_t)((int32_t)L_82+(int32_t)L_83)), /*hidden argument*/NULL); int32_t L_85 = QuickSearch_GetShiftDistance_m2673548988(__this, L_84, /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)L_80+(int32_t)L_85)); goto IL_01cf; } IL_01ca: { goto IL_01d6; } IL_01cf: { int32_t L_86 = V_0; int32_t L_87 = ___end2; if ((((int32_t)L_86) <= ((int32_t)L_87))) { goto IL_016c; } } IL_01d6: { return (-1); } } // System.Void System.Text.RegularExpressions.QuickSearch::SetupShiftTable() extern Il2CppClass* ByteU5BU5D_t58506160_il2cpp_TypeInfo_var; extern Il2CppClass* Hashtable_t3875263730_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern const uint32_t QuickSearch_SetupShiftTable_m73996795_MetadataUsageId; extern "C" void QuickSearch_SetupShiftTable_m73996795 (QuickSearch_t1268643792 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (QuickSearch_SetupShiftTable_m73996795_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; uint8_t V_1 = 0x0; int32_t V_2 = 0; uint16_t V_3 = 0x0; int32_t V_4 = 0; int32_t V_5 = 0; uint16_t V_6 = 0x0; String_t* G_B13_0 = NULL; String_t* G_B12_0 = NULL; int32_t G_B14_0 = 0; String_t* G_B14_1 = NULL; { int32_t L_0 = __this->get_len_1(); V_0 = (bool)((((int32_t)L_0) > ((int32_t)((int32_t)254)))? 1 : 0); V_1 = 0; V_2 = 0; goto IL_0045; } IL_0017: { String_t* L_1 = __this->get_str_0(); int32_t L_2 = V_2; NullCheck(L_1); uint16_t L_3 = String_get_Chars_m3015341861(L_1, L_2, /*hidden argument*/NULL); V_3 = L_3; uint16_t L_4 = V_3; if ((((int32_t)L_4) > ((int32_t)((int32_t)255)))) { goto IL_003f; } } { uint16_t L_5 = V_3; uint8_t L_6 = V_1; if ((((int32_t)(((int32_t)((uint8_t)L_5)))) <= ((int32_t)L_6))) { goto IL_003a; } } { uint16_t L_7 = V_3; V_1 = (((int32_t)((uint8_t)L_7))); } IL_003a: { goto IL_0041; } IL_003f: { V_0 = (bool)1; } IL_0041: { int32_t L_8 = V_2; V_2 = ((int32_t)((int32_t)L_8+(int32_t)1)); } IL_0045: { int32_t L_9 = V_2; int32_t L_10 = __this->get_len_1(); if ((((int32_t)L_9) < ((int32_t)L_10))) { goto IL_0017; } } { uint8_t L_11 = V_1; __this->set_shift_4(((ByteU5BU5D_t58506160*)SZArrayNew(ByteU5BU5D_t58506160_il2cpp_TypeInfo_var, (uint32_t)((int32_t)((int32_t)L_11+(int32_t)1))))); bool L_12 = V_0; if (!L_12) { goto IL_0070; } } { Hashtable_t3875263730 * L_13 = (Hashtable_t3875263730 *)il2cpp_codegen_object_new(Hashtable_t3875263730_il2cpp_TypeInfo_var); Hashtable__ctor_m1514037738(L_13, /*hidden argument*/NULL); __this->set_shiftExtended_5(L_13); } IL_0070: { V_4 = 0; int32_t L_14 = __this->get_len_1(); V_5 = L_14; goto IL_0102; } IL_0080: { String_t* L_15 = __this->get_str_0(); bool L_16 = __this->get_reverse_3(); G_B12_0 = L_15; if (L_16) { G_B13_0 = L_15; goto IL_0098; } } { int32_t L_17 = V_4; G_B14_0 = L_17; G_B14_1 = G_B12_0; goto IL_009c; } IL_0098: { int32_t L_18 = V_5; G_B14_0 = ((int32_t)((int32_t)L_18-(int32_t)1)); G_B14_1 = G_B13_0; } IL_009c: { NullCheck(G_B14_1); uint16_t L_19 = String_get_Chars_m3015341861(G_B14_1, G_B14_0, /*hidden argument*/NULL); V_6 = L_19; uint16_t L_20 = V_6; ByteU5BU5D_t58506160* L_21 = __this->get_shift_4(); NullCheck(L_21); if ((((int32_t)L_20) >= ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_21)->max_length))))))) { goto IL_00dd; } } { int32_t L_22 = V_5; if ((((int32_t)L_22) >= ((int32_t)((int32_t)255)))) { goto IL_00cf; } } { ByteU5BU5D_t58506160* L_23 = __this->get_shift_4(); uint16_t L_24 = V_6; int32_t L_25 = V_5; NullCheck(L_23); IL2CPP_ARRAY_BOUNDS_CHECK(L_23, L_24); (L_23)->SetAt(static_cast<il2cpp_array_size_t>(L_24), (uint8_t)(((int32_t)((uint8_t)L_25)))); goto IL_00f6; } IL_00cf: { ByteU5BU5D_t58506160* L_26 = __this->get_shift_4(); uint16_t L_27 = V_6; NullCheck(L_26); IL2CPP_ARRAY_BOUNDS_CHECK(L_26, L_27); (L_26)->SetAt(static_cast<il2cpp_array_size_t>(L_27), (uint8_t)((int32_t)255)); } IL_00dd: { Hashtable_t3875263730 * L_28 = __this->get_shiftExtended_5(); uint16_t L_29 = V_6; uint16_t L_30 = L_29; Il2CppObject * L_31 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_30); int32_t L_32 = V_5; int32_t L_33 = L_32; Il2CppObject * L_34 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_33); NullCheck(L_28); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(21 /* System.Void System.Collections.Hashtable::set_Item(System.Object,System.Object) */, L_28, L_31, L_34); } IL_00f6: { int32_t L_35 = V_4; V_4 = ((int32_t)((int32_t)L_35+(int32_t)1)); int32_t L_36 = V_5; V_5 = ((int32_t)((int32_t)L_36-(int32_t)1)); } IL_0102: { int32_t L_37 = V_4; int32_t L_38 = __this->get_len_1(); if ((((int32_t)L_37) < ((int32_t)L_38))) { goto IL_0080; } } { return; } } // System.Int32 System.Text.RegularExpressions.QuickSearch::GetShiftDistance(System.Char) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern const uint32_t QuickSearch_GetShiftDistance_m2673548988_MetadataUsageId; extern "C" int32_t QuickSearch_GetShiftDistance_m2673548988 (QuickSearch_t1268643792 * __this, uint16_t ___c0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (QuickSearch_GetShiftDistance_m2673548988_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; Il2CppObject * V_1 = NULL; int32_t G_B15_0 = 0; { ByteU5BU5D_t58506160* L_0 = __this->get_shift_4(); if (L_0) { goto IL_000d; } } { return 1; } IL_000d: { uint16_t L_1 = ___c0; uint16_t L_2 = QuickSearch_GetChar_m2212630365(__this, L_1, /*hidden argument*/NULL); ___c0 = L_2; uint16_t L_3 = ___c0; ByteU5BU5D_t58506160* L_4 = __this->get_shift_4(); NullCheck(L_4); if ((((int32_t)L_3) >= ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_4)->max_length))))))) { goto IL_004e; } } { ByteU5BU5D_t58506160* L_5 = __this->get_shift_4(); uint16_t L_6 = ___c0; NullCheck(L_5); IL2CPP_ARRAY_BOUNDS_CHECK(L_5, L_6); uint16_t L_7 = L_6; V_0 = ((L_5)->GetAt(static_cast<il2cpp_array_size_t>(L_7))); int32_t L_8 = V_0; if (L_8) { goto IL_003c; } } { int32_t L_9 = __this->get_len_1(); return ((int32_t)((int32_t)L_9+(int32_t)1)); } IL_003c: { int32_t L_10 = V_0; if ((((int32_t)L_10) == ((int32_t)((int32_t)255)))) { goto IL_0049; } } { int32_t L_11 = V_0; return L_11; } IL_0049: { goto IL_0062; } IL_004e: { uint16_t L_12 = ___c0; if ((((int32_t)L_12) >= ((int32_t)((int32_t)255)))) { goto IL_0062; } } { int32_t L_13 = __this->get_len_1(); return ((int32_t)((int32_t)L_13+(int32_t)1)); } IL_0062: { Hashtable_t3875263730 * L_14 = __this->get_shiftExtended_5(); if (L_14) { goto IL_0076; } } { int32_t L_15 = __this->get_len_1(); return ((int32_t)((int32_t)L_15+(int32_t)1)); } IL_0076: { Hashtable_t3875263730 * L_16 = __this->get_shiftExtended_5(); uint16_t L_17 = ___c0; uint16_t L_18 = L_17; Il2CppObject * L_19 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_18); NullCheck(L_16); Il2CppObject * L_20 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_16, L_19); V_1 = L_20; Il2CppObject * L_21 = V_1; if (!L_21) { goto IL_0099; } } { Il2CppObject * L_22 = V_1; G_B15_0 = ((*(int32_t*)((int32_t*)UnBox (L_22, Int32_t2847414787_il2cpp_TypeInfo_var)))); goto IL_00a1; } IL_0099: { int32_t L_23 = __this->get_len_1(); G_B15_0 = ((int32_t)((int32_t)L_23+(int32_t)1)); } IL_00a1: { return G_B15_0; } } // System.Char System.Text.RegularExpressions.QuickSearch::GetChar(System.Char) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t QuickSearch_GetChar_m2212630365_MetadataUsageId; extern "C" uint16_t QuickSearch_GetChar_m2212630365 (QuickSearch_t1268643792 * __this, uint16_t ___c0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (QuickSearch_GetChar_m2212630365_MetadataUsageId); s_Il2CppMethodIntialized = true; } uint16_t G_B3_0 = 0x0; { bool L_0 = __this->get_ignore_2(); if (L_0) { goto IL_0011; } } { uint16_t L_1 = ___c0; G_B3_0 = L_1; goto IL_0017; } IL_0011: { uint16_t L_2 = ___c0; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); uint16_t L_3 = Char_ToLower_m3095077372(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); G_B3_0 = L_3; } IL_0017: { return G_B3_0; } } // System.Void System.Text.RegularExpressions.Regex::.ctor() extern "C" void Regex__ctor_m523653122 (Regex_t3802381858 * __this, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Regex::.ctor(System.String) extern "C" void Regex__ctor_m2980635200 (Regex_t3802381858 * __this, String_t* ___pattern0, const MethodInfo* method) { { String_t* L_0 = ___pattern0; Regex__ctor_m2068483208(__this, L_0, 0, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Regex::.ctor(System.String,System.Text.RegularExpressions.RegexOptions) extern Il2CppClass* ArgumentNullException_t3214793280_il2cpp_TypeInfo_var; extern Il2CppClass* Regex_t3802381858_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3503877008; extern const uint32_t Regex__ctor_m2068483208_MetadataUsageId; extern "C" void Regex__ctor_m2068483208 (Regex_t3802381858 * __this, String_t* ___pattern0, int32_t ___options1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex__ctor_m2068483208_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); String_t* L_0 = ___pattern0; if (L_0) { goto IL_0017; } } { ArgumentNullException_t3214793280 * L_1 = (ArgumentNullException_t3214793280 *)il2cpp_codegen_object_new(ArgumentNullException_t3214793280_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m135444188(L_1, _stringLiteral3503877008, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0017: { int32_t L_2 = ___options1; IL2CPP_RUNTIME_CLASS_INIT(Regex_t3802381858_il2cpp_TypeInfo_var); Regex_validate_options_m625353623(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); String_t* L_3 = ___pattern0; __this->set_pattern_7(L_3); int32_t L_4 = ___options1; __this->set_roptions_8(L_4); Regex_Init_m938259986(__this, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Regex::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern const Il2CppType* RegexOptions_t2783621746_0_0_0_var; extern Il2CppClass* Type_t_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3503877008; extern Il2CppCodeGenString* _stringLiteral3045492382; extern const uint32_t Regex__ctor_m1618790979_MetadataUsageId; extern "C" void Regex__ctor_m1618790979 (Regex_t3802381858 * __this, SerializationInfo_t2995724695 * ___info0, StreamingContext_t986364934 ___context1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex__ctor_m1618790979_MetadataUsageId); s_Il2CppMethodIntialized = true; } { SerializationInfo_t2995724695 * L_0 = ___info0; NullCheck(L_0); String_t* L_1 = SerializationInfo_GetString_m52579033(L_0, _stringLiteral3503877008, /*hidden argument*/NULL); SerializationInfo_t2995724695 * L_2 = ___info0; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_3 = Type_GetTypeFromHandle_m3806905434(NULL /*static, unused*/, LoadTypeToken(RegexOptions_t2783621746_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_2); Il2CppObject * L_4 = SerializationInfo_GetValue_m4125471336(L_2, _stringLiteral3045492382, L_3, /*hidden argument*/NULL); Regex__ctor_m2068483208(__this, L_1, ((*(int32_t*)((int32_t*)UnBox (L_4, Int32_t2847414787_il2cpp_TypeInfo_var)))), /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Regex::.cctor() extern Il2CppClass* FactoryCache_t1981134515_il2cpp_TypeInfo_var; extern Il2CppClass* Regex_t3802381858_il2cpp_TypeInfo_var; extern const uint32_t Regex__cctor_m2866248683_MetadataUsageId; extern "C" void Regex__cctor_m2866248683 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex__cctor_m2866248683_MetadataUsageId); s_Il2CppMethodIntialized = true; } { FactoryCache_t1981134515 * L_0 = (FactoryCache_t1981134515 *)il2cpp_codegen_object_new(FactoryCache_t1981134515_il2cpp_TypeInfo_var); FactoryCache__ctor_m3600817686(L_0, ((int32_t)15), /*hidden argument*/NULL); ((Regex_t3802381858_StaticFields*)Regex_t3802381858_il2cpp_TypeInfo_var->static_fields)->set_cache_0(L_0); return; } } // System.Void System.Text.RegularExpressions.Regex::System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern const Il2CppType* String_t_0_0_0_var; extern const Il2CppType* RegexOptions_t2783621746_0_0_0_var; extern Il2CppClass* Type_t_il2cpp_TypeInfo_var; extern Il2CppClass* RegexOptions_t2783621746_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3503877008; extern Il2CppCodeGenString* _stringLiteral3045492382; extern const uint32_t Regex_System_Runtime_Serialization_ISerializable_GetObjectData_m522480713_MetadataUsageId; extern "C" void Regex_System_Runtime_Serialization_ISerializable_GetObjectData_m522480713 (Regex_t3802381858 * __this, SerializationInfo_t2995724695 * ___info0, StreamingContext_t986364934 ___context1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_System_Runtime_Serialization_ISerializable_GetObjectData_m522480713_MetadataUsageId); s_Il2CppMethodIntialized = true; } { SerializationInfo_t2995724695 * L_0 = ___info0; String_t* L_1 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Text.RegularExpressions.Regex::ToString() */, __this); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_2 = Type_GetTypeFromHandle_m3806905434(NULL /*static, unused*/, LoadTypeToken(String_t_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_0); SerializationInfo_AddValue_m3341936982(L_0, _stringLiteral3503877008, L_1, L_2, /*hidden argument*/NULL); SerializationInfo_t2995724695 * L_3 = ___info0; int32_t L_4 = Regex_get_Options_m3928047814(__this, /*hidden argument*/NULL); int32_t L_5 = L_4; Il2CppObject * L_6 = Box(RegexOptions_t2783621746_il2cpp_TypeInfo_var, &L_5); Type_t * L_7 = Type_GetTypeFromHandle_m3806905434(NULL /*static, unused*/, LoadTypeToken(RegexOptions_t2783621746_0_0_0_var), /*hidden argument*/NULL); NullCheck(L_3); SerializationInfo_AddValue_m3341936982(L_3, _stringLiteral3045492382, L_6, L_7, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Regex::validate_options(System.Text.RegularExpressions.RegexOptions) extern Il2CppClass* ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3045492382; extern const uint32_t Regex_validate_options_m625353623_MetadataUsageId; extern "C" void Regex_validate_options_m625353623 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_validate_options_m625353623_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; { int32_t L_0 = ___options0; if (!((int32_t)((int32_t)L_0&(int32_t)((int32_t)-888)))) { goto IL_0017; } } { ArgumentOutOfRangeException_t3479058991 * L_1 = (ArgumentOutOfRangeException_t3479058991 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m2026296331(L_1, _stringLiteral3045492382, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0017: { int32_t L_2 = ___options0; if (!((int32_t)((int32_t)L_2&(int32_t)((int32_t)256)))) { goto IL_003a; } } { int32_t L_3 = ___options0; if (!((int32_t)((int32_t)L_3&(int32_t)((int32_t)-260)))) { goto IL_003a; } } { ArgumentOutOfRangeException_t3479058991 * L_4 = (ArgumentOutOfRangeException_t3479058991 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m2026296331(L_4, _stringLiteral3045492382, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4); } IL_003a: { return; } } // System.Void System.Text.RegularExpressions.Regex::Init() extern Il2CppClass* Regex_t3802381858_il2cpp_TypeInfo_var; extern Il2CppClass* IMachineFactory_t1224363367_il2cpp_TypeInfo_var; extern const uint32_t Regex_Init_m938259986_MetadataUsageId; extern "C" void Regex_Init_m938259986 (Regex_t3802381858 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_Init_m938259986_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Regex_t3802381858_il2cpp_TypeInfo_var); FactoryCache_t1981134515 * L_0 = ((Regex_t3802381858_StaticFields*)Regex_t3802381858_il2cpp_TypeInfo_var->static_fields)->get_cache_0(); String_t* L_1 = __this->get_pattern_7(); int32_t L_2 = __this->get_roptions_8(); NullCheck(L_0); Il2CppObject * L_3 = FactoryCache_Lookup_m418619505(L_0, L_1, L_2, /*hidden argument*/NULL); __this->set_machineFactory_1(L_3); Il2CppObject * L_4 = __this->get_machineFactory_1(); if (L_4) { goto IL_0032; } } { Regex_InitNewRegex_m2419508729(__this, /*hidden argument*/NULL); goto IL_0076; } IL_0032: { Il2CppObject * L_5 = __this->get_machineFactory_1(); NullCheck(L_5); int32_t L_6 = InterfaceFuncInvoker0< int32_t >::Invoke(3 /* System.Int32 System.Text.RegularExpressions.IMachineFactory::get_GroupCount() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_5); __this->set_group_count_3(L_6); Il2CppObject * L_7 = __this->get_machineFactory_1(); NullCheck(L_7); int32_t L_8 = InterfaceFuncInvoker0< int32_t >::Invoke(4 /* System.Int32 System.Text.RegularExpressions.IMachineFactory::get_Gap() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_7); __this->set_gap_4(L_8); Il2CppObject * L_9 = __this->get_machineFactory_1(); NullCheck(L_9); Il2CppObject * L_10 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(1 /* System.Collections.IDictionary System.Text.RegularExpressions.IMachineFactory::get_Mapping() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_9); __this->set_mapping_2(L_10); Il2CppObject * L_11 = __this->get_machineFactory_1(); NullCheck(L_11); StringU5BU5D_t2956870243* L_12 = InterfaceFuncInvoker0< StringU5BU5D_t2956870243* >::Invoke(6 /* System.String[] System.Text.RegularExpressions.IMachineFactory::get_NamesMapping() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_11); __this->set_group_names_5(L_12); } IL_0076: { return; } } // System.Void System.Text.RegularExpressions.Regex::InitNewRegex() extern Il2CppClass* Regex_t3802381858_il2cpp_TypeInfo_var; extern Il2CppClass* IMachineFactory_t1224363367_il2cpp_TypeInfo_var; extern const uint32_t Regex_InitNewRegex_m2419508729_MetadataUsageId; extern "C" void Regex_InitNewRegex_m2419508729 (Regex_t3802381858 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_InitNewRegex_m2419508729_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = __this->get_pattern_7(); int32_t L_1 = __this->get_roptions_8(); IL2CPP_RUNTIME_CLASS_INIT(Regex_t3802381858_il2cpp_TypeInfo_var); Il2CppObject * L_2 = Regex_CreateMachineFactory_m2347116393(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); __this->set_machineFactory_1(L_2); FactoryCache_t1981134515 * L_3 = ((Regex_t3802381858_StaticFields*)Regex_t3802381858_il2cpp_TypeInfo_var->static_fields)->get_cache_0(); String_t* L_4 = __this->get_pattern_7(); int32_t L_5 = __this->get_roptions_8(); Il2CppObject * L_6 = __this->get_machineFactory_1(); NullCheck(L_3); FactoryCache_Add_m2875491713(L_3, L_4, L_5, L_6, /*hidden argument*/NULL); Il2CppObject * L_7 = __this->get_machineFactory_1(); NullCheck(L_7); int32_t L_8 = InterfaceFuncInvoker0< int32_t >::Invoke(3 /* System.Int32 System.Text.RegularExpressions.IMachineFactory::get_GroupCount() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_7); __this->set_group_count_3(L_8); Il2CppObject * L_9 = __this->get_machineFactory_1(); NullCheck(L_9); int32_t L_10 = InterfaceFuncInvoker0< int32_t >::Invoke(4 /* System.Int32 System.Text.RegularExpressions.IMachineFactory::get_Gap() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_9); __this->set_gap_4(L_10); Il2CppObject * L_11 = __this->get_machineFactory_1(); NullCheck(L_11); Il2CppObject * L_12 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(1 /* System.Collections.IDictionary System.Text.RegularExpressions.IMachineFactory::get_Mapping() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_11); __this->set_mapping_2(L_12); Il2CppObject * L_13 = __this->get_machineFactory_1(); NullCheck(L_13); StringU5BU5D_t2956870243* L_14 = InterfaceFuncInvoker0< StringU5BU5D_t2956870243* >::Invoke(6 /* System.String[] System.Text.RegularExpressions.IMachineFactory::get_NamesMapping() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_13); __this->set_group_names_5(L_14); return; } } // System.Text.RegularExpressions.IMachineFactory System.Text.RegularExpressions.Regex::CreateMachineFactory(System.String,System.Text.RegularExpressions.RegexOptions) extern Il2CppClass* Parser_t3684504143_il2cpp_TypeInfo_var; extern Il2CppClass* PatternCompiler_t870195754_il2cpp_TypeInfo_var; extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern Il2CppClass* Hashtable_t3875263730_il2cpp_TypeInfo_var; extern Il2CppClass* IMachineFactory_t1224363367_il2cpp_TypeInfo_var; extern Il2CppClass* Regex_t3802381858_il2cpp_TypeInfo_var; extern const uint32_t Regex_CreateMachineFactory_m2347116393_MetadataUsageId; extern "C" Il2CppObject * Regex_CreateMachineFactory_m2347116393 (Il2CppObject * __this /* static, unused */, String_t* ___pattern0, int32_t ___options1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_CreateMachineFactory_m2347116393_MetadataUsageId); s_Il2CppMethodIntialized = true; } Parser_t3684504143 * V_0 = NULL; RegularExpression_t1734534468 * V_1 = NULL; Il2CppObject * V_2 = NULL; Il2CppObject * V_3 = NULL; Hashtable_t3875263730 * V_4 = NULL; { Parser_t3684504143 * L_0 = (Parser_t3684504143 *)il2cpp_codegen_object_new(Parser_t3684504143_il2cpp_TypeInfo_var); Parser__ctor_m1404972287(L_0, /*hidden argument*/NULL); V_0 = L_0; Parser_t3684504143 * L_1 = V_0; String_t* L_2 = ___pattern0; int32_t L_3 = ___options1; NullCheck(L_1); RegularExpression_t1734534468 * L_4 = Parser_ParseRegularExpression_m3601917447(L_1, L_2, L_3, /*hidden argument*/NULL); V_1 = L_4; PatternCompiler_t870195754 * L_5 = (PatternCompiler_t870195754 *)il2cpp_codegen_object_new(PatternCompiler_t870195754_il2cpp_TypeInfo_var); PatternCompiler__ctor_m640185722(L_5, /*hidden argument*/NULL); V_2 = L_5; RegularExpression_t1734534468 * L_6 = V_1; Il2CppObject * L_7 = V_2; int32_t L_8 = ___options1; NullCheck(L_6); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.RegularExpression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_6, L_7, (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_8&(int32_t)((int32_t)64)))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0)); Il2CppObject * L_9 = V_2; NullCheck(L_9); Il2CppObject * L_10 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Text.RegularExpressions.IMachineFactory System.Text.RegularExpressions.ICompiler::GetMachineFactory() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_9); V_3 = L_10; Hashtable_t3875263730 * L_11 = (Hashtable_t3875263730 *)il2cpp_codegen_object_new(Hashtable_t3875263730_il2cpp_TypeInfo_var); Hashtable__ctor_m1514037738(L_11, /*hidden argument*/NULL); V_4 = L_11; Il2CppObject * L_12 = V_3; Parser_t3684504143 * L_13 = V_0; Hashtable_t3875263730 * L_14 = V_4; NullCheck(L_13); int32_t L_15 = Parser_GetMapping_m2242103141(L_13, L_14, /*hidden argument*/NULL); NullCheck(L_12); InterfaceActionInvoker1< int32_t >::Invoke(5 /* System.Void System.Text.RegularExpressions.IMachineFactory::set_Gap(System.Int32) */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_12, L_15); Il2CppObject * L_16 = V_3; Hashtable_t3875263730 * L_17 = V_4; NullCheck(L_16); InterfaceActionInvoker1< Il2CppObject * >::Invoke(2 /* System.Void System.Text.RegularExpressions.IMachineFactory::set_Mapping(System.Collections.IDictionary) */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_16, L_17); Il2CppObject * L_18 = V_3; Il2CppObject * L_19 = V_3; NullCheck(L_19); int32_t L_20 = InterfaceFuncInvoker0< int32_t >::Invoke(3 /* System.Int32 System.Text.RegularExpressions.IMachineFactory::get_GroupCount() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_19); Il2CppObject * L_21 = V_3; NullCheck(L_21); Il2CppObject * L_22 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(1 /* System.Collections.IDictionary System.Text.RegularExpressions.IMachineFactory::get_Mapping() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_21); IL2CPP_RUNTIME_CLASS_INIT(Regex_t3802381858_il2cpp_TypeInfo_var); StringU5BU5D_t2956870243* L_23 = Regex_GetGroupNamesArray_m3739926801(NULL /*static, unused*/, L_20, L_22, /*hidden argument*/NULL); NullCheck(L_18); InterfaceActionInvoker1< StringU5BU5D_t2956870243* >::Invoke(7 /* System.Void System.Text.RegularExpressions.IMachineFactory::set_NamesMapping(System.String[]) */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_18, L_23); Il2CppObject * L_24 = V_3; return L_24; } } // System.Text.RegularExpressions.RegexOptions System.Text.RegularExpressions.Regex::get_Options() extern "C" int32_t Regex_get_Options_m3928047814 (Regex_t3802381858 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_roptions_8(); return L_0; } } // System.Boolean System.Text.RegularExpressions.Regex::get_RightToLeft() extern "C" bool Regex_get_RightToLeft_m3494755007 (Regex_t3802381858 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_roptions_8(); return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)((int32_t)64)))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Int32 System.Text.RegularExpressions.Regex::GetGroupIndex(System.Int32) extern const MethodInfo* Array_BinarySearch_TisInt32_t2847414787_m3080908590_MethodInfo_var; extern const uint32_t Regex_GetGroupIndex_m547759882_MetadataUsageId; extern "C" int32_t Regex_GetGroupIndex_m547759882 (Regex_t3802381858 * __this, int32_t ___number0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_GetGroupIndex_m547759882_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t L_0 = ___number0; int32_t L_1 = __this->get_gap_4(); if ((((int32_t)L_0) >= ((int32_t)L_1))) { goto IL_000e; } } { int32_t L_2 = ___number0; return L_2; } IL_000e: { int32_t L_3 = __this->get_gap_4(); int32_t L_4 = __this->get_group_count_3(); if ((((int32_t)L_3) <= ((int32_t)L_4))) { goto IL_0021; } } { return (-1); } IL_0021: { Int32U5BU5D_t1809983122* L_5 = Regex_get_GroupNumbers_m2500558052(__this, /*hidden argument*/NULL); int32_t L_6 = __this->get_gap_4(); int32_t L_7 = __this->get_group_count_3(); int32_t L_8 = __this->get_gap_4(); int32_t L_9 = ___number0; int32_t L_10 = Array_BinarySearch_TisInt32_t2847414787_m3080908590(NULL /*static, unused*/, L_5, L_6, ((int32_t)((int32_t)((int32_t)((int32_t)L_7-(int32_t)L_8))+(int32_t)1)), L_9, /*hidden argument*/Array_BinarySearch_TisInt32_t2847414787_m3080908590_MethodInfo_var); return L_10; } } // System.Int32 System.Text.RegularExpressions.Regex::default_startat(System.String) extern "C" int32_t Regex_default_startat_m996366267 (Regex_t3802381858 * __this, String_t* ___input0, const MethodInfo* method) { int32_t G_B4_0 = 0; { bool L_0 = Regex_get_RightToLeft_m3494755007(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_001c; } } { String_t* L_1 = ___input0; if (!L_1) { goto IL_001c; } } { String_t* L_2 = ___input0; NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); G_B4_0 = L_3; goto IL_001d; } IL_001c: { G_B4_0 = 0; } IL_001d: { return G_B4_0; } } // System.Boolean System.Text.RegularExpressions.Regex::IsMatch(System.String) extern "C" bool Regex_IsMatch_m2967892253 (Regex_t3802381858 * __this, String_t* ___input0, const MethodInfo* method) { { String_t* L_0 = ___input0; String_t* L_1 = ___input0; int32_t L_2 = Regex_default_startat_m996366267(__this, L_1, /*hidden argument*/NULL); bool L_3 = Regex_IsMatch_m3759940314(__this, L_0, L_2, /*hidden argument*/NULL); return L_3; } } // System.Boolean System.Text.RegularExpressions.Regex::IsMatch(System.String,System.Int32) extern "C" bool Regex_IsMatch_m3759940314 (Regex_t3802381858 * __this, String_t* ___input0, int32_t ___startat1, const MethodInfo* method) { { String_t* L_0 = ___input0; int32_t L_1 = ___startat1; Match_t3797657504 * L_2 = Regex_Match_m1021969427(__this, L_0, L_1, /*hidden argument*/NULL); NullCheck(L_2); bool L_3 = Group_get_Success_m3627958764(L_2, /*hidden argument*/NULL); return L_3; } } // System.Text.RegularExpressions.Match System.Text.RegularExpressions.Regex::Match(System.String,System.Int32) extern Il2CppClass* ArgumentNullException_t3214793280_il2cpp_TypeInfo_var; extern Il2CppClass* ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var; extern Il2CppClass* IMachine_t294675897_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral100358090; extern Il2CppCodeGenString* _stringLiteral2397782037; extern const uint32_t Regex_Match_m1021969427_MetadataUsageId; extern "C" Match_t3797657504 * Regex_Match_m1021969427 (Regex_t3802381858 * __this, String_t* ___input0, int32_t ___startat1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_Match_m1021969427_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___input0; if (L_0) { goto IL_0011; } } { ArgumentNullException_t3214793280 * L_1 = (ArgumentNullException_t3214793280 *)il2cpp_codegen_object_new(ArgumentNullException_t3214793280_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m135444188(L_1, _stringLiteral100358090, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0011: { int32_t L_2 = ___startat1; if ((((int32_t)L_2) < ((int32_t)0))) { goto IL_0024; } } { int32_t L_3 = ___startat1; String_t* L_4 = ___input0; NullCheck(L_4); int32_t L_5 = String_get_Length_m2979997331(L_4, /*hidden argument*/NULL); if ((((int32_t)L_3) <= ((int32_t)L_5))) { goto IL_002f; } } IL_0024: { ArgumentOutOfRangeException_t3479058991 * L_6 = (ArgumentOutOfRangeException_t3479058991 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m2026296331(L_6, _stringLiteral2397782037, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_6); } IL_002f: { Il2CppObject * L_7 = Regex_CreateMachine_m1572823491(__this, /*hidden argument*/NULL); String_t* L_8 = ___input0; int32_t L_9 = ___startat1; String_t* L_10 = ___input0; NullCheck(L_10); int32_t L_11 = String_get_Length_m2979997331(L_10, /*hidden argument*/NULL); NullCheck(L_7); Match_t3797657504 * L_12 = InterfaceFuncInvoker4< Match_t3797657504 *, Regex_t3802381858 *, String_t*, int32_t, int32_t >::Invoke(0 /* System.Text.RegularExpressions.Match System.Text.RegularExpressions.IMachine::Scan(System.Text.RegularExpressions.Regex,System.String,System.Int32,System.Int32) */, IMachine_t294675897_il2cpp_TypeInfo_var, L_7, __this, L_8, L_9, L_11); return L_12; } } // System.Text.RegularExpressions.MatchCollection System.Text.RegularExpressions.Regex::Matches(System.String) extern "C" MatchCollection_t318449694 * Regex_Matches_m3092142232 (Regex_t3802381858 * __this, String_t* ___input0, const MethodInfo* method) { { String_t* L_0 = ___input0; String_t* L_1 = ___input0; int32_t L_2 = Regex_default_startat_m996366267(__this, L_1, /*hidden argument*/NULL); MatchCollection_t318449694 * L_3 = Regex_Matches_m4271078207(__this, L_0, L_2, /*hidden argument*/NULL); return L_3; } } // System.Text.RegularExpressions.MatchCollection System.Text.RegularExpressions.Regex::Matches(System.String,System.Int32) extern Il2CppClass* MatchCollection_t318449694_il2cpp_TypeInfo_var; extern const uint32_t Regex_Matches_m4271078207_MetadataUsageId; extern "C" MatchCollection_t318449694 * Regex_Matches_m4271078207 (Regex_t3802381858 * __this, String_t* ___input0, int32_t ___startat1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_Matches_m4271078207_MetadataUsageId); s_Il2CppMethodIntialized = true; } Match_t3797657504 * V_0 = NULL; { String_t* L_0 = ___input0; int32_t L_1 = ___startat1; Match_t3797657504 * L_2 = Regex_Match_m1021969427(__this, L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; Match_t3797657504 * L_3 = V_0; MatchCollection_t318449694 * L_4 = (MatchCollection_t318449694 *)il2cpp_codegen_object_new(MatchCollection_t318449694_il2cpp_TypeInfo_var); MatchCollection__ctor_m1982569902(L_4, L_3, /*hidden argument*/NULL); return L_4; } } // System.String System.Text.RegularExpressions.Regex::ToString() extern "C" String_t* Regex_ToString_m3480281169 (Regex_t3802381858 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_pattern_7(); return L_0; } } // System.Int32 System.Text.RegularExpressions.Regex::get_Gap() extern "C" int32_t Regex_get_Gap_m2153899613 (Regex_t3802381858 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_gap_4(); return L_0; } } // System.Text.RegularExpressions.IMachine System.Text.RegularExpressions.Regex::CreateMachine() extern Il2CppClass* IMachineFactory_t1224363367_il2cpp_TypeInfo_var; extern const uint32_t Regex_CreateMachine_m1572823491_MetadataUsageId; extern "C" Il2CppObject * Regex_CreateMachine_m1572823491 (Regex_t3802381858 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_CreateMachine_m1572823491_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = __this->get_machineFactory_1(); NullCheck(L_0); Il2CppObject * L_1 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Text.RegularExpressions.IMachine System.Text.RegularExpressions.IMachineFactory::NewInstance() */, IMachineFactory_t1224363367_il2cpp_TypeInfo_var, L_0); return L_1; } } // System.String[] System.Text.RegularExpressions.Regex::GetGroupNamesArray(System.Int32,System.Collections.IDictionary) extern Il2CppClass* StringU5BU5D_t2956870243_il2cpp_TypeInfo_var; extern Il2CppClass* IDictionary_t1654916945_il2cpp_TypeInfo_var; extern Il2CppClass* IDictionaryEnumerator_t1541724277_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern const uint32_t Regex_GetGroupNamesArray_m3739926801_MetadataUsageId; extern "C" StringU5BU5D_t2956870243* Regex_GetGroupNamesArray_m3739926801 (Il2CppObject * __this /* static, unused */, int32_t ___groupCount0, Il2CppObject * ___mapping1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_GetGroupNamesArray_m3739926801_MetadataUsageId); s_Il2CppMethodIntialized = true; } StringU5BU5D_t2956870243* V_0 = NULL; Il2CppObject * V_1 = NULL; { int32_t L_0 = ___groupCount0; V_0 = ((StringU5BU5D_t2956870243*)SZArrayNew(StringU5BU5D_t2956870243_il2cpp_TypeInfo_var, (uint32_t)((int32_t)((int32_t)L_0+(int32_t)1)))); Il2CppObject * L_1 = ___mapping1; NullCheck(L_1); Il2CppObject * L_2 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(3 /* System.Collections.IDictionaryEnumerator System.Collections.IDictionary::GetEnumerator() */, IDictionary_t1654916945_il2cpp_TypeInfo_var, L_1); V_1 = L_2; goto IL_002d; } IL_0015: { StringU5BU5D_t2956870243* L_3 = V_0; Il2CppObject * L_4 = V_1; NullCheck(L_4); Il2CppObject * L_5 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(2 /* System.Object System.Collections.IDictionaryEnumerator::get_Value() */, IDictionaryEnumerator_t1541724277_il2cpp_TypeInfo_var, L_4); Il2CppObject * L_6 = V_1; NullCheck(L_6); Il2CppObject * L_7 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(1 /* System.Object System.Collections.IDictionaryEnumerator::get_Key() */, IDictionaryEnumerator_t1541724277_il2cpp_TypeInfo_var, L_6); NullCheck(L_3); IL2CPP_ARRAY_BOUNDS_CHECK(L_3, ((*(int32_t*)((int32_t*)UnBox (L_5, Int32_t2847414787_il2cpp_TypeInfo_var))))); ArrayElementTypeCheck (L_3, ((String_t*)CastclassSealed(L_7, String_t_il2cpp_TypeInfo_var))); (L_3)->SetAt(static_cast<il2cpp_array_size_t>(((*(int32_t*)((int32_t*)UnBox (L_5, Int32_t2847414787_il2cpp_TypeInfo_var))))), (String_t*)((String_t*)CastclassSealed(L_7, String_t_il2cpp_TypeInfo_var))); } IL_002d: { Il2CppObject * L_8 = V_1; NullCheck(L_8); bool L_9 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_8); if (L_9) { goto IL_0015; } } { StringU5BU5D_t2956870243* L_10 = V_0; return L_10; } } // System.Int32[] System.Text.RegularExpressions.Regex::get_GroupNumbers() extern Il2CppClass* Int32U5BU5D_t1809983122_il2cpp_TypeInfo_var; extern const uint32_t Regex_get_GroupNumbers_m2500558052_MetadataUsageId; extern "C" Int32U5BU5D_t1809983122* Regex_get_GroupNumbers_m2500558052 (Regex_t3802381858 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Regex_get_GroupNumbers_m2500558052_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; { Int32U5BU5D_t1809983122* L_0 = __this->get_group_numbers_6(); if (L_0) { goto IL_0076; } } { int32_t L_1 = __this->get_group_count_3(); __this->set_group_numbers_6(((Int32U5BU5D_t1809983122*)SZArrayNew(Int32U5BU5D_t1809983122_il2cpp_TypeInfo_var, (uint32_t)((int32_t)((int32_t)1+(int32_t)L_1))))); V_0 = 0; goto IL_0032; } IL_0025: { Int32U5BU5D_t1809983122* L_2 = __this->get_group_numbers_6(); int32_t L_3 = V_0; int32_t L_4 = V_0; NullCheck(L_2); IL2CPP_ARRAY_BOUNDS_CHECK(L_2, L_3); (L_2)->SetAt(static_cast<il2cpp_array_size_t>(L_3), (int32_t)L_4); int32_t L_5 = V_0; V_0 = ((int32_t)((int32_t)L_5+(int32_t)1)); } IL_0032: { int32_t L_6 = V_0; int32_t L_7 = __this->get_gap_4(); if ((((int32_t)L_6) < ((int32_t)L_7))) { goto IL_0025; } } { int32_t L_8 = __this->get_gap_4(); V_1 = L_8; goto IL_0063; } IL_004a: { Int32U5BU5D_t1809983122* L_9 = __this->get_group_numbers_6(); int32_t L_10 = V_1; StringU5BU5D_t2956870243* L_11 = __this->get_group_names_5(); int32_t L_12 = V_1; NullCheck(L_11); IL2CPP_ARRAY_BOUNDS_CHECK(L_11, L_12); int32_t L_13 = L_12; int32_t L_14 = Int32_Parse_m3837759498(NULL /*static, unused*/, ((L_11)->GetAt(static_cast<il2cpp_array_size_t>(L_13))), /*hidden argument*/NULL); NullCheck(L_9); IL2CPP_ARRAY_BOUNDS_CHECK(L_9, L_10); (L_9)->SetAt(static_cast<il2cpp_array_size_t>(L_10), (int32_t)L_14); int32_t L_15 = V_1; V_1 = ((int32_t)((int32_t)L_15+(int32_t)1)); } IL_0063: { int32_t L_16 = V_1; int32_t L_17 = __this->get_group_count_3(); if ((((int32_t)L_16) <= ((int32_t)L_17))) { goto IL_004a; } } { Int32U5BU5D_t1809983122* L_18 = __this->get_group_numbers_6(); return L_18; } IL_0076: { Int32U5BU5D_t1809983122* L_19 = __this->get_group_numbers_6(); return L_19; } } // System.Void System.Text.RegularExpressions.Syntax.Alternation::.ctor() extern "C" void Alternation__ctor_m1090419051 (Alternation_t2772154573 * __this, const MethodInfo* method) { { CompositeExpression__ctor_m839662857(__this, /*hidden argument*/NULL); return; } } // System.Text.RegularExpressions.Syntax.ExpressionCollection System.Text.RegularExpressions.Syntax.Alternation::get_Alternatives() extern "C" ExpressionCollection_t357621126 * Alternation_get_Alternatives_m1740410205 (Alternation_t2772154573 * __this, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.Alternation::AddAlternative(System.Text.RegularExpressions.Syntax.Expression) extern "C" void Alternation_AddAlternative_m3695967311 (Alternation_t2772154573 * __this, Expression_t1499093192 * ___e0, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = Alternation_get_Alternatives_m1740410205(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___e0; NullCheck(L_0); ExpressionCollection_Add_m3422413233(L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.Alternation::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* Expression_t1499093192_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern const uint32_t Alternation_Compile_m333754556_MetadataUsageId; extern "C" void Alternation_Compile_m333754556 (Alternation_t2772154573 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Alternation_Compile_m333754556_MetadataUsageId); s_Il2CppMethodIntialized = true; } LinkRef_t1270295572 * V_0 = NULL; Expression_t1499093192 * V_1 = NULL; Il2CppObject * V_2 = NULL; LinkRef_t1270295572 * V_3 = NULL; Il2CppObject * V_4 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { Il2CppObject * L_0 = ___cmp0; NullCheck(L_0); LinkRef_t1270295572 * L_1 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0); V_0 = L_1; ExpressionCollection_t357621126 * L_2 = Alternation_get_Alternatives_m1740410205(__this, /*hidden argument*/NULL); NullCheck(L_2); Il2CppObject * L_3 = VirtFuncInvoker0< Il2CppObject * >::Invoke(4 /* System.Collections.IEnumerator System.Collections.CollectionBase::GetEnumerator() */, L_2); V_2 = L_3; } IL_0013: try { // begin try (depth: 1) { goto IL_004e; } IL_0018: { Il2CppObject * L_4 = V_2; NullCheck(L_4); Il2CppObject * L_5 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_4); V_1 = ((Expression_t1499093192 *)CastclassClass(L_5, Expression_t1499093192_il2cpp_TypeInfo_var)); Il2CppObject * L_6 = ___cmp0; NullCheck(L_6); LinkRef_t1270295572 * L_7 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_6); V_3 = L_7; Il2CppObject * L_8 = ___cmp0; LinkRef_t1270295572 * L_9 = V_3; NullCheck(L_8); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(18 /* System.Void System.Text.RegularExpressions.ICompiler::EmitBranch(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_8, L_9); Expression_t1499093192 * L_10 = V_1; Il2CppObject * L_11 = ___cmp0; bool L_12 = ___reverse1; NullCheck(L_10); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_10, L_11, L_12); Il2CppObject * L_13 = ___cmp0; LinkRef_t1270295572 * L_14 = V_0; NullCheck(L_13); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(19 /* System.Void System.Text.RegularExpressions.ICompiler::EmitJump(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_13, L_14); Il2CppObject * L_15 = ___cmp0; LinkRef_t1270295572 * L_16 = V_3; NullCheck(L_15); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_15, L_16); Il2CppObject * L_17 = ___cmp0; NullCheck(L_17); InterfaceActionInvoker0::Invoke(26 /* System.Void System.Text.RegularExpressions.ICompiler::EmitBranchEnd() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_17); } IL_004e: { Il2CppObject * L_18 = V_2; NullCheck(L_18); bool L_19 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_18); if (L_19) { goto IL_0018; } } IL_0059: { IL2CPP_LEAVE(0x73, FINALLY_005e); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_005e; } FINALLY_005e: { // begin finally (depth: 1) { Il2CppObject * L_20 = V_2; V_4 = ((Il2CppObject *)IsInst(L_20, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_21 = V_4; if (L_21) { goto IL_006b; } } IL_006a: { IL2CPP_END_FINALLY(94) } IL_006b: { Il2CppObject * L_22 = V_4; NullCheck(L_22); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_22); IL2CPP_END_FINALLY(94) } } // end finally (depth: 1) IL2CPP_CLEANUP(94) { IL2CPP_JUMP_TBL(0x73, IL_0073) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0073: { Il2CppObject * L_23 = ___cmp0; NullCheck(L_23); InterfaceActionInvoker0::Invoke(1 /* System.Void System.Text.RegularExpressions.ICompiler::EmitFalse() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_23); Il2CppObject * L_24 = ___cmp0; LinkRef_t1270295572 * L_25 = V_0; NullCheck(L_24); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_24, L_25); Il2CppObject * L_26 = ___cmp0; NullCheck(L_26); InterfaceActionInvoker0::Invoke(27 /* System.Void System.Text.RegularExpressions.ICompiler::EmitAlternationEnd() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_26); return; } } // System.Void System.Text.RegularExpressions.Syntax.Alternation::GetWidth(System.Int32&,System.Int32&) extern "C" void Alternation_GetWidth_m1273465607 (Alternation_t2772154573 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { { int32_t* L_0 = ___min0; int32_t* L_1 = ___max1; ExpressionCollection_t357621126 * L_2 = Alternation_get_Alternatives_m1740410205(__this, /*hidden argument*/NULL); NullCheck(L_2); int32_t L_3 = VirtFuncInvoker0< int32_t >::Invoke(5 /* System.Int32 System.Collections.CollectionBase::get_Count() */, L_2); CompositeExpression_GetWidth_m925194962(__this, L_0, L_1, L_3, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.AnchorInfo::.ctor(System.Text.RegularExpressions.Syntax.Expression,System.Int32) extern "C" void AnchorInfo__ctor_m774944594 (AnchorInfo_t1997143859 * __this, Expression_t1499093192 * ___expr0, int32_t ___width1, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_0 = ___expr0; __this->set_expr_0(L_0); __this->set_offset_2(0); int32_t L_1 = ___width1; __this->set_width_4(L_1); __this->set_str_3((String_t*)NULL); __this->set_ignore_5((bool)0); __this->set_pos_1(0); return; } } // System.Void System.Text.RegularExpressions.Syntax.AnchorInfo::.ctor(System.Text.RegularExpressions.Syntax.Expression,System.Int32,System.Int32,System.String,System.Boolean) extern "C" void AnchorInfo__ctor_m2237276956 (AnchorInfo_t1997143859 * __this, Expression_t1499093192 * ___expr0, int32_t ___offset1, int32_t ___width2, String_t* ___str3, bool ___ignore4, const MethodInfo* method) { AnchorInfo_t1997143859 * G_B2_0 = NULL; AnchorInfo_t1997143859 * G_B1_0 = NULL; String_t* G_B3_0 = NULL; AnchorInfo_t1997143859 * G_B3_1 = NULL; { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_0 = ___expr0; __this->set_expr_0(L_0); int32_t L_1 = ___offset1; __this->set_offset_2(L_1); int32_t L_2 = ___width2; __this->set_width_4(L_2); bool L_3 = ___ignore4; G_B1_0 = __this; if (!L_3) { G_B2_0 = __this; goto IL_002f; } } { String_t* L_4 = ___str3; NullCheck(L_4); String_t* L_5 = String_ToLower_m2421900555(L_4, /*hidden argument*/NULL); G_B3_0 = L_5; G_B3_1 = G_B1_0; goto IL_0031; } IL_002f: { String_t* L_6 = ___str3; G_B3_0 = L_6; G_B3_1 = G_B2_0; } IL_0031: { NullCheck(G_B3_1); G_B3_1->set_str_3(G_B3_0); bool L_7 = ___ignore4; __this->set_ignore_5(L_7); __this->set_pos_1(0); return; } } // System.Void System.Text.RegularExpressions.Syntax.AnchorInfo::.ctor(System.Text.RegularExpressions.Syntax.Expression,System.Int32,System.Int32,System.Text.RegularExpressions.Position) extern "C" void AnchorInfo__ctor_m3146766459 (AnchorInfo_t1997143859 * __this, Expression_t1499093192 * ___expr0, int32_t ___offset1, int32_t ___width2, uint16_t ___pos3, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_0 = ___expr0; __this->set_expr_0(L_0); int32_t L_1 = ___offset1; __this->set_offset_2(L_1); int32_t L_2 = ___width2; __this->set_width_4(L_2); uint16_t L_3 = ___pos3; __this->set_pos_1(L_3); __this->set_str_3((String_t*)NULL); __this->set_ignore_5((bool)0); return; } } // System.Int32 System.Text.RegularExpressions.Syntax.AnchorInfo::get_Offset() extern "C" int32_t AnchorInfo_get_Offset_m110301077 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_offset_2(); return L_0; } } // System.Int32 System.Text.RegularExpressions.Syntax.AnchorInfo::get_Width() extern "C" int32_t AnchorInfo_get_Width_m814480998 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_width_4(); return L_0; } } // System.Int32 System.Text.RegularExpressions.Syntax.AnchorInfo::get_Length() extern "C" int32_t AnchorInfo_get_Length_m2802687272 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { int32_t G_B3_0 = 0; { String_t* L_0 = __this->get_str_3(); if (!L_0) { goto IL_001b; } } { String_t* L_1 = __this->get_str_3(); NullCheck(L_1); int32_t L_2 = String_get_Length_m2979997331(L_1, /*hidden argument*/NULL); G_B3_0 = L_2; goto IL_001c; } IL_001b: { G_B3_0 = 0; } IL_001c: { return G_B3_0; } } // System.Boolean System.Text.RegularExpressions.Syntax.AnchorInfo::get_IsUnknownWidth() extern "C" bool AnchorInfo_get_IsUnknownWidth_m3273649934 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_width_4(); return (bool)((((int32_t)L_0) < ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.AnchorInfo::get_IsComplete() extern "C" bool AnchorInfo_get_IsComplete_m2840583659 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { int32_t L_0 = AnchorInfo_get_Length_m2802687272(__this, /*hidden argument*/NULL); int32_t L_1 = AnchorInfo_get_Width_m814480998(__this, /*hidden argument*/NULL); return (bool)((((int32_t)L_0) == ((int32_t)L_1))? 1 : 0); } } // System.String System.Text.RegularExpressions.Syntax.AnchorInfo::get_Substring() extern "C" String_t* AnchorInfo_get_Substring_m1320966366 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_str_3(); return L_0; } } // System.Boolean System.Text.RegularExpressions.Syntax.AnchorInfo::get_IgnoreCase() extern "C" bool AnchorInfo_get_IgnoreCase_m843009482 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { bool L_0 = __this->get_ignore_5(); return L_0; } } // System.Text.RegularExpressions.Position System.Text.RegularExpressions.Syntax.AnchorInfo::get_Position() extern "C" uint16_t AnchorInfo_get_Position_m1033547864 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { uint16_t L_0 = __this->get_pos_1(); return L_0; } } // System.Boolean System.Text.RegularExpressions.Syntax.AnchorInfo::get_IsSubstring() extern "C" bool AnchorInfo_get_IsSubstring_m506285889 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_str_3(); return (bool)((((int32_t)((((Il2CppObject*)(String_t*)L_0) == ((Il2CppObject*)(Il2CppObject *)NULL))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.AnchorInfo::get_IsPosition() extern "C" bool AnchorInfo_get_IsPosition_m467864027 (AnchorInfo_t1997143859 * __this, const MethodInfo* method) { { uint16_t L_0 = __this->get_pos_1(); return (bool)((((int32_t)((((int32_t)L_0) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Text.RegularExpressions.Interval System.Text.RegularExpressions.Syntax.AnchorInfo::GetInterval(System.Int32) extern "C" Interval_t63637216 AnchorInfo_GetInterval_m1447205988 (AnchorInfo_t1997143859 * __this, int32_t ___start0, const MethodInfo* method) { { bool L_0 = AnchorInfo_get_IsSubstring_m506285889(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0011; } } { Interval_t63637216 L_1 = Interval_get_Empty_m2836746235(NULL /*static, unused*/, /*hidden argument*/NULL); return L_1; } IL_0011: { int32_t L_2 = ___start0; int32_t L_3 = AnchorInfo_get_Offset_m110301077(__this, /*hidden argument*/NULL); int32_t L_4 = ___start0; int32_t L_5 = AnchorInfo_get_Offset_m110301077(__this, /*hidden argument*/NULL); int32_t L_6 = AnchorInfo_get_Length_m2802687272(__this, /*hidden argument*/NULL); Interval_t63637216 L_7; memset(&L_7, 0, sizeof(L_7)); Interval__ctor_m4154124910(&L_7, ((int32_t)((int32_t)L_2+(int32_t)L_3)), ((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_4+(int32_t)L_5))+(int32_t)L_6))-(int32_t)1)), /*hidden argument*/NULL); return L_7; } } // System.Void System.Text.RegularExpressions.Syntax.Assertion::.ctor() extern "C" void Assertion__ctor_m936536102 (Assertion_t324477170 * __this, const MethodInfo* method) { { CompositeExpression__ctor_m839662857(__this, /*hidden argument*/NULL); ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); ExpressionCollection_Add_m3422413233(L_0, (Expression_t1499093192 *)NULL, /*hidden argument*/NULL); ExpressionCollection_t357621126 * L_1 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_1); ExpressionCollection_Add_m3422413233(L_1, (Expression_t1499093192 *)NULL, /*hidden argument*/NULL); return; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.Assertion::get_TrueExpression() extern "C" Expression_t1499093192 * Assertion_get_TrueExpression_m1503749732 (Assertion_t324477170 * __this, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); Expression_t1499093192 * L_1 = ExpressionCollection_get_Item_m3558752946(L_0, 0, /*hidden argument*/NULL); return L_1; } } // System.Void System.Text.RegularExpressions.Syntax.Assertion::set_TrueExpression(System.Text.RegularExpressions.Syntax.Expression) extern "C" void Assertion_set_TrueExpression_m293303211 (Assertion_t324477170 * __this, Expression_t1499093192 * ___value0, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___value0; NullCheck(L_0); ExpressionCollection_set_Item_m3407994931(L_0, 0, L_1, /*hidden argument*/NULL); return; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.Assertion::get_FalseExpression() extern "C" Expression_t1499093192 * Assertion_get_FalseExpression_m2557605343 (Assertion_t324477170 * __this, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); Expression_t1499093192 * L_1 = ExpressionCollection_get_Item_m3558752946(L_0, 1, /*hidden argument*/NULL); return L_1; } } // System.Void System.Text.RegularExpressions.Syntax.Assertion::set_FalseExpression(System.Text.RegularExpressions.Syntax.Expression) extern "C" void Assertion_set_FalseExpression_m18812748 (Assertion_t324477170 * __this, Expression_t1499093192 * ___value0, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___value0; NullCheck(L_0); ExpressionCollection_set_Item_m3407994931(L_0, 1, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.Assertion::GetWidth(System.Int32&,System.Int32&) extern "C" void Assertion_GetWidth_m2142322818 (Assertion_t324477170 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { { int32_t* L_0 = ___min0; int32_t* L_1 = ___max1; CompositeExpression_GetWidth_m925194962(__this, L_0, L_1, 2, /*hidden argument*/NULL); Expression_t1499093192 * L_2 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); if (!L_2) { goto IL_001f; } } { Expression_t1499093192 * L_3 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); if (L_3) { goto IL_0022; } } IL_001f: { int32_t* L_4 = ___min0; *((int32_t*)(L_4)) = (int32_t)0; } IL_0022: { return; } } // System.Void System.Text.RegularExpressions.Syntax.BackslashNumber::.ctor(System.Boolean,System.Boolean) extern "C" void BackslashNumber__ctor_m1444209053 (BackslashNumber_t1411804623 * __this, bool ___ignore0, bool ___ecma1, const MethodInfo* method) { { bool L_0 = ___ignore0; Reference__ctor_m425097396(__this, L_0, /*hidden argument*/NULL); bool L_1 = ___ecma1; __this->set_ecma_3(L_1); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.BackslashNumber::ResolveReference(System.String,System.Collections.Hashtable) extern Il2CppClass* CapturingGroup_t1439411180_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t BackslashNumber_ResolveReference_m705827744_MetadataUsageId; extern "C" bool BackslashNumber_ResolveReference_m705827744 (BackslashNumber_t1411804623 * __this, String_t* ___num_str0, Hashtable_t3875263730 * ___groups1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (BackslashNumber_ResolveReference_m705827744_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; int32_t V_3 = 0; { bool L_0 = __this->get_ecma_3(); if (!L_0) { goto IL_006c; } } { V_0 = 0; V_1 = 1; goto IL_002d; } IL_0014: { Hashtable_t3875263730 * L_1 = ___groups1; String_t* L_2 = ___num_str0; int32_t L_3 = V_1; NullCheck(L_2); String_t* L_4 = String_Substring_m675079568(L_2, 0, L_3, /*hidden argument*/NULL); NullCheck(L_1); Il2CppObject * L_5 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_1, L_4); if (!L_5) { goto IL_0029; } } { int32_t L_6 = V_1; V_0 = L_6; } IL_0029: { int32_t L_7 = V_1; V_1 = ((int32_t)((int32_t)L_7+(int32_t)1)); } IL_002d: { int32_t L_8 = V_1; String_t* L_9 = ___num_str0; NullCheck(L_9); int32_t L_10 = String_get_Length_m2979997331(L_9, /*hidden argument*/NULL); if ((((int32_t)L_8) < ((int32_t)L_10))) { goto IL_0014; } } { int32_t L_11 = V_0; if (!L_11) { goto IL_0067; } } { Hashtable_t3875263730 * L_12 = ___groups1; String_t* L_13 = ___num_str0; int32_t L_14 = V_0; NullCheck(L_13); String_t* L_15 = String_Substring_m675079568(L_13, 0, L_14, /*hidden argument*/NULL); NullCheck(L_12); Il2CppObject * L_16 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_12, L_15); Reference_set_CapturingGroup_m716261254(__this, ((CapturingGroup_t1439411180 *)CastclassClass(L_16, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)), /*hidden argument*/NULL); String_t* L_17 = ___num_str0; int32_t L_18 = V_0; NullCheck(L_17); String_t* L_19 = String_Substring_m2809233063(L_17, L_18, /*hidden argument*/NULL); __this->set_literal_2(L_19); return (bool)1; } IL_0067: { goto IL_007a; } IL_006c: { String_t* L_20 = ___num_str0; NullCheck(L_20); int32_t L_21 = String_get_Length_m2979997331(L_20, /*hidden argument*/NULL); if ((!(((uint32_t)L_21) == ((uint32_t)1)))) { goto IL_007a; } } { return (bool)0; } IL_007a: { V_2 = 0; String_t* L_22 = ___num_str0; int32_t L_23 = Parser_ParseOctal_m1398273866(NULL /*static, unused*/, L_22, (&V_2), /*hidden argument*/NULL); V_3 = L_23; int32_t L_24 = V_3; if ((!(((uint32_t)L_24) == ((uint32_t)(-1))))) { goto IL_008e; } } { return (bool)0; } IL_008e: { int32_t L_25 = V_3; if ((((int32_t)L_25) <= ((int32_t)((int32_t)255)))) { goto IL_00ac; } } { bool L_26 = __this->get_ecma_3(); if (!L_26) { goto IL_00ac; } } { int32_t L_27 = V_3; V_3 = ((int32_t)((int32_t)L_27/(int32_t)8)); int32_t L_28 = V_2; V_2 = ((int32_t)((int32_t)L_28-(int32_t)1)); } IL_00ac: { int32_t L_29 = V_3; V_3 = ((int32_t)((int32_t)L_29&(int32_t)((int32_t)255))); int32_t L_30 = V_3; uint16_t L_31 = ((uint16_t)(((int32_t)((uint16_t)L_30)))); Il2CppObject * L_32 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_31); String_t* L_33 = ___num_str0; int32_t L_34 = V_2; NullCheck(L_33); String_t* L_35 = String_Substring_m2809233063(L_33, L_34, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_36 = String_Concat_m389863537(NULL /*static, unused*/, L_32, L_35, /*hidden argument*/NULL); __this->set_literal_2(L_36); return (bool)1; } } // System.Void System.Text.RegularExpressions.Syntax.BackslashNumber::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern "C" void BackslashNumber_Compile_m4016920510 (BackslashNumber_t1411804623 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { { CapturingGroup_t1439411180 * L_0 = Reference_get_CapturingGroup_m2373399431(__this, /*hidden argument*/NULL); if (!L_0) { goto IL_0013; } } { Il2CppObject * L_1 = ___cmp0; bool L_2 = ___reverse1; Reference_Compile_m2087049322(__this, L_1, L_2, /*hidden argument*/NULL); } IL_0013: { String_t* L_3 = __this->get_literal_2(); if (!L_3) { goto IL_0031; } } { String_t* L_4 = __this->get_literal_2(); Il2CppObject * L_5 = ___cmp0; bool L_6 = Reference_get_IgnoreCase_m1035334716(__this, /*hidden argument*/NULL); bool L_7 = ___reverse1; Literal_CompileLiteral_m187321040(NULL /*static, unused*/, L_4, L_5, L_6, L_7, /*hidden argument*/NULL); } IL_0031: { return; } } // System.Void System.Text.RegularExpressions.Syntax.BalancingGroup::.ctor() extern "C" void BalancingGroup__ctor_m1391379608 (BalancingGroup_t3928584086 * __this, const MethodInfo* method) { { CapturingGroup__ctor_m616302850(__this, /*hidden argument*/NULL); __this->set_balance_3((CapturingGroup_t1439411180 *)NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.BalancingGroup::set_Balance(System.Text.RegularExpressions.Syntax.CapturingGroup) extern "C" void BalancingGroup_set_Balance_m1819477787 (BalancingGroup_t3928584086 * __this, CapturingGroup_t1439411180 * ___value0, const MethodInfo* method) { { CapturingGroup_t1439411180 * L_0 = ___value0; __this->set_balance_3(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.BalancingGroup::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t BalancingGroup_Compile_m191354415_MetadataUsageId; extern "C" void BalancingGroup_Compile_m191354415 (BalancingGroup_t3928584086 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (BalancingGroup_Compile_m191354415_MetadataUsageId); s_Il2CppMethodIntialized = true; } LinkRef_t1270295572 * V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; Expression_t1499093192 * V_3 = NULL; { Il2CppObject * L_0 = ___cmp0; NullCheck(L_0); LinkRef_t1270295572 * L_1 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0); V_0 = L_1; Il2CppObject * L_2 = ___cmp0; int32_t L_3 = CapturingGroup_get_Index_m1539088601(__this, /*hidden argument*/NULL); CapturingGroup_t1439411180 * L_4 = __this->get_balance_3(); NullCheck(L_4); int32_t L_5 = CapturingGroup_get_Index_m1539088601(L_4, /*hidden argument*/NULL); bool L_6 = CapturingGroup_get_IsNamed_m2190134608(__this, /*hidden argument*/NULL); LinkRef_t1270295572 * L_7 = V_0; NullCheck(L_2); InterfaceActionInvoker4< int32_t, int32_t, bool, LinkRef_t1270295572 * >::Invoke(12 /* System.Void System.Text.RegularExpressions.ICompiler::EmitBalanceStart(System.Int32,System.Int32,System.Boolean,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_2, L_3, L_5, L_6, L_7); ExpressionCollection_t357621126 * L_8 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_8); int32_t L_9 = VirtFuncInvoker0< int32_t >::Invoke(5 /* System.Int32 System.Collections.CollectionBase::get_Count() */, L_8); V_1 = L_9; V_2 = 0; goto IL_006d; } IL_0038: { bool L_10 = ___reverse1; if (!L_10) { goto IL_0054; } } { ExpressionCollection_t357621126 * L_11 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_12 = V_1; int32_t L_13 = V_2; NullCheck(L_11); Expression_t1499093192 * L_14 = ExpressionCollection_get_Item_m3558752946(L_11, ((int32_t)((int32_t)((int32_t)((int32_t)L_12-(int32_t)L_13))-(int32_t)1)), /*hidden argument*/NULL); V_3 = L_14; goto IL_0061; } IL_0054: { ExpressionCollection_t357621126 * L_15 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_16 = V_2; NullCheck(L_15); Expression_t1499093192 * L_17 = ExpressionCollection_get_Item_m3558752946(L_15, L_16, /*hidden argument*/NULL); V_3 = L_17; } IL_0061: { Expression_t1499093192 * L_18 = V_3; Il2CppObject * L_19 = ___cmp0; bool L_20 = ___reverse1; NullCheck(L_18); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_18, L_19, L_20); int32_t L_21 = V_2; V_2 = ((int32_t)((int32_t)L_21+(int32_t)1)); } IL_006d: { int32_t L_22 = V_2; int32_t L_23 = V_1; if ((((int32_t)L_22) < ((int32_t)L_23))) { goto IL_0038; } } { Il2CppObject * L_24 = ___cmp0; NullCheck(L_24); InterfaceActionInvoker0::Invoke(13 /* System.Void System.Text.RegularExpressions.ICompiler::EmitBalance() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_24); Il2CppObject * L_25 = ___cmp0; LinkRef_t1270295572 * L_26 = V_0; NullCheck(L_25); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_25, L_26); return; } } // System.Void System.Text.RegularExpressions.Syntax.CaptureAssertion::.ctor(System.Text.RegularExpressions.Syntax.Literal) extern "C" void CaptureAssertion__ctor_m4132785567 (CaptureAssertion_t1074818188 * __this, Literal_t3148194463 * ___l0, const MethodInfo* method) { { Assertion__ctor_m936536102(__this, /*hidden argument*/NULL); Literal_t3148194463 * L_0 = ___l0; __this->set_literal_3(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.CaptureAssertion::set_CapturingGroup(System.Text.RegularExpressions.Syntax.CapturingGroup) extern "C" void CaptureAssertion_set_CapturingGroup_m1020834945 (CaptureAssertion_t1074818188 * __this, CapturingGroup_t1439411180 * ___value0, const MethodInfo* method) { { CapturingGroup_t1439411180 * L_0 = ___value0; __this->set_group_2(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.CaptureAssertion::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t CaptureAssertion_Compile_m922447973_MetadataUsageId; extern "C" void CaptureAssertion_Compile_m922447973 (CaptureAssertion_t1074818188 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CaptureAssertion_Compile_m922447973_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; LinkRef_t1270295572 * V_1 = NULL; LinkRef_t1270295572 * V_2 = NULL; { CapturingGroup_t1439411180 * L_0 = __this->get_group_2(); if (L_0) { goto IL_0019; } } { ExpressionAssertion_t563003706 * L_1 = CaptureAssertion_get_Alternate_m4248571978(__this, /*hidden argument*/NULL); Il2CppObject * L_2 = ___cmp0; bool L_3 = ___reverse1; NullCheck(L_1); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.ExpressionAssertion::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_1, L_2, L_3); return; } IL_0019: { CapturingGroup_t1439411180 * L_4 = __this->get_group_2(); NullCheck(L_4); int32_t L_5 = CapturingGroup_get_Index_m1539088601(L_4, /*hidden argument*/NULL); V_0 = L_5; Il2CppObject * L_6 = ___cmp0; NullCheck(L_6); LinkRef_t1270295572 * L_7 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_6); V_1 = L_7; Expression_t1499093192 * L_8 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); if (L_8) { goto IL_0051; } } { Il2CppObject * L_9 = ___cmp0; int32_t L_10 = V_0; LinkRef_t1270295572 * L_11 = V_1; NullCheck(L_9); InterfaceActionInvoker2< int32_t, LinkRef_t1270295572 * >::Invoke(15 /* System.Void System.Text.RegularExpressions.ICompiler::EmitIfDefined(System.Int32,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_9, L_10, L_11); Expression_t1499093192 * L_12 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); Il2CppObject * L_13 = ___cmp0; bool L_14 = ___reverse1; NullCheck(L_12); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_12, L_13, L_14); goto IL_0088; } IL_0051: { Il2CppObject * L_15 = ___cmp0; NullCheck(L_15); LinkRef_t1270295572 * L_16 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_15); V_2 = L_16; Il2CppObject * L_17 = ___cmp0; int32_t L_18 = V_0; LinkRef_t1270295572 * L_19 = V_2; NullCheck(L_17); InterfaceActionInvoker2< int32_t, LinkRef_t1270295572 * >::Invoke(15 /* System.Void System.Text.RegularExpressions.ICompiler::EmitIfDefined(System.Int32,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_17, L_18, L_19); Expression_t1499093192 * L_20 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); Il2CppObject * L_21 = ___cmp0; bool L_22 = ___reverse1; NullCheck(L_20); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_20, L_21, L_22); Il2CppObject * L_23 = ___cmp0; LinkRef_t1270295572 * L_24 = V_1; NullCheck(L_23); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(19 /* System.Void System.Text.RegularExpressions.ICompiler::EmitJump(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_23, L_24); Il2CppObject * L_25 = ___cmp0; LinkRef_t1270295572 * L_26 = V_2; NullCheck(L_25); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_25, L_26); Expression_t1499093192 * L_27 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); Il2CppObject * L_28 = ___cmp0; bool L_29 = ___reverse1; NullCheck(L_27); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_27, L_28, L_29); } IL_0088: { Il2CppObject * L_30 = ___cmp0; LinkRef_t1270295572 * L_31 = V_1; NullCheck(L_30); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_30, L_31); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.CaptureAssertion::IsComplex() extern "C" bool CaptureAssertion_IsComplex_m987845008 (CaptureAssertion_t1074818188 * __this, const MethodInfo* method) { { CapturingGroup_t1439411180 * L_0 = __this->get_group_2(); if (L_0) { goto IL_0017; } } { ExpressionAssertion_t563003706 * L_1 = CaptureAssertion_get_Alternate_m4248571978(__this, /*hidden argument*/NULL); NullCheck(L_1); bool L_2 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean System.Text.RegularExpressions.Syntax.ExpressionAssertion::IsComplex() */, L_1); return L_2; } IL_0017: { Expression_t1499093192 * L_3 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); if (!L_3) { goto IL_0034; } } { Expression_t1499093192 * L_4 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); NullCheck(L_4); bool L_5 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean System.Text.RegularExpressions.Syntax.Expression::IsComplex() */, L_4); if (!L_5) { goto IL_0034; } } { return (bool)1; } IL_0034: { Expression_t1499093192 * L_6 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); if (!L_6) { goto IL_0051; } } { Expression_t1499093192 * L_7 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); NullCheck(L_7); bool L_8 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean System.Text.RegularExpressions.Syntax.Expression::IsComplex() */, L_7); if (!L_8) { goto IL_0051; } } { return (bool)1; } IL_0051: { int32_t L_9 = Expression_GetFixedWidth_m3994281404(__this, /*hidden argument*/NULL); return (bool)((((int32_t)((((int32_t)L_9) > ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Text.RegularExpressions.Syntax.ExpressionAssertion System.Text.RegularExpressions.Syntax.CaptureAssertion::get_Alternate() extern Il2CppClass* ExpressionAssertion_t563003706_il2cpp_TypeInfo_var; extern const uint32_t CaptureAssertion_get_Alternate_m4248571978_MetadataUsageId; extern "C" ExpressionAssertion_t563003706 * CaptureAssertion_get_Alternate_m4248571978 (CaptureAssertion_t1074818188 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CaptureAssertion_get_Alternate_m4248571978_MetadataUsageId); s_Il2CppMethodIntialized = true; } { ExpressionAssertion_t563003706 * L_0 = __this->get_alternate_1(); if (L_0) { goto IL_0049; } } { ExpressionAssertion_t563003706 * L_1 = (ExpressionAssertion_t563003706 *)il2cpp_codegen_object_new(ExpressionAssertion_t563003706_il2cpp_TypeInfo_var); ExpressionAssertion__ctor_m2776942238(L_1, /*hidden argument*/NULL); __this->set_alternate_1(L_1); ExpressionAssertion_t563003706 * L_2 = __this->get_alternate_1(); Expression_t1499093192 * L_3 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); NullCheck(L_2); Assertion_set_TrueExpression_m293303211(L_2, L_3, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_4 = __this->get_alternate_1(); Expression_t1499093192 * L_5 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); NullCheck(L_4); Assertion_set_FalseExpression_m18812748(L_4, L_5, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_6 = __this->get_alternate_1(); Literal_t3148194463 * L_7 = __this->get_literal_3(); NullCheck(L_6); ExpressionAssertion_set_TestExpression_m828897591(L_6, L_7, /*hidden argument*/NULL); } IL_0049: { ExpressionAssertion_t563003706 * L_8 = __this->get_alternate_1(); return L_8; } } // System.Void System.Text.RegularExpressions.Syntax.CapturingGroup::.ctor() extern "C" void CapturingGroup__ctor_m616302850 (CapturingGroup_t1439411180 * __this, const MethodInfo* method) { { Group__ctor_m358391753(__this, /*hidden argument*/NULL); __this->set_gid_1(0); __this->set_name_2((String_t*)NULL); return; } } // System.Int32 System.Text.RegularExpressions.Syntax.CapturingGroup::get_Index() extern "C" int32_t CapturingGroup_get_Index_m1539088601 (CapturingGroup_t1439411180 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_gid_1(); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.CapturingGroup::set_Index(System.Int32) extern "C" void CapturingGroup_set_Index_m1904349670 (CapturingGroup_t1439411180 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_gid_1(L_0); return; } } // System.String System.Text.RegularExpressions.Syntax.CapturingGroup::get_Name() extern "C" String_t* CapturingGroup_get_Name_m1678290617 (CapturingGroup_t1439411180 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_name_2(); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.CapturingGroup::set_Name(System.String) extern "C" void CapturingGroup_set_Name_m2861220216 (CapturingGroup_t1439411180 * __this, String_t* ___value0, const MethodInfo* method) { { String_t* L_0 = ___value0; __this->set_name_2(L_0); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.CapturingGroup::get_IsNamed() extern "C" bool CapturingGroup_get_IsNamed_m2190134608 (CapturingGroup_t1439411180 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_name_2(); return (bool)((((int32_t)((((Il2CppObject*)(String_t*)L_0) == ((Il2CppObject*)(Il2CppObject *)NULL))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Void System.Text.RegularExpressions.Syntax.CapturingGroup::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t CapturingGroup_Compile_m847947013_MetadataUsageId; extern "C" void CapturingGroup_Compile_m847947013 (CapturingGroup_t1439411180 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CapturingGroup_Compile_m847947013_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = ___cmp0; int32_t L_1 = __this->get_gid_1(); NullCheck(L_0); InterfaceActionInvoker1< int32_t >::Invoke(10 /* System.Void System.Text.RegularExpressions.ICompiler::EmitOpen(System.Int32) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0, L_1); Il2CppObject * L_2 = ___cmp0; bool L_3 = ___reverse1; Group_Compile_m767805470(__this, L_2, L_3, /*hidden argument*/NULL); Il2CppObject * L_4 = ___cmp0; int32_t L_5 = __this->get_gid_1(); NullCheck(L_4); InterfaceActionInvoker1< int32_t >::Invoke(11 /* System.Void System.Text.RegularExpressions.ICompiler::EmitClose(System.Int32) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_4, L_5); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.CapturingGroup::IsComplex() extern "C" bool CapturingGroup_IsComplex_m923392880 (CapturingGroup_t1439411180 * __this, const MethodInfo* method) { { return (bool)1; } } // System.Int32 System.Text.RegularExpressions.Syntax.CapturingGroup::CompareTo(System.Object) extern Il2CppClass* CapturingGroup_t1439411180_il2cpp_TypeInfo_var; extern const uint32_t CapturingGroup_CompareTo_m2476546276_MetadataUsageId; extern "C" int32_t CapturingGroup_CompareTo_m2476546276 (CapturingGroup_t1439411180 * __this, Il2CppObject * ___other0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CapturingGroup_CompareTo_m2476546276_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t L_0 = __this->get_gid_1(); Il2CppObject * L_1 = ___other0; NullCheck(((CapturingGroup_t1439411180 *)CastclassClass(L_1, CapturingGroup_t1439411180_il2cpp_TypeInfo_var))); int32_t L_2 = ((CapturingGroup_t1439411180 *)CastclassClass(L_1, CapturingGroup_t1439411180_il2cpp_TypeInfo_var))->get_gid_1(); return ((int32_t)((int32_t)L_0-(int32_t)L_2)); } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::.ctor(System.Boolean,System.Boolean) extern Il2CppClass* IntervalCollection_t2368501598_il2cpp_TypeInfo_var; extern Il2CppClass* BitArray_t2687322878_il2cpp_TypeInfo_var; extern const uint32_t CharacterClass__ctor_m318669623_MetadataUsageId; extern "C" void CharacterClass__ctor_m318669623 (CharacterClass_t630081023 * __this, bool ___negate0, bool ___ignore1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CharacterClass__ctor_m318669623_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { Expression__ctor_m89241894(__this, /*hidden argument*/NULL); bool L_0 = ___negate0; __this->set_negate_1(L_0); bool L_1 = ___ignore1; __this->set_ignore_2(L_1); IntervalCollection_t2368501598 * L_2 = (IntervalCollection_t2368501598 *)il2cpp_codegen_object_new(IntervalCollection_t2368501598_il2cpp_TypeInfo_var); IntervalCollection__ctor_m1317729402(L_2, /*hidden argument*/NULL); __this->set_intervals_5(L_2); V_0 = ((int32_t)144); int32_t L_3 = V_0; BitArray_t2687322878 * L_4 = (BitArray_t2687322878 *)il2cpp_codegen_object_new(BitArray_t2687322878_il2cpp_TypeInfo_var); BitArray__ctor_m4198813761(L_4, L_3, /*hidden argument*/NULL); __this->set_pos_cats_3(L_4); int32_t L_5 = V_0; BitArray_t2687322878 * L_6 = (BitArray_t2687322878 *)il2cpp_codegen_object_new(BitArray_t2687322878_il2cpp_TypeInfo_var); BitArray__ctor_m4198813761(L_6, L_5, /*hidden argument*/NULL); __this->set_neg_cats_4(L_6); return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::.ctor(System.Text.RegularExpressions.Category,System.Boolean) extern "C" void CharacterClass__ctor_m3672999653 (CharacterClass_t630081023 * __this, uint16_t ___cat0, bool ___negate1, const MethodInfo* method) { { CharacterClass__ctor_m318669623(__this, (bool)0, (bool)0, /*hidden argument*/NULL); uint16_t L_0 = ___cat0; bool L_1 = ___negate1; CharacterClass_AddCategory_m385157186(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::.cctor() extern Il2CppClass* CharacterClass_t630081023_il2cpp_TypeInfo_var; extern const uint32_t CharacterClass__cctor_m2076983614_MetadataUsageId; extern "C" void CharacterClass__cctor_m2076983614 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CharacterClass__cctor_m2076983614_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Interval_t63637216 L_0; memset(&L_0, 0, sizeof(L_0)); Interval__ctor_m4154124910(&L_0, ((int32_t)65), ((int32_t)90), /*hidden argument*/NULL); ((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->set_upper_case_characters_0(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::AddCategory(System.Text.RegularExpressions.Category,System.Boolean) extern "C" void CharacterClass_AddCategory_m385157186 (CharacterClass_t630081023 * __this, uint16_t ___cat0, bool ___negate1, const MethodInfo* method) { int32_t V_0 = 0; { uint16_t L_0 = ___cat0; V_0 = L_0; bool L_1 = ___negate1; if (!L_1) { goto IL_001a; } } { BitArray_t2687322878 * L_2 = __this->get_neg_cats_4(); int32_t L_3 = V_0; NullCheck(L_2); BitArray_set_Item_m3947323368(L_2, L_3, (bool)1, /*hidden argument*/NULL); goto IL_0027; } IL_001a: { BitArray_t2687322878 * L_4 = __this->get_pos_cats_3(); int32_t L_5 = V_0; NullCheck(L_4); BitArray_set_Item_m3947323368(L_4, L_5, (bool)1, /*hidden argument*/NULL); } IL_0027: { return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::AddCharacter(System.Char) extern "C" void CharacterClass_AddCharacter_m509912608 (CharacterClass_t630081023 * __this, uint16_t ___c0, const MethodInfo* method) { { uint16_t L_0 = ___c0; uint16_t L_1 = ___c0; CharacterClass_AddRange_m4184687523(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::AddRange(System.Char,System.Char) extern Il2CppClass* CharacterClass_t630081023_il2cpp_TypeInfo_var; extern const uint32_t CharacterClass_AddRange_m4184687523_MetadataUsageId; extern "C" void CharacterClass_AddRange_m4184687523 (CharacterClass_t630081023 * __this, uint16_t ___lo0, uint16_t ___hi1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CharacterClass_AddRange_m4184687523_MetadataUsageId); s_Il2CppMethodIntialized = true; } Interval_t63637216 V_0; memset(&V_0, 0, sizeof(V_0)); Interval_t63637216 V_1; memset(&V_1, 0, sizeof(V_1)); { uint16_t L_0 = ___lo0; uint16_t L_1 = ___hi1; Interval__ctor_m4154124910((&V_0), L_0, L_1, /*hidden argument*/NULL); bool L_2 = __this->get_ignore_2(); if (!L_2) { goto IL_00e2; } } { IL2CPP_RUNTIME_CLASS_INIT(CharacterClass_t630081023_il2cpp_TypeInfo_var); Interval_t63637216 L_3 = V_0; bool L_4 = Interval_Intersects_m1836714230((((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0()), L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_00b2; } } { int32_t L_5 = (&V_0)->get_low_0(); IL2CPP_RUNTIME_CLASS_INIT(CharacterClass_t630081023_il2cpp_TypeInfo_var); int32_t L_6 = (((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0())->get_low_0(); if ((((int32_t)L_5) >= ((int32_t)L_6))) { goto IL_0070; } } { IL2CPP_RUNTIME_CLASS_INIT(CharacterClass_t630081023_il2cpp_TypeInfo_var); int32_t L_7 = (((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0())->get_low_0(); int32_t L_8 = (&V_0)->get_high_1(); Interval__ctor_m4154124910((&V_1), ((int32_t)((int32_t)L_7+(int32_t)((int32_t)32))), ((int32_t)((int32_t)L_8+(int32_t)((int32_t)32))), /*hidden argument*/NULL); int32_t L_9 = (((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0())->get_low_0(); (&V_0)->set_high_1(((int32_t)((int32_t)L_9-(int32_t)1))); goto IL_00a1; } IL_0070: { int32_t L_10 = (&V_0)->get_low_0(); IL2CPP_RUNTIME_CLASS_INIT(CharacterClass_t630081023_il2cpp_TypeInfo_var); int32_t L_11 = (((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0())->get_high_1(); Interval__ctor_m4154124910((&V_1), ((int32_t)((int32_t)L_10+(int32_t)((int32_t)32))), ((int32_t)((int32_t)L_11+(int32_t)((int32_t)32))), /*hidden argument*/NULL); int32_t L_12 = (((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0())->get_high_1(); (&V_0)->set_low_0(((int32_t)((int32_t)L_12+(int32_t)1))); } IL_00a1: { IntervalCollection_t2368501598 * L_13 = __this->get_intervals_5(); Interval_t63637216 L_14 = V_1; NullCheck(L_13); IntervalCollection_Add_m622937095(L_13, L_14, /*hidden argument*/NULL); goto IL_00e2; } IL_00b2: { IL2CPP_RUNTIME_CLASS_INIT(CharacterClass_t630081023_il2cpp_TypeInfo_var); Interval_t63637216 L_15 = V_0; bool L_16 = Interval_Contains_m2884982059((((CharacterClass_t630081023_StaticFields*)CharacterClass_t630081023_il2cpp_TypeInfo_var->static_fields)->get_address_of_upper_case_characters_0()), L_15, /*hidden argument*/NULL); if (!L_16) { goto IL_00e2; } } { Interval_t63637216 * L_17 = (&V_0); int32_t L_18 = L_17->get_high_1(); L_17->set_high_1(((int32_t)((int32_t)L_18+(int32_t)((int32_t)32)))); Interval_t63637216 * L_19 = (&V_0); int32_t L_20 = L_19->get_low_0(); L_19->set_low_0(((int32_t)((int32_t)L_20+(int32_t)((int32_t)32)))); } IL_00e2: { IntervalCollection_t2368501598 * L_21 = __this->get_intervals_5(); Interval_t63637216 L_22 = V_0; NullCheck(L_21); IntervalCollection_Add_m622937095(L_21, L_22, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* CostDelegate_t3008899218_il2cpp_TypeInfo_var; extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* Interval_t63637216_il2cpp_TypeInfo_var; extern Il2CppClass* BitArray_t2687322878_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern const MethodInfo* CharacterClass_GetIntervalCost_m3570544782_MethodInfo_var; extern const uint32_t CharacterClass_Compile_m3181047384_MetadataUsageId; extern "C" void CharacterClass_Compile_m3181047384 (CharacterClass_t630081023 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CharacterClass_Compile_m3181047384_MetadataUsageId); s_Il2CppMethodIntialized = true; } IntervalCollection_t2368501598 * V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; LinkRef_t1270295572 * V_3 = NULL; Interval_t63637216 V_4; memset(&V_4, 0, sizeof(V_4)); Il2CppObject * V_5 = NULL; BitArray_t2687322878 * V_6 = NULL; Interval_t63637216 V_7; memset(&V_7, 0, sizeof(V_7)); Il2CppObject * V_8 = NULL; int32_t V_9 = 0; int32_t V_10 = 0; Il2CppObject * V_11 = NULL; Il2CppObject * V_12 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { IntervalCollection_t2368501598 * L_0 = __this->get_intervals_5(); IntPtr_t L_1; L_1.set_m_value_0((void*)(void*)CharacterClass_GetIntervalCost_m3570544782_MethodInfo_var); CostDelegate_t3008899218 * L_2 = (CostDelegate_t3008899218 *)il2cpp_codegen_object_new(CostDelegate_t3008899218_il2cpp_TypeInfo_var); CostDelegate__ctor_m731467895(L_2, NULL, L_1, /*hidden argument*/NULL); NullCheck(L_0); IntervalCollection_t2368501598 * L_3 = IntervalCollection_GetMetaCollection_m1423119555(L_0, L_2, /*hidden argument*/NULL); V_0 = L_3; IntervalCollection_t2368501598 * L_4 = V_0; NullCheck(L_4); int32_t L_5 = VirtFuncInvoker0< int32_t >::Invoke(4 /* System.Int32 System.Text.RegularExpressions.IntervalCollection::get_Count() */, L_4); V_1 = L_5; V_2 = 0; goto IL_0050; } IL_0026: { BitArray_t2687322878 * L_6 = __this->get_pos_cats_3(); int32_t L_7 = V_2; NullCheck(L_6); bool L_8 = BitArray_get_Item_m2410594623(L_6, L_7, /*hidden argument*/NULL); if (L_8) { goto IL_0048; } } { BitArray_t2687322878 * L_9 = __this->get_neg_cats_4(); int32_t L_10 = V_2; NullCheck(L_9); bool L_11 = BitArray_get_Item_m2410594623(L_9, L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_004c; } } IL_0048: { int32_t L_12 = V_1; V_1 = ((int32_t)((int32_t)L_12+(int32_t)1)); } IL_004c: { int32_t L_13 = V_2; V_2 = ((int32_t)((int32_t)L_13+(int32_t)1)); } IL_0050: { int32_t L_14 = V_2; BitArray_t2687322878 * L_15 = __this->get_pos_cats_3(); NullCheck(L_15); int32_t L_16 = BitArray_get_Length_m3443319207(L_15, /*hidden argument*/NULL); if ((((int32_t)L_14) < ((int32_t)L_16))) { goto IL_0026; } } { int32_t L_17 = V_1; if (L_17) { goto IL_0068; } } { return; } IL_0068: { Il2CppObject * L_18 = ___cmp0; NullCheck(L_18); LinkRef_t1270295572 * L_19 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_18); V_3 = L_19; int32_t L_20 = V_1; if ((((int32_t)L_20) <= ((int32_t)1))) { goto IL_007d; } } { Il2CppObject * L_21 = ___cmp0; LinkRef_t1270295572 * L_22 = V_3; NullCheck(L_21); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(22 /* System.Void System.Text.RegularExpressions.ICompiler::EmitIn(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_21, L_22); } IL_007d: { IntervalCollection_t2368501598 * L_23 = V_0; NullCheck(L_23); Il2CppObject * L_24 = VirtFuncInvoker0< Il2CppObject * >::Invoke(7 /* System.Collections.IEnumerator System.Text.RegularExpressions.IntervalCollection::GetEnumerator() */, L_23); V_5 = L_24; } IL_0085: try { // begin try (depth: 1) { goto IL_01ac; } IL_008a: { Il2CppObject * L_25 = V_5; NullCheck(L_25); Il2CppObject * L_26 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_25); V_4 = ((*(Interval_t63637216 *)((Interval_t63637216 *)UnBox (L_26, Interval_t63637216_il2cpp_TypeInfo_var)))); bool L_27 = Interval_get_IsDiscontiguous_m4161255183((&V_4), /*hidden argument*/NULL); if (!L_27) { goto IL_015d; } } IL_00a4: { int32_t L_28 = Interval_get_Size_m2053259174((&V_4), /*hidden argument*/NULL); BitArray_t2687322878 * L_29 = (BitArray_t2687322878 *)il2cpp_codegen_object_new(BitArray_t2687322878_il2cpp_TypeInfo_var); BitArray__ctor_m4198813761(L_29, L_28, /*hidden argument*/NULL); V_6 = L_29; IntervalCollection_t2368501598 * L_30 = __this->get_intervals_5(); NullCheck(L_30); Il2CppObject * L_31 = VirtFuncInvoker0< Il2CppObject * >::Invoke(7 /* System.Collections.IEnumerator System.Text.RegularExpressions.IntervalCollection::GetEnumerator() */, L_30); V_8 = L_31; } IL_00bf: try { // begin try (depth: 2) { goto IL_0114; } IL_00c4: { Il2CppObject * L_32 = V_8; NullCheck(L_32); Il2CppObject * L_33 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_32); V_7 = ((*(Interval_t63637216 *)((Interval_t63637216 *)UnBox (L_33, Interval_t63637216_il2cpp_TypeInfo_var)))); Interval_t63637216 L_34 = V_7; bool L_35 = Interval_Contains_m2884982059((&V_4), L_34, /*hidden argument*/NULL); if (!L_35) { goto IL_0114; } } IL_00e0: { int32_t L_36 = (&V_7)->get_low_0(); V_9 = L_36; goto IL_0106; } IL_00ee: { BitArray_t2687322878 * L_37 = V_6; int32_t L_38 = V_9; int32_t L_39 = (&V_4)->get_low_0(); NullCheck(L_37); BitArray_set_Item_m3947323368(L_37, ((int32_t)((int32_t)L_38-(int32_t)L_39)), (bool)1, /*hidden argument*/NULL); int32_t L_40 = V_9; V_9 = ((int32_t)((int32_t)L_40+(int32_t)1)); } IL_0106: { int32_t L_41 = V_9; int32_t L_42 = (&V_7)->get_high_1(); if ((((int32_t)L_41) <= ((int32_t)L_42))) { goto IL_00ee; } } IL_0114: { Il2CppObject * L_43 = V_8; NullCheck(L_43); bool L_44 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_43); if (L_44) { goto IL_00c4; } } IL_0120: { IL2CPP_LEAVE(0x13B, FINALLY_0125); } } // end try (depth: 2) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_0125; } FINALLY_0125: { // begin finally (depth: 2) { Il2CppObject * L_45 = V_8; V_11 = ((Il2CppObject *)IsInst(L_45, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_46 = V_11; if (L_46) { goto IL_0133; } } IL_0132: { IL2CPP_END_FINALLY(293) } IL_0133: { Il2CppObject * L_47 = V_11; NullCheck(L_47); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_47); IL2CPP_END_FINALLY(293) } } // end finally (depth: 2) IL2CPP_CLEANUP(293) { IL2CPP_JUMP_TBL(0x13B, IL_013b) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_013b: { Il2CppObject * L_48 = ___cmp0; int32_t L_49 = (&V_4)->get_low_0(); BitArray_t2687322878 * L_50 = V_6; bool L_51 = __this->get_negate_1(); bool L_52 = __this->get_ignore_2(); bool L_53 = ___reverse1; NullCheck(L_48); InterfaceActionInvoker5< uint16_t, BitArray_t2687322878 *, bool, bool, bool >::Invoke(7 /* System.Void System.Text.RegularExpressions.ICompiler::EmitSet(System.Char,System.Collections.BitArray,System.Boolean,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_48, (((int32_t)((uint16_t)L_49))), L_50, L_51, L_52, L_53); goto IL_01ac; } IL_015d: { bool L_54 = Interval_get_IsSingleton_m4044965956((&V_4), /*hidden argument*/NULL); if (!L_54) { goto IL_0189; } } IL_0169: { Il2CppObject * L_55 = ___cmp0; int32_t L_56 = (&V_4)->get_low_0(); bool L_57 = __this->get_negate_1(); bool L_58 = __this->get_ignore_2(); bool L_59 = ___reverse1; NullCheck(L_55); InterfaceActionInvoker4< uint16_t, bool, bool, bool >::Invoke(3 /* System.Void System.Text.RegularExpressions.ICompiler::EmitCharacter(System.Char,System.Boolean,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_55, (((int32_t)((uint16_t)L_56))), L_57, L_58, L_59); goto IL_01ac; } IL_0189: { Il2CppObject * L_60 = ___cmp0; int32_t L_61 = (&V_4)->get_low_0(); int32_t L_62 = (&V_4)->get_high_1(); bool L_63 = __this->get_negate_1(); bool L_64 = __this->get_ignore_2(); bool L_65 = ___reverse1; NullCheck(L_60); InterfaceActionInvoker5< uint16_t, uint16_t, bool, bool, bool >::Invoke(6 /* System.Void System.Text.RegularExpressions.ICompiler::EmitRange(System.Char,System.Char,System.Boolean,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_60, (((int32_t)((uint16_t)L_61))), (((int32_t)((uint16_t)L_62))), L_63, L_64, L_65); } IL_01ac: { Il2CppObject * L_66 = V_5; NullCheck(L_66); bool L_67 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_66); if (L_67) { goto IL_008a; } } IL_01b8: { IL2CPP_LEAVE(0x1D3, FINALLY_01bd); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_01bd; } FINALLY_01bd: { // begin finally (depth: 1) { Il2CppObject * L_68 = V_5; V_12 = ((Il2CppObject *)IsInst(L_68, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_69 = V_12; if (L_69) { goto IL_01cb; } } IL_01ca: { IL2CPP_END_FINALLY(445) } IL_01cb: { Il2CppObject * L_70 = V_12; NullCheck(L_70); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_70); IL2CPP_END_FINALLY(445) } } // end finally (depth: 1) IL2CPP_CLEANUP(445) { IL2CPP_JUMP_TBL(0x1D3, IL_01d3) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_01d3: { V_10 = 0; goto IL_024f; } IL_01db: { BitArray_t2687322878 * L_71 = __this->get_pos_cats_3(); int32_t L_72 = V_10; NullCheck(L_71); bool L_73 = BitArray_get_Item_m2410594623(L_71, L_72, /*hidden argument*/NULL); if (!L_73) { goto IL_0227; } } { BitArray_t2687322878 * L_74 = __this->get_neg_cats_4(); int32_t L_75 = V_10; NullCheck(L_74); bool L_76 = BitArray_get_Item_m2410594623(L_74, L_75, /*hidden argument*/NULL); if (!L_76) { goto IL_0212; } } { Il2CppObject * L_77 = ___cmp0; bool L_78 = __this->get_negate_1(); bool L_79 = ___reverse1; NullCheck(L_77); InterfaceActionInvoker3< uint16_t, bool, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.ICompiler::EmitCategory(System.Text.RegularExpressions.Category,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_77, 2, L_78, L_79); goto IL_0222; } IL_0212: { Il2CppObject * L_80 = ___cmp0; int32_t L_81 = V_10; bool L_82 = __this->get_negate_1(); bool L_83 = ___reverse1; NullCheck(L_80); InterfaceActionInvoker3< uint16_t, bool, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.ICompiler::EmitCategory(System.Text.RegularExpressions.Category,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_80, (((int32_t)((uint16_t)L_81))), L_82, L_83); } IL_0222: { goto IL_0249; } IL_0227: { BitArray_t2687322878 * L_84 = __this->get_neg_cats_4(); int32_t L_85 = V_10; NullCheck(L_84); bool L_86 = BitArray_get_Item_m2410594623(L_84, L_85, /*hidden argument*/NULL); if (!L_86) { goto IL_0249; } } { Il2CppObject * L_87 = ___cmp0; int32_t L_88 = V_10; bool L_89 = __this->get_negate_1(); bool L_90 = ___reverse1; NullCheck(L_87); InterfaceActionInvoker3< uint16_t, bool, bool >::Invoke(5 /* System.Void System.Text.RegularExpressions.ICompiler::EmitNotCategory(System.Text.RegularExpressions.Category,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_87, (((int32_t)((uint16_t)L_88))), L_89, L_90); } IL_0249: { int32_t L_91 = V_10; V_10 = ((int32_t)((int32_t)L_91+(int32_t)1)); } IL_024f: { int32_t L_92 = V_10; BitArray_t2687322878 * L_93 = __this->get_pos_cats_3(); NullCheck(L_93); int32_t L_94 = BitArray_get_Length_m3443319207(L_93, /*hidden argument*/NULL); if ((((int32_t)L_92) < ((int32_t)L_94))) { goto IL_01db; } } { int32_t L_95 = V_1; if ((((int32_t)L_95) <= ((int32_t)1))) { goto IL_028b; } } { bool L_96 = __this->get_negate_1(); if (!L_96) { goto IL_027e; } } { Il2CppObject * L_97 = ___cmp0; NullCheck(L_97); InterfaceActionInvoker0::Invoke(2 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTrue() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_97); goto IL_0284; } IL_027e: { Il2CppObject * L_98 = ___cmp0; NullCheck(L_98); InterfaceActionInvoker0::Invoke(1 /* System.Void System.Text.RegularExpressions.ICompiler::EmitFalse() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_98); } IL_0284: { Il2CppObject * L_99 = ___cmp0; LinkRef_t1270295572 * L_100 = V_3; NullCheck(L_99); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_99, L_100); } IL_028b: { return; } } // System.Void System.Text.RegularExpressions.Syntax.CharacterClass::GetWidth(System.Int32&,System.Int32&) extern "C" void CharacterClass_GetWidth_m2016149227 (CharacterClass_t630081023 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { int32_t V_0 = 0; { int32_t* L_0 = ___min0; int32_t* L_1 = ___max1; int32_t L_2 = 1; V_0 = L_2; *((int32_t*)(L_1)) = (int32_t)L_2; int32_t L_3 = V_0; *((int32_t*)(L_0)) = (int32_t)L_3; return; } } // System.Boolean System.Text.RegularExpressions.Syntax.CharacterClass::IsComplex() extern "C" bool CharacterClass_IsComplex_m3242686525 (CharacterClass_t630081023 * __this, const MethodInfo* method) { { return (bool)0; } } // System.Double System.Text.RegularExpressions.Syntax.CharacterClass::GetIntervalCost(System.Text.RegularExpressions.Interval) extern "C" double CharacterClass_GetIntervalCost_m3570544782 (Il2CppObject * __this /* static, unused */, Interval_t63637216 ___i0, const MethodInfo* method) { { bool L_0 = Interval_get_IsDiscontiguous_m4161255183((&___i0), /*hidden argument*/NULL); if (!L_0) { goto IL_001c; } } { int32_t L_1 = Interval_get_Size_m2053259174((&___i0), /*hidden argument*/NULL); return (((double)((double)((int32_t)((int32_t)3+(int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_1+(int32_t)((int32_t)15)))>>(int32_t)4))))))); } IL_001c: { bool L_2 = Interval_get_IsSingleton_m4044965956((&___i0), /*hidden argument*/NULL); if (!L_2) { goto IL_0032; } } { return (2.0); } IL_0032: { return (3.0); } } // System.Void System.Text.RegularExpressions.Syntax.CompositeExpression::.ctor() extern Il2CppClass* ExpressionCollection_t357621126_il2cpp_TypeInfo_var; extern const uint32_t CompositeExpression__ctor_m839662857_MetadataUsageId; extern "C" void CompositeExpression__ctor_m839662857 (CompositeExpression_t3952301679 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CompositeExpression__ctor_m839662857_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Expression__ctor_m89241894(__this, /*hidden argument*/NULL); ExpressionCollection_t357621126 * L_0 = (ExpressionCollection_t357621126 *)il2cpp_codegen_object_new(ExpressionCollection_t357621126_il2cpp_TypeInfo_var); ExpressionCollection__ctor_m235484264(L_0, /*hidden argument*/NULL); __this->set_expressions_0(L_0); return; } } // System.Text.RegularExpressions.Syntax.ExpressionCollection System.Text.RegularExpressions.Syntax.CompositeExpression::get_Expressions() extern "C" ExpressionCollection_t357621126 * CompositeExpression_get_Expressions_m2158932996 (CompositeExpression_t3952301679 * __this, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = __this->get_expressions_0(); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.CompositeExpression::GetWidth(System.Int32&,System.Int32&,System.Int32) extern "C" void CompositeExpression_GetWidth_m925194962 (CompositeExpression_t3952301679 * __this, int32_t* ___min0, int32_t* ___max1, int32_t ___count2, const MethodInfo* method) { bool V_0 = false; int32_t V_1 = 0; Expression_t1499093192 * V_2 = NULL; int32_t V_3 = 0; int32_t V_4 = 0; int32_t V_5 = 0; { int32_t* L_0 = ___min0; *((int32_t*)(L_0)) = (int32_t)((int32_t)2147483647LL); int32_t* L_1 = ___max1; *((int32_t*)(L_1)) = (int32_t)0; V_0 = (bool)1; V_1 = 0; goto IL_0053; } IL_0013: { ExpressionCollection_t357621126 * L_2 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_3 = V_1; NullCheck(L_2); Expression_t1499093192 * L_4 = ExpressionCollection_get_Item_m3558752946(L_2, L_3, /*hidden argument*/NULL); V_2 = L_4; Expression_t1499093192 * L_5 = V_2; if (L_5) { goto IL_002b; } } { goto IL_004f; } IL_002b: { V_0 = (bool)0; Expression_t1499093192 * L_6 = V_2; NullCheck(L_6); VirtActionInvoker2< int32_t*, int32_t* >::Invoke(5 /* System.Void System.Text.RegularExpressions.Syntax.Expression::GetWidth(System.Int32&,System.Int32&) */, L_6, (&V_3), (&V_4)); int32_t L_7 = V_3; int32_t* L_8 = ___min0; if ((((int32_t)L_7) >= ((int32_t)(*((int32_t*)L_8))))) { goto IL_0042; } } { int32_t* L_9 = ___min0; int32_t L_10 = V_3; *((int32_t*)(L_9)) = (int32_t)L_10; } IL_0042: { int32_t L_11 = V_4; int32_t* L_12 = ___max1; if ((((int32_t)L_11) <= ((int32_t)(*((int32_t*)L_12))))) { goto IL_004f; } } { int32_t* L_13 = ___max1; int32_t L_14 = V_4; *((int32_t*)(L_13)) = (int32_t)L_14; } IL_004f: { int32_t L_15 = V_1; V_1 = ((int32_t)((int32_t)L_15+(int32_t)1)); } IL_0053: { int32_t L_16 = V_1; int32_t L_17 = ___count2; if ((((int32_t)L_16) < ((int32_t)L_17))) { goto IL_0013; } } { bool L_18 = V_0; if (!L_18) { goto IL_006a; } } { int32_t* L_19 = ___min0; int32_t* L_20 = ___max1; int32_t L_21 = 0; V_5 = L_21; *((int32_t*)(L_20)) = (int32_t)L_21; int32_t L_22 = V_5; *((int32_t*)(L_19)) = (int32_t)L_22; } IL_006a: { return; } } // System.Boolean System.Text.RegularExpressions.Syntax.CompositeExpression::IsComplex() extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* Expression_t1499093192_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern const uint32_t CompositeExpression_IsComplex_m1954466275_MetadataUsageId; extern "C" bool CompositeExpression_IsComplex_m1954466275 (CompositeExpression_t3952301679 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (CompositeExpression_IsComplex_m1954466275_MetadataUsageId); s_Il2CppMethodIntialized = true; } Expression_t1499093192 * V_0 = NULL; Il2CppObject * V_1 = NULL; bool V_2 = false; Il2CppObject * V_3 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); Il2CppObject * L_1 = VirtFuncInvoker0< Il2CppObject * >::Invoke(4 /* System.Collections.IEnumerator System.Collections.CollectionBase::GetEnumerator() */, L_0); V_1 = L_1; } IL_000c: try { // begin try (depth: 1) { goto IL_002f; } IL_0011: { Il2CppObject * L_2 = V_1; NullCheck(L_2); Il2CppObject * L_3 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_2); V_0 = ((Expression_t1499093192 *)CastclassClass(L_3, Expression_t1499093192_il2cpp_TypeInfo_var)); Expression_t1499093192 * L_4 = V_0; NullCheck(L_4); bool L_5 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean System.Text.RegularExpressions.Syntax.Expression::IsComplex() */, L_4); if (!L_5) { goto IL_002f; } } IL_0028: { V_2 = (bool)1; IL2CPP_LEAVE(0x5E, FINALLY_003f); } IL_002f: { Il2CppObject * L_6 = V_1; NullCheck(L_6); bool L_7 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_6); if (L_7) { goto IL_0011; } } IL_003a: { IL2CPP_LEAVE(0x51, FINALLY_003f); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_003f; } FINALLY_003f: { // begin finally (depth: 1) { Il2CppObject * L_8 = V_1; V_3 = ((Il2CppObject *)IsInst(L_8, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_9 = V_3; if (L_9) { goto IL_004a; } } IL_0049: { IL2CPP_END_FINALLY(63) } IL_004a: { Il2CppObject * L_10 = V_3; NullCheck(L_10); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_10); IL2CPP_END_FINALLY(63) } } // end finally (depth: 1) IL2CPP_CLEANUP(63) { IL2CPP_JUMP_TBL(0x5E, IL_005e) IL2CPP_JUMP_TBL(0x51, IL_0051) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0051: { int32_t L_11 = Expression_GetFixedWidth_m3994281404(__this, /*hidden argument*/NULL); return (bool)((((int32_t)((((int32_t)L_11) > ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } IL_005e: { bool L_12 = V_2; return L_12; } } // System.Void System.Text.RegularExpressions.Syntax.Expression::.ctor() extern "C" void Expression__ctor_m89241894 (Expression_t1499093192 * __this, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Int32 System.Text.RegularExpressions.Syntax.Expression::GetFixedWidth() extern "C" int32_t Expression_GetFixedWidth_m3994281404 (Expression_t1499093192 * __this, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; { VirtActionInvoker2< int32_t*, int32_t* >::Invoke(5 /* System.Void System.Text.RegularExpressions.Syntax.Expression::GetWidth(System.Int32&,System.Int32&) */, __this, (&V_0), (&V_1)); int32_t L_0 = V_0; int32_t L_1 = V_1; if ((!(((uint32_t)L_0) == ((uint32_t)L_1)))) { goto IL_0013; } } { int32_t L_2 = V_0; return L_2; } IL_0013: { return (-1); } } // System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Expression::GetAnchorInfo(System.Boolean) extern Il2CppClass* AnchorInfo_t1997143859_il2cpp_TypeInfo_var; extern const uint32_t Expression_GetAnchorInfo_m1428771350_MetadataUsageId; extern "C" AnchorInfo_t1997143859 * Expression_GetAnchorInfo_m1428771350 (Expression_t1499093192 * __this, bool ___reverse0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Expression_GetAnchorInfo_m1428771350_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t L_0 = Expression_GetFixedWidth_m3994281404(__this, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_1 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m774944594(L_1, __this, L_0, /*hidden argument*/NULL); return L_1; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionAssertion::.ctor() extern "C" void ExpressionAssertion__ctor_m2776942238 (ExpressionAssertion_t563003706 * __this, const MethodInfo* method) { { Assertion__ctor_m936536102(__this, /*hidden argument*/NULL); ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); ExpressionCollection_Add_m3422413233(L_0, (Expression_t1499093192 *)NULL, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionAssertion::set_Reverse(System.Boolean) extern "C" void ExpressionAssertion_set_Reverse_m3599260152 (ExpressionAssertion_t563003706 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_reverse_1(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionAssertion::set_Negate(System.Boolean) extern "C" void ExpressionAssertion_set_Negate_m1902108060 (ExpressionAssertion_t563003706 * __this, bool ___value0, const MethodInfo* method) { { bool L_0 = ___value0; __this->set_negate_2(L_0); return; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.ExpressionAssertion::get_TestExpression() extern "C" Expression_t1499093192 * ExpressionAssertion_get_TestExpression_m1374960432 (ExpressionAssertion_t563003706 * __this, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); Expression_t1499093192 * L_1 = ExpressionCollection_get_Item_m3558752946(L_0, 2, /*hidden argument*/NULL); return L_1; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionAssertion::set_TestExpression(System.Text.RegularExpressions.Syntax.Expression) extern "C" void ExpressionAssertion_set_TestExpression_m828897591 (ExpressionAssertion_t563003706 * __this, Expression_t1499093192 * ___value0, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___value0; NullCheck(L_0); ExpressionCollection_set_Item_m3407994931(L_0, 2, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionAssertion::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t ExpressionAssertion_Compile_m2907610857_MetadataUsageId; extern "C" void ExpressionAssertion_Compile_m2907610857 (ExpressionAssertion_t563003706 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ExpressionAssertion_Compile_m2907610857_MetadataUsageId); s_Il2CppMethodIntialized = true; } LinkRef_t1270295572 * V_0 = NULL; LinkRef_t1270295572 * V_1 = NULL; LinkRef_t1270295572 * V_2 = NULL; { Il2CppObject * L_0 = ___cmp0; NullCheck(L_0); LinkRef_t1270295572 * L_1 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0); V_0 = L_1; Il2CppObject * L_2 = ___cmp0; NullCheck(L_2); LinkRef_t1270295572 * L_3 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_2); V_1 = L_3; bool L_4 = __this->get_negate_2(); if (L_4) { goto IL_0026; } } { Il2CppObject * L_5 = ___cmp0; LinkRef_t1270295572 * L_6 = V_0; LinkRef_t1270295572 * L_7 = V_1; NullCheck(L_5); InterfaceActionInvoker2< LinkRef_t1270295572 *, LinkRef_t1270295572 * >::Invoke(17 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTest(System.Text.RegularExpressions.LinkRef,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_5, L_6, L_7); goto IL_002e; } IL_0026: { Il2CppObject * L_8 = ___cmp0; LinkRef_t1270295572 * L_9 = V_1; LinkRef_t1270295572 * L_10 = V_0; NullCheck(L_8); InterfaceActionInvoker2< LinkRef_t1270295572 *, LinkRef_t1270295572 * >::Invoke(17 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTest(System.Text.RegularExpressions.LinkRef,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_8, L_9, L_10); } IL_002e: { Expression_t1499093192 * L_11 = ExpressionAssertion_get_TestExpression_m1374960432(__this, /*hidden argument*/NULL); Il2CppObject * L_12 = ___cmp0; bool L_13 = __this->get_reverse_1(); NullCheck(L_11); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_11, L_12, L_13); Il2CppObject * L_14 = ___cmp0; NullCheck(L_14); InterfaceActionInvoker0::Invoke(2 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTrue() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_14); Expression_t1499093192 * L_15 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); if (L_15) { goto IL_006a; } } { Il2CppObject * L_16 = ___cmp0; LinkRef_t1270295572 * L_17 = V_1; NullCheck(L_16); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_16, L_17); Il2CppObject * L_18 = ___cmp0; NullCheck(L_18); InterfaceActionInvoker0::Invoke(1 /* System.Void System.Text.RegularExpressions.ICompiler::EmitFalse() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_18); Il2CppObject * L_19 = ___cmp0; LinkRef_t1270295572 * L_20 = V_0; NullCheck(L_19); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_19, L_20); goto IL_00be; } IL_006a: { Il2CppObject * L_21 = ___cmp0; LinkRef_t1270295572 * L_22 = V_0; NullCheck(L_21); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_21, L_22); Expression_t1499093192 * L_23 = Assertion_get_TrueExpression_m1503749732(__this, /*hidden argument*/NULL); Il2CppObject * L_24 = ___cmp0; bool L_25 = ___reverse1; NullCheck(L_23); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_23, L_24, L_25); Expression_t1499093192 * L_26 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); if (L_26) { goto IL_0095; } } { Il2CppObject * L_27 = ___cmp0; LinkRef_t1270295572 * L_28 = V_1; NullCheck(L_27); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_27, L_28); goto IL_00be; } IL_0095: { Il2CppObject * L_29 = ___cmp0; NullCheck(L_29); LinkRef_t1270295572 * L_30 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_29); V_2 = L_30; Il2CppObject * L_31 = ___cmp0; LinkRef_t1270295572 * L_32 = V_2; NullCheck(L_31); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(19 /* System.Void System.Text.RegularExpressions.ICompiler::EmitJump(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_31, L_32); Il2CppObject * L_33 = ___cmp0; LinkRef_t1270295572 * L_34 = V_1; NullCheck(L_33); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_33, L_34); Expression_t1499093192 * L_35 = Assertion_get_FalseExpression_m2557605343(__this, /*hidden argument*/NULL); Il2CppObject * L_36 = ___cmp0; bool L_37 = ___reverse1; NullCheck(L_35); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_35, L_36, L_37); Il2CppObject * L_38 = ___cmp0; LinkRef_t1270295572 * L_39 = V_2; NullCheck(L_38); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_38, L_39); } IL_00be: { return; } } // System.Boolean System.Text.RegularExpressions.Syntax.ExpressionAssertion::IsComplex() extern "C" bool ExpressionAssertion_IsComplex_m4273897720 (ExpressionAssertion_t563003706 * __this, const MethodInfo* method) { { return (bool)1; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionCollection::.ctor() extern "C" void ExpressionCollection__ctor_m235484264 (ExpressionCollection_t357621126 * __this, const MethodInfo* method) { { CollectionBase__ctor_m3181013581(__this, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionCollection::Add(System.Text.RegularExpressions.Syntax.Expression) extern Il2CppClass* IList_t1612618265_il2cpp_TypeInfo_var; extern const uint32_t ExpressionCollection_Add_m3422413233_MetadataUsageId; extern "C" void ExpressionCollection_Add_m3422413233 (ExpressionCollection_t357621126 * __this, Expression_t1499093192 * ___e0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ExpressionCollection_Add_m3422413233_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = CollectionBase_get_List_m2531266242(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___e0; NullCheck(L_0); InterfaceFuncInvoker1< int32_t, Il2CppObject * >::Invoke(2 /* System.Int32 System.Collections.IList::Add(System.Object) */, IList_t1612618265_il2cpp_TypeInfo_var, L_0, L_1); return; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.ExpressionCollection::get_Item(System.Int32) extern Il2CppClass* IList_t1612618265_il2cpp_TypeInfo_var; extern Il2CppClass* Expression_t1499093192_il2cpp_TypeInfo_var; extern const uint32_t ExpressionCollection_get_Item_m3558752946_MetadataUsageId; extern "C" Expression_t1499093192 * ExpressionCollection_get_Item_m3558752946 (ExpressionCollection_t357621126 * __this, int32_t ___i0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ExpressionCollection_get_Item_m3558752946_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = CollectionBase_get_List_m2531266242(__this, /*hidden argument*/NULL); int32_t L_1 = ___i0; NullCheck(L_0); Il2CppObject * L_2 = InterfaceFuncInvoker1< Il2CppObject *, int32_t >::Invoke(0 /* System.Object System.Collections.IList::get_Item(System.Int32) */, IList_t1612618265_il2cpp_TypeInfo_var, L_0, L_1); return ((Expression_t1499093192 *)CastclassClass(L_2, Expression_t1499093192_il2cpp_TypeInfo_var)); } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionCollection::set_Item(System.Int32,System.Text.RegularExpressions.Syntax.Expression) extern Il2CppClass* IList_t1612618265_il2cpp_TypeInfo_var; extern const uint32_t ExpressionCollection_set_Item_m3407994931_MetadataUsageId; extern "C" void ExpressionCollection_set_Item_m3407994931 (ExpressionCollection_t357621126 * __this, int32_t ___i0, Expression_t1499093192 * ___value1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (ExpressionCollection_set_Item_m3407994931_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = CollectionBase_get_List_m2531266242(__this, /*hidden argument*/NULL); int32_t L_1 = ___i0; Expression_t1499093192 * L_2 = ___value1; NullCheck(L_0); InterfaceActionInvoker2< int32_t, Il2CppObject * >::Invoke(1 /* System.Void System.Collections.IList::set_Item(System.Int32,System.Object) */, IList_t1612618265_il2cpp_TypeInfo_var, L_0, L_1, L_2); return; } } // System.Void System.Text.RegularExpressions.Syntax.ExpressionCollection::OnValidate(System.Object) extern "C" void ExpressionCollection_OnValidate_m67467971 (ExpressionCollection_t357621126 * __this, Il2CppObject * ___o0, const MethodInfo* method) { { return; } } // System.Void System.Text.RegularExpressions.Syntax.Group::.ctor() extern "C" void Group__ctor_m358391753 (Group_t1370157167 * __this, const MethodInfo* method) { { CompositeExpression__ctor_m839662857(__this, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.Group::AppendExpression(System.Text.RegularExpressions.Syntax.Expression) extern "C" void Group_AppendExpression_m2176615607 (Group_t1370157167 * __this, Expression_t1499093192 * ___e0, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___e0; NullCheck(L_0); ExpressionCollection_Add_m3422413233(L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.Group::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern "C" void Group_Compile_m767805470 (Group_t1370157167 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; Expression_t1499093192 * V_2 = NULL; { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(5 /* System.Int32 System.Collections.CollectionBase::get_Count() */, L_0); V_0 = L_1; V_1 = 0; goto IL_0048; } IL_0013: { bool L_2 = ___reverse1; if (!L_2) { goto IL_002f; } } { ExpressionCollection_t357621126 * L_3 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_4 = V_0; int32_t L_5 = V_1; NullCheck(L_3); Expression_t1499093192 * L_6 = ExpressionCollection_get_Item_m3558752946(L_3, ((int32_t)((int32_t)((int32_t)((int32_t)L_4-(int32_t)L_5))-(int32_t)1)), /*hidden argument*/NULL); V_2 = L_6; goto IL_003c; } IL_002f: { ExpressionCollection_t357621126 * L_7 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_8 = V_1; NullCheck(L_7); Expression_t1499093192 * L_9 = ExpressionCollection_get_Item_m3558752946(L_7, L_8, /*hidden argument*/NULL); V_2 = L_9; } IL_003c: { Expression_t1499093192 * L_10 = V_2; Il2CppObject * L_11 = ___cmp0; bool L_12 = ___reverse1; NullCheck(L_10); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_10, L_11, L_12); int32_t L_13 = V_1; V_1 = ((int32_t)((int32_t)L_13+(int32_t)1)); } IL_0048: { int32_t L_14 = V_1; int32_t L_15 = V_0; if ((((int32_t)L_14) < ((int32_t)L_15))) { goto IL_0013; } } { return; } } // System.Void System.Text.RegularExpressions.Syntax.Group::GetWidth(System.Int32&,System.Int32&) extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* Expression_t1499093192_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern const uint32_t Group_GetWidth_m3807951077_MetadataUsageId; extern "C" void Group_GetWidth_m3807951077 (Group_t1370157167 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Group_GetWidth_m3807951077_MetadataUsageId); s_Il2CppMethodIntialized = true; } Expression_t1499093192 * V_0 = NULL; Il2CppObject * V_1 = NULL; int32_t V_2 = 0; int32_t V_3 = 0; Il2CppObject * V_4 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { int32_t* L_0 = ___min0; *((int32_t*)(L_0)) = (int32_t)0; int32_t* L_1 = ___max1; *((int32_t*)(L_1)) = (int32_t)0; ExpressionCollection_t357621126 * L_2 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_2); Il2CppObject * L_3 = VirtFuncInvoker0< Il2CppObject * >::Invoke(4 /* System.Collections.IEnumerator System.Collections.CollectionBase::GetEnumerator() */, L_2); V_1 = L_3; } IL_0012: try { // begin try (depth: 1) { goto IL_005c; } IL_0017: { Il2CppObject * L_4 = V_1; NullCheck(L_4); Il2CppObject * L_5 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_4); V_0 = ((Expression_t1499093192 *)CastclassClass(L_5, Expression_t1499093192_il2cpp_TypeInfo_var)); Expression_t1499093192 * L_6 = V_0; NullCheck(L_6); VirtActionInvoker2< int32_t*, int32_t* >::Invoke(5 /* System.Void System.Text.RegularExpressions.Syntax.Expression::GetWidth(System.Int32&,System.Int32&) */, L_6, (&V_2), (&V_3)); int32_t* L_7 = ___min0; int32_t* L_8 = ___min0; int32_t L_9 = V_2; *((int32_t*)(L_7)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_8))+(int32_t)L_9)); int32_t* L_10 = ___max1; if ((((int32_t)(*((int32_t*)L_10))) == ((int32_t)((int32_t)2147483647LL)))) { goto IL_004a; } } IL_003f: { int32_t L_11 = V_3; if ((!(((uint32_t)L_11) == ((uint32_t)((int32_t)2147483647LL))))) { goto IL_0056; } } IL_004a: { int32_t* L_12 = ___max1; *((int32_t*)(L_12)) = (int32_t)((int32_t)2147483647LL); goto IL_005c; } IL_0056: { int32_t* L_13 = ___max1; int32_t* L_14 = ___max1; int32_t L_15 = V_3; *((int32_t*)(L_13)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_14))+(int32_t)L_15)); } IL_005c: { Il2CppObject * L_16 = V_1; NullCheck(L_16); bool L_17 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_16); if (L_17) { goto IL_0017; } } IL_0067: { IL2CPP_LEAVE(0x81, FINALLY_006c); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_006c; } FINALLY_006c: { // begin finally (depth: 1) { Il2CppObject * L_18 = V_1; V_4 = ((Il2CppObject *)IsInst(L_18, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_19 = V_4; if (L_19) { goto IL_0079; } } IL_0078: { IL2CPP_END_FINALLY(108) } IL_0079: { Il2CppObject * L_20 = V_4; NullCheck(L_20); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_20); IL2CPP_END_FINALLY(108) } } // end finally (depth: 1) IL2CPP_CLEANUP(108) { IL2CPP_JUMP_TBL(0x81, IL_0081) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0081: { return; } } // System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Group::GetAnchorInfo(System.Boolean) extern Il2CppClass* ArrayList_t2121638921_il2cpp_TypeInfo_var; extern Il2CppClass* IntervalCollection_t2368501598_il2cpp_TypeInfo_var; extern Il2CppClass* AnchorInfo_t1997143859_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* Interval_t63637216_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern Il2CppClass* StringBuilder_t3822575854_il2cpp_TypeInfo_var; extern Il2CppClass* Console_t1097803980_il2cpp_TypeInfo_var; extern Il2CppClass* SystemException_t3155420757_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral43646246; extern Il2CppCodeGenString* _stringLiteral4036025050; extern const uint32_t Group_GetAnchorInfo_m1440957557_MetadataUsageId; extern "C" AnchorInfo_t1997143859 * Group_GetAnchorInfo_m1440957557 (Group_t1370157167 * __this, bool ___reverse0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Group_GetAnchorInfo_m1440957557_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; ArrayList_t2121638921 * V_2 = NULL; IntervalCollection_t2368501598 * V_3 = NULL; int32_t V_4 = 0; int32_t V_5 = 0; Expression_t1499093192 * V_6 = NULL; AnchorInfo_t1997143859 * V_7 = NULL; Interval_t63637216 V_8; memset(&V_8, 0, sizeof(V_8)); Interval_t63637216 V_9; memset(&V_9, 0, sizeof(V_9)); Il2CppObject * V_10 = NULL; bool V_11 = false; int32_t V_12 = 0; int32_t V_13 = 0; AnchorInfo_t1997143859 * V_14 = NULL; StringBuilder_t3822575854 * V_15 = NULL; int32_t V_16 = 0; AnchorInfo_t1997143859 * V_17 = NULL; Il2CppObject * V_18 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { int32_t L_0 = Expression_GetFixedWidth_m3994281404(__this, /*hidden argument*/NULL); V_1 = L_0; ArrayList_t2121638921 * L_1 = (ArrayList_t2121638921 *)il2cpp_codegen_object_new(ArrayList_t2121638921_il2cpp_TypeInfo_var); ArrayList__ctor_m1878432947(L_1, /*hidden argument*/NULL); V_2 = L_1; IntervalCollection_t2368501598 * L_2 = (IntervalCollection_t2368501598 *)il2cpp_codegen_object_new(IntervalCollection_t2368501598_il2cpp_TypeInfo_var); IntervalCollection__ctor_m1317729402(L_2, /*hidden argument*/NULL); V_3 = L_2; V_0 = 0; ExpressionCollection_t357621126 * L_3 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_3); int32_t L_4 = VirtFuncInvoker0< int32_t >::Invoke(5 /* System.Int32 System.Collections.CollectionBase::get_Count() */, L_3); V_4 = L_4; V_5 = 0; goto IL_00ca; } IL_002a: { bool L_5 = ___reverse0; if (!L_5) { goto IL_0049; } } { ExpressionCollection_t357621126 * L_6 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_7 = V_4; int32_t L_8 = V_5; NullCheck(L_6); Expression_t1499093192 * L_9 = ExpressionCollection_get_Item_m3558752946(L_6, ((int32_t)((int32_t)((int32_t)((int32_t)L_7-(int32_t)L_8))-(int32_t)1)), /*hidden argument*/NULL); V_6 = L_9; goto IL_0058; } IL_0049: { ExpressionCollection_t357621126 * L_10 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); int32_t L_11 = V_5; NullCheck(L_10); Expression_t1499093192 * L_12 = ExpressionCollection_get_Item_m3558752946(L_10, L_11, /*hidden argument*/NULL); V_6 = L_12; } IL_0058: { Expression_t1499093192 * L_13 = V_6; bool L_14 = ___reverse0; NullCheck(L_13); AnchorInfo_t1997143859 * L_15 = VirtFuncInvoker1< AnchorInfo_t1997143859 *, bool >::Invoke(6 /* System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Expression::GetAnchorInfo(System.Boolean) */, L_13, L_14); V_7 = L_15; ArrayList_t2121638921 * L_16 = V_2; AnchorInfo_t1997143859 * L_17 = V_7; NullCheck(L_16); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_16, L_17); AnchorInfo_t1997143859 * L_18 = V_7; NullCheck(L_18); bool L_19 = AnchorInfo_get_IsPosition_m467864027(L_18, /*hidden argument*/NULL); if (!L_19) { goto IL_008f; } } { int32_t L_20 = V_0; AnchorInfo_t1997143859 * L_21 = V_7; NullCheck(L_21); int32_t L_22 = AnchorInfo_get_Offset_m110301077(L_21, /*hidden argument*/NULL); int32_t L_23 = V_1; AnchorInfo_t1997143859 * L_24 = V_7; NullCheck(L_24); uint16_t L_25 = AnchorInfo_get_Position_m1033547864(L_24, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_26 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m3146766459(L_26, __this, ((int32_t)((int32_t)L_20+(int32_t)L_22)), L_23, L_25, /*hidden argument*/NULL); return L_26; } IL_008f: { AnchorInfo_t1997143859 * L_27 = V_7; NullCheck(L_27); bool L_28 = AnchorInfo_get_IsSubstring_m506285889(L_27, /*hidden argument*/NULL); if (!L_28) { goto IL_00a9; } } { IntervalCollection_t2368501598 * L_29 = V_3; AnchorInfo_t1997143859 * L_30 = V_7; int32_t L_31 = V_0; NullCheck(L_30); Interval_t63637216 L_32 = AnchorInfo_GetInterval_m1447205988(L_30, L_31, /*hidden argument*/NULL); NullCheck(L_29); IntervalCollection_Add_m622937095(L_29, L_32, /*hidden argument*/NULL); } IL_00a9: { AnchorInfo_t1997143859 * L_33 = V_7; NullCheck(L_33); bool L_34 = AnchorInfo_get_IsUnknownWidth_m3273649934(L_33, /*hidden argument*/NULL); if (!L_34) { goto IL_00ba; } } { goto IL_00d3; } IL_00ba: { int32_t L_35 = V_0; AnchorInfo_t1997143859 * L_36 = V_7; NullCheck(L_36); int32_t L_37 = AnchorInfo_get_Width_m814480998(L_36, /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)L_35+(int32_t)L_37)); int32_t L_38 = V_5; V_5 = ((int32_t)((int32_t)L_38+(int32_t)1)); } IL_00ca: { int32_t L_39 = V_5; int32_t L_40 = V_4; if ((((int32_t)L_39) < ((int32_t)L_40))) { goto IL_002a; } } IL_00d3: { IntervalCollection_t2368501598 * L_41 = V_3; NullCheck(L_41); IntervalCollection_Normalize_m2061698533(L_41, /*hidden argument*/NULL); Interval_t63637216 L_42 = Interval_get_Empty_m2836746235(NULL /*static, unused*/, /*hidden argument*/NULL); V_8 = L_42; IntervalCollection_t2368501598 * L_43 = V_3; NullCheck(L_43); Il2CppObject * L_44 = VirtFuncInvoker0< Il2CppObject * >::Invoke(7 /* System.Collections.IEnumerator System.Text.RegularExpressions.IntervalCollection::GetEnumerator() */, L_43); V_10 = L_44; } IL_00e8: try { // begin try (depth: 1) { goto IL_0112; } IL_00ed: { Il2CppObject * L_45 = V_10; NullCheck(L_45); Il2CppObject * L_46 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_45); V_9 = ((*(Interval_t63637216 *)((Interval_t63637216 *)UnBox (L_46, Interval_t63637216_il2cpp_TypeInfo_var)))); int32_t L_47 = Interval_get_Size_m2053259174((&V_9), /*hidden argument*/NULL); int32_t L_48 = Interval_get_Size_m2053259174((&V_8), /*hidden argument*/NULL); if ((((int32_t)L_47) <= ((int32_t)L_48))) { goto IL_0112; } } IL_010e: { Interval_t63637216 L_49 = V_9; V_8 = L_49; } IL_0112: { Il2CppObject * L_50 = V_10; NullCheck(L_50); bool L_51 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_50); if (L_51) { goto IL_00ed; } } IL_011e: { IL2CPP_LEAVE(0x139, FINALLY_0123); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_0123; } FINALLY_0123: { // begin finally (depth: 1) { Il2CppObject * L_52 = V_10; V_18 = ((Il2CppObject *)IsInst(L_52, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_53 = V_18; if (L_53) { goto IL_0131; } } IL_0130: { IL2CPP_END_FINALLY(291) } IL_0131: { Il2CppObject * L_54 = V_18; NullCheck(L_54); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_54); IL2CPP_END_FINALLY(291) } } // end finally (depth: 1) IL2CPP_CLEANUP(291) { IL2CPP_JUMP_TBL(0x139, IL_0139) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0139: { bool L_55 = Interval_get_IsEmpty_m2142357766((&V_8), /*hidden argument*/NULL); if (!L_55) { goto IL_014d; } } { int32_t L_56 = V_1; AnchorInfo_t1997143859 * L_57 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m774944594(L_57, __this, L_56, /*hidden argument*/NULL); return L_57; } IL_014d: { V_11 = (bool)0; V_12 = 0; V_0 = 0; V_13 = 0; goto IL_01c8; } IL_015d: { ArrayList_t2121638921 * L_58 = V_2; int32_t L_59 = V_13; NullCheck(L_58); Il2CppObject * L_60 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_58, L_59); V_14 = ((AnchorInfo_t1997143859 *)CastclassClass(L_60, AnchorInfo_t1997143859_il2cpp_TypeInfo_var)); AnchorInfo_t1997143859 * L_61 = V_14; NullCheck(L_61); bool L_62 = AnchorInfo_get_IsSubstring_m506285889(L_61, /*hidden argument*/NULL); if (!L_62) { goto IL_01a7; } } { AnchorInfo_t1997143859 * L_63 = V_14; int32_t L_64 = V_0; NullCheck(L_63); Interval_t63637216 L_65 = AnchorInfo_GetInterval_m1447205988(L_63, L_64, /*hidden argument*/NULL); bool L_66 = Interval_Contains_m2884982059((&V_8), L_65, /*hidden argument*/NULL); if (!L_66) { goto IL_01a7; } } { bool L_67 = V_11; AnchorInfo_t1997143859 * L_68 = V_14; NullCheck(L_68); bool L_69 = AnchorInfo_get_IgnoreCase_m843009482(L_68, /*hidden argument*/NULL); V_11 = (bool)((int32_t)((int32_t)L_67|(int32_t)L_69)); ArrayList_t2121638921 * L_70 = V_2; int32_t L_71 = V_12; int32_t L_72 = L_71; V_12 = ((int32_t)((int32_t)L_72+(int32_t)1)); AnchorInfo_t1997143859 * L_73 = V_14; NullCheck(L_70); VirtActionInvoker2< int32_t, Il2CppObject * >::Invoke(19 /* System.Void System.Collections.ArrayList::set_Item(System.Int32,System.Object) */, L_70, L_72, L_73); } IL_01a7: { AnchorInfo_t1997143859 * L_74 = V_14; NullCheck(L_74); bool L_75 = AnchorInfo_get_IsUnknownWidth_m3273649934(L_74, /*hidden argument*/NULL); if (!L_75) { goto IL_01b8; } } { goto IL_01d5; } IL_01b8: { int32_t L_76 = V_0; AnchorInfo_t1997143859 * L_77 = V_14; NullCheck(L_77); int32_t L_78 = AnchorInfo_get_Width_m814480998(L_77, /*hidden argument*/NULL); V_0 = ((int32_t)((int32_t)L_76+(int32_t)L_78)); int32_t L_79 = V_13; V_13 = ((int32_t)((int32_t)L_79+(int32_t)1)); } IL_01c8: { int32_t L_80 = V_13; ArrayList_t2121638921 * L_81 = V_2; NullCheck(L_81); int32_t L_82 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_81); if ((((int32_t)L_80) < ((int32_t)L_82))) { goto IL_015d; } } IL_01d5: { StringBuilder_t3822575854 * L_83 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m135953004(L_83, /*hidden argument*/NULL); V_15 = L_83; V_16 = 0; goto IL_0227; } IL_01e4: { bool L_84 = ___reverse0; if (!L_84) { goto IL_0203; } } { ArrayList_t2121638921 * L_85 = V_2; int32_t L_86 = V_12; int32_t L_87 = V_16; NullCheck(L_85); Il2CppObject * L_88 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_85, ((int32_t)((int32_t)((int32_t)((int32_t)L_86-(int32_t)L_87))-(int32_t)1))); V_17 = ((AnchorInfo_t1997143859 *)CastclassClass(L_88, AnchorInfo_t1997143859_il2cpp_TypeInfo_var)); goto IL_0212; } IL_0203: { ArrayList_t2121638921 * L_89 = V_2; int32_t L_90 = V_16; NullCheck(L_89); Il2CppObject * L_91 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_89, L_90); V_17 = ((AnchorInfo_t1997143859 *)CastclassClass(L_91, AnchorInfo_t1997143859_il2cpp_TypeInfo_var)); } IL_0212: { StringBuilder_t3822575854 * L_92 = V_15; AnchorInfo_t1997143859 * L_93 = V_17; NullCheck(L_93); String_t* L_94 = AnchorInfo_get_Substring_m1320966366(L_93, /*hidden argument*/NULL); NullCheck(L_92); StringBuilder_Append_m3898090075(L_92, L_94, /*hidden argument*/NULL); int32_t L_95 = V_16; V_16 = ((int32_t)((int32_t)L_95+(int32_t)1)); } IL_0227: { int32_t L_96 = V_16; int32_t L_97 = V_12; if ((((int32_t)L_96) < ((int32_t)L_97))) { goto IL_01e4; } } { StringBuilder_t3822575854 * L_98 = V_15; NullCheck(L_98); int32_t L_99 = StringBuilder_get_Length_m2443133099(L_98, /*hidden argument*/NULL); int32_t L_100 = Interval_get_Size_m2053259174((&V_8), /*hidden argument*/NULL); if ((!(((uint32_t)L_99) == ((uint32_t)L_100)))) { goto IL_025b; } } { int32_t L_101 = (&V_8)->get_low_0(); int32_t L_102 = V_1; StringBuilder_t3822575854 * L_103 = V_15; NullCheck(L_103); String_t* L_104 = StringBuilder_ToString_m350379841(L_103, /*hidden argument*/NULL); bool L_105 = V_11; AnchorInfo_t1997143859 * L_106 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m2237276956(L_106, __this, L_101, L_102, L_104, L_105, /*hidden argument*/NULL); return L_106; } IL_025b: { StringBuilder_t3822575854 * L_107 = V_15; NullCheck(L_107); int32_t L_108 = StringBuilder_get_Length_m2443133099(L_107, /*hidden argument*/NULL); int32_t L_109 = Interval_get_Size_m2053259174((&V_8), /*hidden argument*/NULL); if ((((int32_t)L_108) <= ((int32_t)L_109))) { goto IL_0285; } } { IL2CPP_RUNTIME_CLASS_INIT(Console_t1097803980_il2cpp_TypeInfo_var); TextWriter_t1689927879 * L_110 = Console_get_Error_m3008907509(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_110); VirtActionInvoker1< String_t* >::Invoke(13 /* System.Void System.IO.TextWriter::WriteLine(System.String) */, L_110, _stringLiteral43646246); int32_t L_111 = V_1; AnchorInfo_t1997143859 * L_112 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m774944594(L_112, __this, L_111, /*hidden argument*/NULL); return L_112; } IL_0285: { SystemException_t3155420757 * L_113 = (SystemException_t3155420757 *)il2cpp_codegen_object_new(SystemException_t3155420757_il2cpp_TypeInfo_var); SystemException__ctor_m3697314481(L_113, _stringLiteral4036025050, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_113); } } // System.Void System.Text.RegularExpressions.Syntax.Literal::.ctor(System.String,System.Boolean) extern "C" void Literal__ctor_m1496565524 (Literal_t3148194463 * __this, String_t* ___str0, bool ___ignore1, const MethodInfo* method) { { Expression__ctor_m89241894(__this, /*hidden argument*/NULL); String_t* L_0 = ___str0; __this->set_str_0(L_0); bool L_1 = ___ignore1; __this->set_ignore_1(L_1); return; } } // System.Void System.Text.RegularExpressions.Syntax.Literal::CompileLiteral(System.String,System.Text.RegularExpressions.ICompiler,System.Boolean,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t Literal_CompileLiteral_m187321040_MetadataUsageId; extern "C" void Literal_CompileLiteral_m187321040 (Il2CppObject * __this /* static, unused */, String_t* ___str0, Il2CppObject * ___cmp1, bool ___ignore2, bool ___reverse3, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Literal_CompileLiteral_m187321040_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___str0; NullCheck(L_0); int32_t L_1 = String_get_Length_m2979997331(L_0, /*hidden argument*/NULL); if (L_1) { goto IL_000c; } } { return; } IL_000c: { String_t* L_2 = ___str0; NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); if ((!(((uint32_t)L_3) == ((uint32_t)1)))) { goto IL_002d; } } { Il2CppObject * L_4 = ___cmp1; String_t* L_5 = ___str0; NullCheck(L_5); uint16_t L_6 = String_get_Chars_m3015341861(L_5, 0, /*hidden argument*/NULL); bool L_7 = ___ignore2; bool L_8 = ___reverse3; NullCheck(L_4); InterfaceActionInvoker4< uint16_t, bool, bool, bool >::Invoke(3 /* System.Void System.Text.RegularExpressions.ICompiler::EmitCharacter(System.Char,System.Boolean,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_4, L_6, (bool)0, L_7, L_8); goto IL_0036; } IL_002d: { Il2CppObject * L_9 = ___cmp1; String_t* L_10 = ___str0; bool L_11 = ___ignore2; bool L_12 = ___reverse3; NullCheck(L_9); InterfaceActionInvoker3< String_t*, bool, bool >::Invoke(8 /* System.Void System.Text.RegularExpressions.ICompiler::EmitString(System.String,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_9, L_10, L_11, L_12); } IL_0036: { return; } } // System.Void System.Text.RegularExpressions.Syntax.Literal::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern "C" void Literal_Compile_m2265605006 (Literal_t3148194463 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { { String_t* L_0 = __this->get_str_0(); Il2CppObject * L_1 = ___cmp0; bool L_2 = __this->get_ignore_1(); bool L_3 = ___reverse1; Literal_CompileLiteral_m187321040(NULL /*static, unused*/, L_0, L_1, L_2, L_3, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.Literal::GetWidth(System.Int32&,System.Int32&) extern "C" void Literal_GetWidth_m2047345525 (Literal_t3148194463 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { int32_t V_0 = 0; { int32_t* L_0 = ___min0; int32_t* L_1 = ___max1; String_t* L_2 = __this->get_str_0(); NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); int32_t L_4 = L_3; V_0 = L_4; *((int32_t*)(L_1)) = (int32_t)L_4; int32_t L_5 = V_0; *((int32_t*)(L_0)) = (int32_t)L_5; return; } } // System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Literal::GetAnchorInfo(System.Boolean) extern Il2CppClass* AnchorInfo_t1997143859_il2cpp_TypeInfo_var; extern const uint32_t Literal_GetAnchorInfo_m193937285_MetadataUsageId; extern "C" AnchorInfo_t1997143859 * Literal_GetAnchorInfo_m193937285 (Literal_t3148194463 * __this, bool ___reverse0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Literal_GetAnchorInfo_m193937285_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = __this->get_str_0(); NullCheck(L_0); int32_t L_1 = String_get_Length_m2979997331(L_0, /*hidden argument*/NULL); String_t* L_2 = __this->get_str_0(); bool L_3 = __this->get_ignore_1(); AnchorInfo_t1997143859 * L_4 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m2237276956(L_4, __this, 0, L_1, L_2, L_3, /*hidden argument*/NULL); return L_4; } } // System.Boolean System.Text.RegularExpressions.Syntax.Literal::IsComplex() extern "C" bool Literal_IsComplex_m712383539 (Literal_t3148194463 * __this, const MethodInfo* method) { { return (bool)0; } } // System.Void System.Text.RegularExpressions.Syntax.NonBacktrackingGroup::.ctor() extern "C" void NonBacktrackingGroup__ctor_m1908070474 (NonBacktrackingGroup_t1448538980 * __this, const MethodInfo* method) { { Group__ctor_m358391753(__this, /*hidden argument*/NULL); return; } } // System.Void System.Text.RegularExpressions.Syntax.NonBacktrackingGroup::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t NonBacktrackingGroup_Compile_m2947364541_MetadataUsageId; extern "C" void NonBacktrackingGroup_Compile_m2947364541 (NonBacktrackingGroup_t1448538980 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (NonBacktrackingGroup_Compile_m2947364541_MetadataUsageId); s_Il2CppMethodIntialized = true; } LinkRef_t1270295572 * V_0 = NULL; { Il2CppObject * L_0 = ___cmp0; NullCheck(L_0); LinkRef_t1270295572 * L_1 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0); V_0 = L_1; Il2CppObject * L_2 = ___cmp0; LinkRef_t1270295572 * L_3 = V_0; NullCheck(L_2); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(16 /* System.Void System.Text.RegularExpressions.ICompiler::EmitSub(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_2, L_3); Il2CppObject * L_4 = ___cmp0; bool L_5 = ___reverse1; Group_Compile_m767805470(__this, L_4, L_5, /*hidden argument*/NULL); Il2CppObject * L_6 = ___cmp0; NullCheck(L_6); InterfaceActionInvoker0::Invoke(2 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTrue() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_6); Il2CppObject * L_7 = ___cmp0; LinkRef_t1270295572 * L_8 = V_0; NullCheck(L_7); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_7, L_8); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.NonBacktrackingGroup::IsComplex() extern "C" bool NonBacktrackingGroup_IsComplex_m200933176 (NonBacktrackingGroup_t1448538980 * __this, const MethodInfo* method) { { return (bool)1; } } // System.Void System.Text.RegularExpressions.Syntax.Parser::.ctor() extern Il2CppClass* ArrayList_t2121638921_il2cpp_TypeInfo_var; extern Il2CppClass* Hashtable_t3875263730_il2cpp_TypeInfo_var; extern const uint32_t Parser__ctor_m1404972287_MetadataUsageId; extern "C" void Parser__ctor_m1404972287 (Parser_t3684504143 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser__ctor_m1404972287_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); ArrayList_t2121638921 * L_0 = (ArrayList_t2121638921 *)il2cpp_codegen_object_new(ArrayList_t2121638921_il2cpp_TypeInfo_var); ArrayList__ctor_m1878432947(L_0, /*hidden argument*/NULL); __this->set_caps_2(L_0); Hashtable_t3875263730 * L_1 = (Hashtable_t3875263730 *)il2cpp_codegen_object_new(Hashtable_t3875263730_il2cpp_TypeInfo_var); Hashtable__ctor_m1514037738(L_1, /*hidden argument*/NULL); __this->set_refs_3(L_1); return; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseDecimal(System.String,System.Int32&) extern "C" int32_t Parser_ParseDecimal_m3118847812 (Il2CppObject * __this /* static, unused */, String_t* ___str0, int32_t* ___ptr1, const MethodInfo* method) { { String_t* L_0 = ___str0; int32_t* L_1 = ___ptr1; int32_t L_2 = Parser_ParseNumber_m633788361(NULL /*static, unused*/, L_0, L_1, ((int32_t)10), 1, ((int32_t)2147483647LL), /*hidden argument*/NULL); return L_2; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseOctal(System.String,System.Int32&) extern "C" int32_t Parser_ParseOctal_m1398273866 (Il2CppObject * __this /* static, unused */, String_t* ___str0, int32_t* ___ptr1, const MethodInfo* method) { { String_t* L_0 = ___str0; int32_t* L_1 = ___ptr1; int32_t L_2 = Parser_ParseNumber_m633788361(NULL /*static, unused*/, L_0, L_1, 8, 1, 3, /*hidden argument*/NULL); return L_2; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseHex(System.String,System.Int32&,System.Int32) extern "C" int32_t Parser_ParseHex_m370479069 (Il2CppObject * __this /* static, unused */, String_t* ___str0, int32_t* ___ptr1, int32_t ___digits2, const MethodInfo* method) { { String_t* L_0 = ___str0; int32_t* L_1 = ___ptr1; int32_t L_2 = ___digits2; int32_t L_3 = ___digits2; int32_t L_4 = Parser_ParseNumber_m633788361(NULL /*static, unused*/, L_0, L_1, ((int32_t)16), L_2, L_3, /*hidden argument*/NULL); return L_4; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseNumber(System.String,System.Int32&,System.Int32,System.Int32,System.Int32) extern "C" int32_t Parser_ParseNumber_m633788361 (Il2CppObject * __this /* static, unused */, String_t* ___str0, int32_t* ___ptr1, int32_t ___b2, int32_t ___min3, int32_t ___max4, const MethodInfo* method) { int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; int32_t V_3 = 0; { int32_t* L_0 = ___ptr1; V_0 = (*((int32_t*)L_0)); V_1 = 0; V_2 = 0; int32_t L_1 = ___max4; int32_t L_2 = ___min3; if ((((int32_t)L_1) >= ((int32_t)L_2))) { goto IL_0016; } } { ___max4 = ((int32_t)2147483647LL); } IL_0016: { goto IL_0048; } IL_001b: { String_t* L_3 = ___str0; int32_t L_4 = V_0; int32_t L_5 = L_4; V_0 = ((int32_t)((int32_t)L_5+(int32_t)1)); NullCheck(L_3); uint16_t L_6 = String_get_Chars_m3015341861(L_3, L_5, /*hidden argument*/NULL); int32_t L_7 = ___b2; int32_t L_8 = V_2; int32_t L_9 = Parser_ParseDigit_m3105438222(NULL /*static, unused*/, L_6, L_7, L_8, /*hidden argument*/NULL); V_3 = L_9; int32_t L_10 = V_3; if ((((int32_t)L_10) >= ((int32_t)0))) { goto IL_003e; } } { int32_t L_11 = V_0; V_0 = ((int32_t)((int32_t)L_11-(int32_t)1)); goto IL_005c; } IL_003e: { int32_t L_12 = V_1; int32_t L_13 = ___b2; int32_t L_14 = V_3; V_1 = ((int32_t)((int32_t)((int32_t)((int32_t)L_12*(int32_t)L_13))+(int32_t)L_14)); int32_t L_15 = V_2; V_2 = ((int32_t)((int32_t)L_15+(int32_t)1)); } IL_0048: { int32_t L_16 = V_2; int32_t L_17 = ___max4; if ((((int32_t)L_16) >= ((int32_t)L_17))) { goto IL_005c; } } { int32_t L_18 = V_0; String_t* L_19 = ___str0; NullCheck(L_19); int32_t L_20 = String_get_Length_m2979997331(L_19, /*hidden argument*/NULL); if ((((int32_t)L_18) < ((int32_t)L_20))) { goto IL_001b; } } IL_005c: { int32_t L_21 = V_2; int32_t L_22 = ___min3; if ((((int32_t)L_21) >= ((int32_t)L_22))) { goto IL_0065; } } { return (-1); } IL_0065: { int32_t* L_23 = ___ptr1; int32_t L_24 = V_0; *((int32_t*)(L_23)) = (int32_t)L_24; int32_t L_25 = V_1; return L_25; } } // System.String System.Text.RegularExpressions.Syntax.Parser::ParseName(System.String,System.Int32&) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t Parser_ParseName_m3152672479_MetadataUsageId; extern "C" String_t* Parser_ParseName_m3152672479 (Il2CppObject * __this /* static, unused */, String_t* ___str0, int32_t* ___ptr1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseName_m3152672479_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; { String_t* L_0 = ___str0; int32_t* L_1 = ___ptr1; NullCheck(L_0); uint16_t L_2 = String_get_Chars_m3015341861(L_0, (*((int32_t*)L_1)), /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_3 = Char_IsDigit_m1743537211(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_002f; } } { String_t* L_4 = ___str0; int32_t* L_5 = ___ptr1; int32_t L_6 = Parser_ParseNumber_m633788361(NULL /*static, unused*/, L_4, L_5, ((int32_t)10), 1, 0, /*hidden argument*/NULL); V_0 = L_6; int32_t L_7 = V_0; if ((((int32_t)L_7) <= ((int32_t)0))) { goto IL_002d; } } { String_t* L_8 = Int32_ToString_m1286526384((&V_0), /*hidden argument*/NULL); return L_8; } IL_002d: { return (String_t*)NULL; } IL_002f: { int32_t* L_9 = ___ptr1; V_1 = (*((int32_t*)L_9)); goto IL_0054; } IL_0037: { String_t* L_10 = ___str0; int32_t* L_11 = ___ptr1; NullCheck(L_10); uint16_t L_12 = String_get_Chars_m3015341861(L_10, (*((int32_t*)L_11)), /*hidden argument*/NULL); bool L_13 = Parser_IsNameChar_m1287282583(NULL /*static, unused*/, L_12, /*hidden argument*/NULL); if (L_13) { goto IL_004e; } } { goto IL_0059; } IL_004e: { int32_t* L_14 = ___ptr1; int32_t* L_15 = ___ptr1; *((int32_t*)(L_14)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_15))+(int32_t)1)); } IL_0054: { goto IL_0037; } IL_0059: { int32_t* L_16 = ___ptr1; int32_t L_17 = V_1; if ((((int32_t)((int32_t)((int32_t)(*((int32_t*)L_16))-(int32_t)L_17))) <= ((int32_t)0))) { goto IL_006f; } } { String_t* L_18 = ___str0; int32_t L_19 = V_1; int32_t* L_20 = ___ptr1; int32_t L_21 = V_1; NullCheck(L_18); String_t* L_22 = String_Substring_m675079568(L_18, L_19, ((int32_t)((int32_t)(*((int32_t*)L_20))-(int32_t)L_21)), /*hidden argument*/NULL); return L_22; } IL_006f: { return (String_t*)NULL; } } // System.Text.RegularExpressions.Syntax.RegularExpression System.Text.RegularExpressions.Syntax.Parser::ParseRegularExpression(System.String,System.Text.RegularExpressions.RegexOptions) extern Il2CppClass* RegularExpression_t1734534468_il2cpp_TypeInfo_var; extern Il2CppClass* IndexOutOfRangeException_t3760259642_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3507487059; extern const uint32_t Parser_ParseRegularExpression_m3601917447_MetadataUsageId; extern "C" RegularExpression_t1734534468 * Parser_ParseRegularExpression_m3601917447 (Parser_t3684504143 * __this, String_t* ___pattern0, int32_t ___options1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseRegularExpression_m3601917447_MetadataUsageId); s_Il2CppMethodIntialized = true; } RegularExpression_t1734534468 * V_0 = NULL; RegularExpression_t1734534468 * V_1 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { String_t* L_0 = ___pattern0; __this->set_pattern_0(L_0); __this->set_ptr_1(0); ArrayList_t2121638921 * L_1 = __this->get_caps_2(); NullCheck(L_1); VirtActionInvoker0::Invoke(27 /* System.Void System.Collections.ArrayList::Clear() */, L_1); Hashtable_t3875263730 * L_2 = __this->get_refs_3(); NullCheck(L_2); VirtActionInvoker0::Invoke(24 /* System.Void System.Collections.Hashtable::Clear() */, L_2); __this->set_num_groups_4(0); } IL_002b: try { // begin try (depth: 1) { RegularExpression_t1734534468 * L_3 = (RegularExpression_t1734534468 *)il2cpp_codegen_object_new(RegularExpression_t1734534468_il2cpp_TypeInfo_var); RegularExpression__ctor_m365120276(L_3, /*hidden argument*/NULL); V_0 = L_3; RegularExpression_t1734534468 * L_4 = V_0; int32_t L_5 = ___options1; Parser_ParseGroup_m2536720048(__this, L_4, L_5, (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); Parser_ResolveReferences_m1842037937(__this, /*hidden argument*/NULL); RegularExpression_t1734534468 * L_6 = V_0; int32_t L_7 = __this->get_num_groups_4(); NullCheck(L_6); RegularExpression_set_GroupCount_m508599630(L_6, L_7, /*hidden argument*/NULL); RegularExpression_t1734534468 * L_8 = V_0; V_1 = L_8; goto IL_006a; } IL_0053: { ; // IL_0053: leave IL_006a } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __exception_local = (Exception_t1967233988 *)e.ex; if(il2cpp_codegen_class_is_assignable_from (IndexOutOfRangeException_t3760259642_il2cpp_TypeInfo_var, e.ex->object.klass)) goto CATCH_0058; throw e; } CATCH_0058: { // begin catch(System.IndexOutOfRangeException) { ArgumentException_t124305799 * L_9 = Parser_NewParseException_m3475856021(__this, _stringLiteral3507487059, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_9); } IL_0065: { goto IL_006a; } } // end catch (depth: 1) IL_006a: { RegularExpression_t1734534468 * L_10 = V_1; return L_10; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::GetMapping(System.Collections.Hashtable) extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern Il2CppClass* CapturingGroup_t1439411180_il2cpp_TypeInfo_var; extern Il2CppClass* SystemException_t3155420757_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral48; extern Il2CppCodeGenString* _stringLiteral1654666536; extern const uint32_t Parser_GetMapping_m2242103141_MetadataUsageId; extern "C" int32_t Parser_GetMapping_m2242103141 (Parser_t3684504143 * __this, Hashtable_t3875263730 * ___mapping0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_GetMapping_m2242103141_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; CapturingGroup_t1439411180 * V_2 = NULL; String_t* V_3 = NULL; int32_t V_4 = 0; String_t* G_B4_0 = NULL; { ArrayList_t2121638921 * L_0 = __this->get_caps_2(); NullCheck(L_0); int32_t L_1 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_0); V_0 = L_1; Hashtable_t3875263730 * L_2 = ___mapping0; int32_t L_3 = 0; Il2CppObject * L_4 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_3); NullCheck(L_2); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_2, _stringLiteral48, L_4); V_1 = 0; goto IL_00a5; } IL_0024: { ArrayList_t2121638921 * L_5 = __this->get_caps_2(); int32_t L_6 = V_1; NullCheck(L_5); Il2CppObject * L_7 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_5, L_6); V_2 = ((CapturingGroup_t1439411180 *)CastclassClass(L_7, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); CapturingGroup_t1439411180 * L_8 = V_2; NullCheck(L_8); String_t* L_9 = CapturingGroup_get_Name_m1678290617(L_8, /*hidden argument*/NULL); if (!L_9) { goto IL_004c; } } { CapturingGroup_t1439411180 * L_10 = V_2; NullCheck(L_10); String_t* L_11 = CapturingGroup_get_Name_m1678290617(L_10, /*hidden argument*/NULL); G_B4_0 = L_11; goto IL_005b; } IL_004c: { CapturingGroup_t1439411180 * L_12 = V_2; NullCheck(L_12); int32_t L_13 = CapturingGroup_get_Index_m1539088601(L_12, /*hidden argument*/NULL); V_4 = L_13; String_t* L_14 = Int32_ToString_m1286526384((&V_4), /*hidden argument*/NULL); G_B4_0 = L_14; } IL_005b: { V_3 = G_B4_0; Hashtable_t3875263730 * L_15 = ___mapping0; String_t* L_16 = V_3; NullCheck(L_15); bool L_17 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(25 /* System.Boolean System.Collections.Hashtable::Contains(System.Object) */, L_15, L_16); if (!L_17) { goto IL_008f; } } { Hashtable_t3875263730 * L_18 = ___mapping0; String_t* L_19 = V_3; NullCheck(L_18); Il2CppObject * L_20 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_18, L_19); CapturingGroup_t1439411180 * L_21 = V_2; NullCheck(L_21); int32_t L_22 = CapturingGroup_get_Index_m1539088601(L_21, /*hidden argument*/NULL); if ((((int32_t)((*(int32_t*)((int32_t*)UnBox (L_20, Int32_t2847414787_il2cpp_TypeInfo_var))))) == ((int32_t)L_22))) { goto IL_008a; } } { SystemException_t3155420757 * L_23 = (SystemException_t3155420757 *)il2cpp_codegen_object_new(SystemException_t3155420757_il2cpp_TypeInfo_var); SystemException__ctor_m3697314481(L_23, _stringLiteral1654666536, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_23); } IL_008a: { goto IL_00a1; } IL_008f: { Hashtable_t3875263730 * L_24 = ___mapping0; String_t* L_25 = V_3; CapturingGroup_t1439411180 * L_26 = V_2; NullCheck(L_26); int32_t L_27 = CapturingGroup_get_Index_m1539088601(L_26, /*hidden argument*/NULL); int32_t L_28 = L_27; Il2CppObject * L_29 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_28); NullCheck(L_24); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_24, L_25, L_29); } IL_00a1: { int32_t L_30 = V_1; V_1 = ((int32_t)((int32_t)L_30+(int32_t)1)); } IL_00a5: { int32_t L_31 = V_1; int32_t L_32 = V_0; if ((((int32_t)L_31) < ((int32_t)L_32))) { goto IL_0024; } } { int32_t L_33 = __this->get_gap_5(); return L_33; } } // System.Void System.Text.RegularExpressions.Syntax.Parser::ParseGroup(System.Text.RegularExpressions.Syntax.Group,System.Text.RegularExpressions.RegexOptions,System.Text.RegularExpressions.Syntax.Assertion) extern Il2CppClass* RegularExpression_t1734534468_il2cpp_TypeInfo_var; extern Il2CppClass* Group_t1370157167_il2cpp_TypeInfo_var; extern Il2CppClass* PositionAssertion_t3660056009_il2cpp_TypeInfo_var; extern Il2CppClass* CharacterClass_t630081023_il2cpp_TypeInfo_var; extern Il2CppClass* Literal_t3148194463_il2cpp_TypeInfo_var; extern Il2CppClass* Alternation_t2772154573_il2cpp_TypeInfo_var; extern Il2CppClass* Repetition_t693899937_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral1000366503; extern Il2CppCodeGenString* _stringLiteral3246343677; extern Il2CppCodeGenString* _stringLiteral3121597678; extern Il2CppCodeGenString* _stringLiteral3471260284; extern const uint32_t Parser_ParseGroup_m2536720048_MetadataUsageId; extern "C" void Parser_ParseGroup_m2536720048 (Parser_t3684504143 * __this, Group_t1370157167 * ___group0, int32_t ___options1, Assertion_t324477170 * ___assertion2, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseGroup_m2536720048_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; Alternation_t2772154573 * V_1 = NULL; String_t* V_2 = NULL; Group_t1370157167 * V_3 = NULL; Expression_t1499093192 * V_4 = NULL; bool V_5 = false; uint16_t V_6 = 0x0; uint16_t V_7 = 0; uint16_t V_8 = 0; uint16_t V_9 = 0; int32_t V_10 = 0; bool V_11 = false; uint16_t V_12 = 0x0; int32_t V_13 = 0; int32_t V_14 = 0; bool V_15 = false; bool V_16 = false; int32_t V_17 = 0; Repetition_t693899937 * V_18 = NULL; int32_t V_19 = 0; uint16_t V_20 = 0x0; int32_t G_B11_0 = 0; int32_t G_B15_0 = 0; int32_t G_B19_0 = 0; { Group_t1370157167 * L_0 = ___group0; V_0 = (bool)((!(((Il2CppObject*)(RegularExpression_t1734534468 *)((RegularExpression_t1734534468 *)IsInstClass(L_0, RegularExpression_t1734534468_il2cpp_TypeInfo_var))) <= ((Il2CppObject*)(Il2CppObject *)NULL)))? 1 : 0); V_1 = (Alternation_t2772154573 *)NULL; V_2 = (String_t*)NULL; Group_t1370157167 * L_1 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_1, /*hidden argument*/NULL); V_3 = L_1; V_4 = (Expression_t1499093192 *)NULL; V_5 = (bool)0; } IL_001a: { int32_t L_2 = ___options1; bool L_3 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_3, /*hidden argument*/NULL); int32_t L_4 = __this->get_ptr_1(); String_t* L_5 = __this->get_pattern_0(); NullCheck(L_5); int32_t L_6 = String_get_Length_m2979997331(L_5, /*hidden argument*/NULL); if ((((int32_t)L_4) < ((int32_t)L_6))) { goto IL_0041; } } { goto IL_0484; } IL_0041: { String_t* L_7 = __this->get_pattern_0(); int32_t L_8 = __this->get_ptr_1(); int32_t L_9 = L_8; V_19 = L_9; __this->set_ptr_1(((int32_t)((int32_t)L_9+(int32_t)1))); int32_t L_10 = V_19; NullCheck(L_7); uint16_t L_11 = String_get_Chars_m3015341861(L_7, L_10, /*hidden argument*/NULL); V_6 = L_11; uint16_t L_12 = V_6; V_20 = L_12; uint16_t L_13 = V_20; if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 0) { goto IL_00ee; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 1) { goto IL_009b; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 2) { goto IL_009b; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 3) { goto IL_009b; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 4) { goto IL_0190; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 5) { goto IL_01da; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 6) { goto IL_025f; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 7) { goto IL_025f; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 8) { goto IL_009b; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 9) { goto IL_009b; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)36))) == 10) { goto IL_0110; } } IL_009b: { uint16_t L_14 = V_20; if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)91))) == 0) { goto IL_0182; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)91))) == 1) { goto IL_0133; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)91))) == 2) { goto IL_00b5; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)91))) == 3) { goto IL_00cc; } } IL_00b5: { uint16_t L_15 = V_20; if ((((int32_t)L_15) == ((int32_t)((int32_t)63)))) { goto IL_025f; } } { uint16_t L_16 = V_20; if ((((int32_t)L_16) == ((int32_t)((int32_t)124)))) { goto IL_01e2; } } { goto IL_026b; } IL_00cc: { int32_t L_17 = ___options1; bool L_18 = Parser_IsMultiline_m1332832164(NULL /*static, unused*/, L_17, /*hidden argument*/NULL); if (!L_18) { goto IL_00dd; } } { G_B11_0 = 3; goto IL_00de; } IL_00dd: { G_B11_0 = 1; } IL_00de: { V_7 = G_B11_0; uint16_t L_19 = V_7; PositionAssertion_t3660056009 * L_20 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_20, L_19, /*hidden argument*/NULL); V_4 = L_20; goto IL_0270; } IL_00ee: { int32_t L_21 = ___options1; bool L_22 = Parser_IsMultiline_m1332832164(NULL /*static, unused*/, L_21, /*hidden argument*/NULL); if (!L_22) { goto IL_00ff; } } { G_B15_0 = 7; goto IL_0100; } IL_00ff: { G_B15_0 = 5; } IL_0100: { V_8 = G_B15_0; uint16_t L_23 = V_8; PositionAssertion_t3660056009 * L_24 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_24, L_23, /*hidden argument*/NULL); V_4 = L_24; goto IL_0270; } IL_0110: { int32_t L_25 = ___options1; bool L_26 = Parser_IsSingleline_m4108862573(NULL /*static, unused*/, L_25, /*hidden argument*/NULL); if (!L_26) { goto IL_0121; } } { G_B19_0 = 2; goto IL_0122; } IL_0121: { G_B19_0 = 1; } IL_0122: { V_9 = G_B19_0; uint16_t L_27 = V_9; CharacterClass_t630081023 * L_28 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_28, L_27, (bool)0, /*hidden argument*/NULL); V_4 = L_28; goto IL_0270; } IL_0133: { int32_t L_29 = Parser_ParseEscape_m675256065(__this, /*hidden argument*/NULL); V_10 = L_29; int32_t L_30 = V_10; if ((((int32_t)L_30) < ((int32_t)0))) { goto IL_014d; } } { int32_t L_31 = V_10; V_6 = (((int32_t)((uint16_t)L_31))); goto IL_017d; } IL_014d: { int32_t L_32 = ___options1; Expression_t1499093192 * L_33 = Parser_ParseSpecial_m1376060474(__this, L_32, /*hidden argument*/NULL); V_4 = L_33; Expression_t1499093192 * L_34 = V_4; if (L_34) { goto IL_017d; } } { String_t* L_35 = __this->get_pattern_0(); int32_t L_36 = __this->get_ptr_1(); int32_t L_37 = L_36; V_19 = L_37; __this->set_ptr_1(((int32_t)((int32_t)L_37+(int32_t)1))); int32_t L_38 = V_19; NullCheck(L_35); uint16_t L_39 = String_get_Chars_m3015341861(L_35, L_38, /*hidden argument*/NULL); V_6 = L_39; } IL_017d: { goto IL_0270; } IL_0182: { int32_t L_40 = ___options1; Expression_t1499093192 * L_41 = Parser_ParseCharacterClass_m4053595992(__this, L_40, /*hidden argument*/NULL); V_4 = L_41; goto IL_0270; } IL_0190: { int32_t L_42 = ___options1; bool L_43 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_42, /*hidden argument*/NULL); V_11 = L_43; Expression_t1499093192 * L_44 = Parser_ParseGroupingConstruct_m845745261(__this, (&___options1), /*hidden argument*/NULL); V_4 = L_44; Expression_t1499093192 * L_45 = V_4; if (L_45) { goto IL_01d5; } } { String_t* L_46 = V_2; if (!L_46) { goto IL_01d0; } } { int32_t L_47 = ___options1; bool L_48 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_47, /*hidden argument*/NULL); bool L_49 = V_11; if ((((int32_t)L_48) == ((int32_t)L_49))) { goto IL_01d0; } } { Group_t1370157167 * L_50 = V_3; String_t* L_51 = V_2; int32_t L_52 = ___options1; bool L_53 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_52, /*hidden argument*/NULL); Literal_t3148194463 * L_54 = (Literal_t3148194463 *)il2cpp_codegen_object_new(Literal_t3148194463_il2cpp_TypeInfo_var); Literal__ctor_m1496565524(L_54, L_51, L_53, /*hidden argument*/NULL); NullCheck(L_50); Group_AppendExpression_m2176615607(L_50, L_54, /*hidden argument*/NULL); V_2 = (String_t*)NULL; } IL_01d0: { goto IL_001a; } IL_01d5: { goto IL_0270; } IL_01da: { V_5 = (bool)1; goto IL_0484; } IL_01e2: { String_t* L_55 = V_2; if (!L_55) { goto IL_01fc; } } { Group_t1370157167 * L_56 = V_3; String_t* L_57 = V_2; int32_t L_58 = ___options1; bool L_59 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_58, /*hidden argument*/NULL); Literal_t3148194463 * L_60 = (Literal_t3148194463 *)il2cpp_codegen_object_new(Literal_t3148194463_il2cpp_TypeInfo_var); Literal__ctor_m1496565524(L_60, L_57, L_59, /*hidden argument*/NULL); NullCheck(L_56); Group_AppendExpression_m2176615607(L_56, L_60, /*hidden argument*/NULL); V_2 = (String_t*)NULL; } IL_01fc: { Assertion_t324477170 * L_61 = ___assertion2; if (!L_61) { goto IL_0241; } } { Assertion_t324477170 * L_62 = ___assertion2; NullCheck(L_62); Expression_t1499093192 * L_63 = Assertion_get_TrueExpression_m1503749732(L_62, /*hidden argument*/NULL); if (L_63) { goto IL_0219; } } { Assertion_t324477170 * L_64 = ___assertion2; Group_t1370157167 * L_65 = V_3; NullCheck(L_64); Assertion_set_TrueExpression_m293303211(L_64, L_65, /*hidden argument*/NULL); goto IL_023c; } IL_0219: { Assertion_t324477170 * L_66 = ___assertion2; NullCheck(L_66); Expression_t1499093192 * L_67 = Assertion_get_FalseExpression_m2557605343(L_66, /*hidden argument*/NULL); if (L_67) { goto IL_0230; } } { Assertion_t324477170 * L_68 = ___assertion2; Group_t1370157167 * L_69 = V_3; NullCheck(L_68); Assertion_set_FalseExpression_m18812748(L_68, L_69, /*hidden argument*/NULL); goto IL_023c; } IL_0230: { ArgumentException_t124305799 * L_70 = Parser_NewParseException_m3475856021(__this, _stringLiteral1000366503, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_70); } IL_023c: { goto IL_0254; } IL_0241: { Alternation_t2772154573 * L_71 = V_1; if (L_71) { goto IL_024d; } } { Alternation_t2772154573 * L_72 = (Alternation_t2772154573 *)il2cpp_codegen_object_new(Alternation_t2772154573_il2cpp_TypeInfo_var); Alternation__ctor_m1090419051(L_72, /*hidden argument*/NULL); V_1 = L_72; } IL_024d: { Alternation_t2772154573 * L_73 = V_1; Group_t1370157167 * L_74 = V_3; NullCheck(L_73); Alternation_AddAlternative_m3695967311(L_73, L_74, /*hidden argument*/NULL); } IL_0254: { Group_t1370157167 * L_75 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_75, /*hidden argument*/NULL); V_3 = L_75; goto IL_001a; } IL_025f: { ArgumentException_t124305799 * L_76 = Parser_NewParseException_m3475856021(__this, _stringLiteral3246343677, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_76); } IL_026b: { goto IL_0270; } IL_0270: { int32_t L_77 = ___options1; bool L_78 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_77, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_78, /*hidden argument*/NULL); int32_t L_79 = __this->get_ptr_1(); String_t* L_80 = __this->get_pattern_0(); NullCheck(L_80); int32_t L_81 = String_get_Length_m2979997331(L_80, /*hidden argument*/NULL); if ((((int32_t)L_79) >= ((int32_t)L_81))) { goto IL_0413; } } { String_t* L_82 = __this->get_pattern_0(); int32_t L_83 = __this->get_ptr_1(); NullCheck(L_82); uint16_t L_84 = String_get_Chars_m3015341861(L_82, L_83, /*hidden argument*/NULL); V_12 = L_84; V_13 = 0; V_14 = 0; V_15 = (bool)0; V_16 = (bool)0; uint16_t L_85 = V_12; if ((((int32_t)L_85) == ((int32_t)((int32_t)63)))) { goto IL_02cc; } } { uint16_t L_86 = V_12; if ((((int32_t)L_86) == ((int32_t)((int32_t)42)))) { goto IL_02cc; } } { uint16_t L_87 = V_12; if ((!(((uint32_t)L_87) == ((uint32_t)((int32_t)43))))) { goto IL_032f; } } IL_02cc: { int32_t L_88 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_88+(int32_t)1))); V_16 = (bool)1; uint16_t L_89 = V_12; V_20 = L_89; uint16_t L_90 = V_20; if ((((int32_t)L_90) == ((int32_t)((int32_t)42)))) { goto IL_030c; } } { uint16_t L_91 = V_20; if ((((int32_t)L_91) == ((int32_t)((int32_t)43)))) { goto IL_031b; } } { uint16_t L_92 = V_20; if ((((int32_t)L_92) == ((int32_t)((int32_t)63)))) { goto IL_0301; } } { goto IL_032a; } IL_0301: { V_13 = 0; V_14 = 1; goto IL_032a; } IL_030c: { V_13 = 0; V_14 = ((int32_t)2147483647LL); goto IL_032a; } IL_031b: { V_13 = 1; V_14 = ((int32_t)2147483647LL); goto IL_032a; } IL_032a: { goto IL_0382; } IL_032f: { uint16_t L_93 = V_12; if ((!(((uint32_t)L_93) == ((uint32_t)((int32_t)123))))) { goto IL_0382; } } { int32_t L_94 = __this->get_ptr_1(); String_t* L_95 = __this->get_pattern_0(); NullCheck(L_95); int32_t L_96 = String_get_Length_m2979997331(L_95, /*hidden argument*/NULL); if ((((int32_t)((int32_t)((int32_t)L_94+(int32_t)1))) >= ((int32_t)L_96))) { goto IL_0382; } } { int32_t L_97 = __this->get_ptr_1(); V_17 = L_97; int32_t L_98 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_98+(int32_t)1))); int32_t L_99 = ___options1; bool L_100 = Parser_ParseRepetitionBounds_m2180911384(__this, (&V_13), (&V_14), L_99, /*hidden argument*/NULL); V_16 = L_100; bool L_101 = V_16; if (L_101) { goto IL_0382; } } { int32_t L_102 = V_17; __this->set_ptr_1(L_102); } IL_0382: { bool L_103 = V_16; if (!L_103) { goto IL_0413; } } { int32_t L_104 = ___options1; bool L_105 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_104, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_105, /*hidden argument*/NULL); int32_t L_106 = __this->get_ptr_1(); String_t* L_107 = __this->get_pattern_0(); NullCheck(L_107); int32_t L_108 = String_get_Length_m2979997331(L_107, /*hidden argument*/NULL); if ((((int32_t)L_106) >= ((int32_t)L_108))) { goto IL_03d4; } } { String_t* L_109 = __this->get_pattern_0(); int32_t L_110 = __this->get_ptr_1(); NullCheck(L_109); uint16_t L_111 = String_get_Chars_m3015341861(L_109, L_110, /*hidden argument*/NULL); if ((!(((uint32_t)L_111) == ((uint32_t)((int32_t)63))))) { goto IL_03d4; } } { int32_t L_112 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_112+(int32_t)1))); V_15 = (bool)1; } IL_03d4: { int32_t L_113 = V_13; int32_t L_114 = V_14; bool L_115 = V_15; Repetition_t693899937 * L_116 = (Repetition_t693899937 *)il2cpp_codegen_object_new(Repetition_t693899937_il2cpp_TypeInfo_var); Repetition__ctor_m4270514692(L_116, L_113, L_114, L_115, /*hidden argument*/NULL); V_18 = L_116; Expression_t1499093192 * L_117 = V_4; if (L_117) { goto IL_0406; } } { Repetition_t693899937 * L_118 = V_18; String_t* L_119 = Char_ToString_m2089191214((&V_6), /*hidden argument*/NULL); int32_t L_120 = ___options1; bool L_121 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_120, /*hidden argument*/NULL); Literal_t3148194463 * L_122 = (Literal_t3148194463 *)il2cpp_codegen_object_new(Literal_t3148194463_il2cpp_TypeInfo_var); Literal__ctor_m1496565524(L_122, L_119, L_121, /*hidden argument*/NULL); NullCheck(L_118); Repetition_set_Expression_m3471937174(L_118, L_122, /*hidden argument*/NULL); goto IL_040f; } IL_0406: { Repetition_t693899937 * L_123 = V_18; Expression_t1499093192 * L_124 = V_4; NullCheck(L_123); Repetition_set_Expression_m3471937174(L_123, L_124, /*hidden argument*/NULL); } IL_040f: { Repetition_t693899937 * L_125 = V_18; V_4 = L_125; } IL_0413: { Expression_t1499093192 * L_126 = V_4; if (L_126) { goto IL_0439; } } { String_t* L_127 = V_2; if (L_127) { goto IL_0426; } } { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_128 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); V_2 = L_128; } IL_0426: { String_t* L_129 = V_2; uint16_t L_130 = V_6; uint16_t L_131 = L_130; Il2CppObject * L_132 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_131); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_133 = String_Concat_m389863537(NULL /*static, unused*/, L_129, L_132, /*hidden argument*/NULL); V_2 = L_133; goto IL_045e; } IL_0439: { String_t* L_134 = V_2; if (!L_134) { goto IL_0453; } } { Group_t1370157167 * L_135 = V_3; String_t* L_136 = V_2; int32_t L_137 = ___options1; bool L_138 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_137, /*hidden argument*/NULL); Literal_t3148194463 * L_139 = (Literal_t3148194463 *)il2cpp_codegen_object_new(Literal_t3148194463_il2cpp_TypeInfo_var); Literal__ctor_m1496565524(L_139, L_136, L_138, /*hidden argument*/NULL); NullCheck(L_135); Group_AppendExpression_m2176615607(L_135, L_139, /*hidden argument*/NULL); V_2 = (String_t*)NULL; } IL_0453: { Group_t1370157167 * L_140 = V_3; Expression_t1499093192 * L_141 = V_4; NullCheck(L_140); Group_AppendExpression_m2176615607(L_140, L_141, /*hidden argument*/NULL); V_4 = (Expression_t1499093192 *)NULL; } IL_045e: { bool L_142 = V_0; if (!L_142) { goto IL_047f; } } { int32_t L_143 = __this->get_ptr_1(); String_t* L_144 = __this->get_pattern_0(); NullCheck(L_144); int32_t L_145 = String_get_Length_m2979997331(L_144, /*hidden argument*/NULL); if ((((int32_t)L_143) < ((int32_t)L_145))) { goto IL_047f; } } { goto IL_0484; } IL_047f: { goto IL_001a; } IL_0484: { bool L_146 = V_0; if (!L_146) { goto IL_049d; } } { bool L_147 = V_5; if (!L_147) { goto IL_049d; } } { ArgumentException_t124305799 * L_148 = Parser_NewParseException_m3475856021(__this, _stringLiteral3121597678, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_148); } IL_049d: { bool L_149 = V_0; if (L_149) { goto IL_04b6; } } { bool L_150 = V_5; if (L_150) { goto IL_04b6; } } { ArgumentException_t124305799 * L_151 = Parser_NewParseException_m3475856021(__this, _stringLiteral3471260284, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_151); } IL_04b6: { String_t* L_152 = V_2; if (!L_152) { goto IL_04ce; } } { Group_t1370157167 * L_153 = V_3; String_t* L_154 = V_2; int32_t L_155 = ___options1; bool L_156 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_155, /*hidden argument*/NULL); Literal_t3148194463 * L_157 = (Literal_t3148194463 *)il2cpp_codegen_object_new(Literal_t3148194463_il2cpp_TypeInfo_var); Literal__ctor_m1496565524(L_157, L_154, L_156, /*hidden argument*/NULL); NullCheck(L_153); Group_AppendExpression_m2176615607(L_153, L_157, /*hidden argument*/NULL); } IL_04ce: { Assertion_t324477170 * L_158 = ___assertion2; if (!L_158) { goto IL_04fe; } } { Assertion_t324477170 * L_159 = ___assertion2; NullCheck(L_159); Expression_t1499093192 * L_160 = Assertion_get_TrueExpression_m1503749732(L_159, /*hidden argument*/NULL); if (L_160) { goto IL_04eb; } } { Assertion_t324477170 * L_161 = ___assertion2; Group_t1370157167 * L_162 = V_3; NullCheck(L_161); Assertion_set_TrueExpression_m293303211(L_161, L_162, /*hidden argument*/NULL); goto IL_04f2; } IL_04eb: { Assertion_t324477170 * L_163 = ___assertion2; Group_t1370157167 * L_164 = V_3; NullCheck(L_163); Assertion_set_FalseExpression_m18812748(L_163, L_164, /*hidden argument*/NULL); } IL_04f2: { Group_t1370157167 * L_165 = ___group0; Assertion_t324477170 * L_166 = ___assertion2; NullCheck(L_165); Group_AppendExpression_m2176615607(L_165, L_166, /*hidden argument*/NULL); goto IL_051e; } IL_04fe: { Alternation_t2772154573 * L_167 = V_1; if (!L_167) { goto IL_0517; } } { Alternation_t2772154573 * L_168 = V_1; Group_t1370157167 * L_169 = V_3; NullCheck(L_168); Alternation_AddAlternative_m3695967311(L_168, L_169, /*hidden argument*/NULL); Group_t1370157167 * L_170 = ___group0; Alternation_t2772154573 * L_171 = V_1; NullCheck(L_170); Group_AppendExpression_m2176615607(L_170, L_171, /*hidden argument*/NULL); goto IL_051e; } IL_0517: { Group_t1370157167 * L_172 = ___group0; Group_t1370157167 * L_173 = V_3; NullCheck(L_172); Group_AppendExpression_m2176615607(L_172, L_173, /*hidden argument*/NULL); } IL_051e: { return; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.Parser::ParseGroupingConstruct(System.Text.RegularExpressions.RegexOptions&) extern Il2CppClass* Group_t1370157167_il2cpp_TypeInfo_var; extern Il2CppClass* CapturingGroup_t1439411180_il2cpp_TypeInfo_var; extern Il2CppClass* NonBacktrackingGroup_t1448538980_il2cpp_TypeInfo_var; extern Il2CppClass* ExpressionAssertion_t563003706_il2cpp_TypeInfo_var; extern Il2CppClass* BalancingGroup_t3928584086_il2cpp_TypeInfo_var; extern Il2CppClass* Literal_t3148194463_il2cpp_TypeInfo_var; extern Il2CppClass* CaptureAssertion_t1074818188_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2402382179; extern Il2CppCodeGenString* _stringLiteral3067922023; extern Il2CppCodeGenString* _stringLiteral3265709856; extern Il2CppCodeGenString* _stringLiteral4145232579; extern Il2CppCodeGenString* _stringLiteral3365577804; extern Il2CppCodeGenString* _stringLiteral1833471417; extern const uint32_t Parser_ParseGroupingConstruct_m845745261_MetadataUsageId; extern "C" Expression_t1499093192 * Parser_ParseGroupingConstruct_m845745261 (Parser_t3684504143 * __this, int32_t* ___options0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseGroupingConstruct_m845745261_MetadataUsageId); s_Il2CppMethodIntialized = true; } Group_t1370157167 * V_0 = NULL; Group_t1370157167 * V_1 = NULL; Group_t1370157167 * V_2 = NULL; int32_t V_3 = 0; Group_t1370157167 * V_4 = NULL; ExpressionAssertion_t563003706 * V_5 = NULL; Group_t1370157167 * V_6 = NULL; uint16_t V_7 = 0x0; String_t* V_8 = NULL; CapturingGroup_t1439411180 * V_9 = NULL; String_t* V_10 = NULL; BalancingGroup_t3928584086 * V_11 = NULL; Assertion_t324477170 * V_12 = NULL; int32_t V_13 = 0; String_t* V_14 = NULL; ExpressionAssertion_t563003706 * V_15 = NULL; Group_t1370157167 * V_16 = NULL; Group_t1370157167 * V_17 = NULL; uint16_t V_18 = 0x0; int32_t V_19 = 0; { String_t* L_0 = __this->get_pattern_0(); int32_t L_1 = __this->get_ptr_1(); NullCheck(L_0); uint16_t L_2 = String_get_Chars_m3015341861(L_0, L_1, /*hidden argument*/NULL); if ((((int32_t)L_2) == ((int32_t)((int32_t)63)))) { goto IL_004e; } } { int32_t* L_3 = ___options0; bool L_4 = Parser_IsExplicitCapture_m2152082175(NULL /*static, unused*/, (*((int32_t*)L_3)), /*hidden argument*/NULL); if (!L_4) { goto IL_002f; } } { Group_t1370157167 * L_5 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_5, /*hidden argument*/NULL); V_0 = L_5; goto IL_0042; } IL_002f: { CapturingGroup_t1439411180 * L_6 = (CapturingGroup_t1439411180 *)il2cpp_codegen_object_new(CapturingGroup_t1439411180_il2cpp_TypeInfo_var); CapturingGroup__ctor_m616302850(L_6, /*hidden argument*/NULL); V_0 = L_6; ArrayList_t2121638921 * L_7 = __this->get_caps_2(); Group_t1370157167 * L_8 = V_0; NullCheck(L_7); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_7, L_8); } IL_0042: { Group_t1370157167 * L_9 = V_0; int32_t* L_10 = ___options0; Parser_ParseGroup_m2536720048(__this, L_9, (*((int32_t*)L_10)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); Group_t1370157167 * L_11 = V_0; return L_11; } IL_004e: { int32_t L_12 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_12+(int32_t)1))); String_t* L_13 = __this->get_pattern_0(); int32_t L_14 = __this->get_ptr_1(); NullCheck(L_13); uint16_t L_15 = String_get_Chars_m3015341861(L_13, L_14, /*hidden argument*/NULL); V_18 = L_15; uint16_t L_16 = V_18; if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 0) { goto IL_01e5; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 1) { goto IL_0099; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 2) { goto IL_0482; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 3) { goto IL_0099; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 4) { goto IL_0099; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 5) { goto IL_0099; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 6) { goto IL_021c; } if (((int32_t)((int32_t)L_16-(int32_t)((int32_t)33))) == 7) { goto IL_0376; } } IL_0099: { uint16_t L_17 = V_18; if (((int32_t)((int32_t)L_17-(int32_t)((int32_t)105))) == 0) { goto IL_0139; } if (((int32_t)((int32_t)L_17-(int32_t)((int32_t)105))) == 1) { goto IL_00bb; } if (((int32_t)((int32_t)L_17-(int32_t)((int32_t)105))) == 2) { goto IL_00bb; } if (((int32_t)((int32_t)L_17-(int32_t)((int32_t)105))) == 3) { goto IL_00bb; } if (((int32_t)((int32_t)L_17-(int32_t)((int32_t)105))) == 4) { goto IL_0139; } if (((int32_t)((int32_t)L_17-(int32_t)((int32_t)105))) == 5) { goto IL_0139; } } IL_00bb: { uint16_t L_18 = V_18; if (((int32_t)((int32_t)L_18-(int32_t)((int32_t)58))) == 0) { goto IL_00f9; } if (((int32_t)((int32_t)L_18-(int32_t)((int32_t)58))) == 1) { goto IL_00d9; } if (((int32_t)((int32_t)L_18-(int32_t)((int32_t)58))) == 2) { goto IL_01e5; } if (((int32_t)((int32_t)L_18-(int32_t)((int32_t)58))) == 3) { goto IL_01e5; } if (((int32_t)((int32_t)L_18-(int32_t)((int32_t)58))) == 4) { goto IL_0119; } } IL_00d9: { uint16_t L_19 = V_18; if ((((int32_t)L_19) == ((int32_t)((int32_t)45)))) { goto IL_0139; } } { uint16_t L_20 = V_18; if ((((int32_t)L_20) == ((int32_t)((int32_t)115)))) { goto IL_0139; } } { uint16_t L_21 = V_18; if ((((int32_t)L_21) == ((int32_t)((int32_t)120)))) { goto IL_0139; } } { goto IL_04de; } IL_00f9: { int32_t L_22 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_22+(int32_t)1))); Group_t1370157167 * L_23 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_23, /*hidden argument*/NULL); V_1 = L_23; Group_t1370157167 * L_24 = V_1; int32_t* L_25 = ___options0; Parser_ParseGroup_m2536720048(__this, L_24, (*((int32_t*)L_25)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); Group_t1370157167 * L_26 = V_1; return L_26; } IL_0119: { int32_t L_27 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_27+(int32_t)1))); NonBacktrackingGroup_t1448538980 * L_28 = (NonBacktrackingGroup_t1448538980 *)il2cpp_codegen_object_new(NonBacktrackingGroup_t1448538980_il2cpp_TypeInfo_var); NonBacktrackingGroup__ctor_m1908070474(L_28, /*hidden argument*/NULL); V_2 = L_28; Group_t1370157167 * L_29 = V_2; int32_t* L_30 = ___options0; Parser_ParseGroup_m2536720048(__this, L_29, (*((int32_t*)L_30)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); Group_t1370157167 * L_31 = V_2; return L_31; } IL_0139: { int32_t* L_32 = ___options0; V_3 = (*((int32_t*)L_32)); Parser_ParseOptions_m1196738735(__this, (&V_3), (bool)0, /*hidden argument*/NULL); String_t* L_33 = __this->get_pattern_0(); int32_t L_34 = __this->get_ptr_1(); NullCheck(L_33); uint16_t L_35 = String_get_Chars_m3015341861(L_33, L_34, /*hidden argument*/NULL); if ((!(((uint32_t)L_35) == ((uint32_t)((int32_t)45))))) { goto IL_0174; } } { int32_t L_36 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_36+(int32_t)1))); Parser_ParseOptions_m1196738735(__this, (&V_3), (bool)1, /*hidden argument*/NULL); } IL_0174: { String_t* L_37 = __this->get_pattern_0(); int32_t L_38 = __this->get_ptr_1(); NullCheck(L_37); uint16_t L_39 = String_get_Chars_m3015341861(L_37, L_38, /*hidden argument*/NULL); if ((!(((uint32_t)L_39) == ((uint32_t)((int32_t)58))))) { goto IL_01ae; } } { int32_t L_40 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_40+(int32_t)1))); Group_t1370157167 * L_41 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_41, /*hidden argument*/NULL); V_4 = L_41; Group_t1370157167 * L_42 = V_4; int32_t L_43 = V_3; Parser_ParseGroup_m2536720048(__this, L_42, L_43, (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); Group_t1370157167 * L_44 = V_4; return L_44; } IL_01ae: { String_t* L_45 = __this->get_pattern_0(); int32_t L_46 = __this->get_ptr_1(); NullCheck(L_45); uint16_t L_47 = String_get_Chars_m3015341861(L_45, L_46, /*hidden argument*/NULL); if ((!(((uint32_t)L_47) == ((uint32_t)((int32_t)41))))) { goto IL_01d9; } } { int32_t L_48 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_48+(int32_t)1))); int32_t* L_49 = ___options0; int32_t L_50 = V_3; *((int32_t*)(L_49)) = (int32_t)L_50; return (Expression_t1499093192 *)NULL; } IL_01d9: { ArgumentException_t124305799 * L_51 = Parser_NewParseException_m3475856021(__this, _stringLiteral2402382179, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_51); } IL_01e5: { ExpressionAssertion_t563003706 * L_52 = (ExpressionAssertion_t563003706 *)il2cpp_codegen_object_new(ExpressionAssertion_t563003706_il2cpp_TypeInfo_var); ExpressionAssertion__ctor_m2776942238(L_52, /*hidden argument*/NULL); V_5 = L_52; ExpressionAssertion_t563003706 * L_53 = V_5; bool L_54 = Parser_ParseAssertionType_m3709247266(__this, L_53, /*hidden argument*/NULL); if (L_54) { goto IL_01fe; } } { goto IL_021c; } IL_01fe: { Group_t1370157167 * L_55 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_55, /*hidden argument*/NULL); V_6 = L_55; Group_t1370157167 * L_56 = V_6; int32_t* L_57 = ___options0; Parser_ParseGroup_m2536720048(__this, L_56, (*((int32_t*)L_57)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_58 = V_5; Group_t1370157167 * L_59 = V_6; NullCheck(L_58); ExpressionAssertion_set_TestExpression_m828897591(L_58, L_59, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_60 = V_5; return L_60; } IL_021c: { String_t* L_61 = __this->get_pattern_0(); int32_t L_62 = __this->get_ptr_1(); NullCheck(L_61); uint16_t L_63 = String_get_Chars_m3015341861(L_61, L_62, /*hidden argument*/NULL); if ((!(((uint32_t)L_63) == ((uint32_t)((int32_t)60))))) { goto IL_023d; } } { V_7 = ((int32_t)62); goto IL_0241; } IL_023d: { V_7 = ((int32_t)39); } IL_0241: { int32_t L_64 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_64+(int32_t)1))); String_t* L_65 = Parser_ParseName_m417255288(__this, /*hidden argument*/NULL); V_8 = L_65; String_t* L_66 = __this->get_pattern_0(); int32_t L_67 = __this->get_ptr_1(); NullCheck(L_66); uint16_t L_68 = String_get_Chars_m3015341861(L_66, L_67, /*hidden argument*/NULL); uint16_t L_69 = V_7; if ((!(((uint32_t)L_68) == ((uint32_t)L_69)))) { goto IL_02bc; } } { String_t* L_70 = V_8; if (L_70) { goto IL_0282; } } { ArgumentException_t124305799 * L_71 = Parser_NewParseException_m3475856021(__this, _stringLiteral3067922023, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_71); } IL_0282: { int32_t L_72 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_72+(int32_t)1))); CapturingGroup_t1439411180 * L_73 = (CapturingGroup_t1439411180 *)il2cpp_codegen_object_new(CapturingGroup_t1439411180_il2cpp_TypeInfo_var); CapturingGroup__ctor_m616302850(L_73, /*hidden argument*/NULL); V_9 = L_73; CapturingGroup_t1439411180 * L_74 = V_9; String_t* L_75 = V_8; NullCheck(L_74); CapturingGroup_set_Name_m2861220216(L_74, L_75, /*hidden argument*/NULL); ArrayList_t2121638921 * L_76 = __this->get_caps_2(); CapturingGroup_t1439411180 * L_77 = V_9; NullCheck(L_76); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_76, L_77); CapturingGroup_t1439411180 * L_78 = V_9; int32_t* L_79 = ___options0; Parser_ParseGroup_m2536720048(__this, L_78, (*((int32_t*)L_79)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); CapturingGroup_t1439411180 * L_80 = V_9; return L_80; } IL_02bc: { String_t* L_81 = __this->get_pattern_0(); int32_t L_82 = __this->get_ptr_1(); NullCheck(L_81); uint16_t L_83 = String_get_Chars_m3015341861(L_81, L_82, /*hidden argument*/NULL); if ((!(((uint32_t)L_83) == ((uint32_t)((int32_t)45))))) { goto IL_036a; } } { int32_t L_84 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_84+(int32_t)1))); String_t* L_85 = Parser_ParseName_m417255288(__this, /*hidden argument*/NULL); V_10 = L_85; String_t* L_86 = V_10; if (!L_86) { goto IL_0309; } } { String_t* L_87 = __this->get_pattern_0(); int32_t L_88 = __this->get_ptr_1(); NullCheck(L_87); uint16_t L_89 = String_get_Chars_m3015341861(L_87, L_88, /*hidden argument*/NULL); uint16_t L_90 = V_7; if ((((int32_t)L_89) == ((int32_t)L_90))) { goto IL_0315; } } IL_0309: { ArgumentException_t124305799 * L_91 = Parser_NewParseException_m3475856021(__this, _stringLiteral3265709856, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_91); } IL_0315: { int32_t L_92 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_92+(int32_t)1))); BalancingGroup_t3928584086 * L_93 = (BalancingGroup_t3928584086 *)il2cpp_codegen_object_new(BalancingGroup_t3928584086_il2cpp_TypeInfo_var); BalancingGroup__ctor_m1391379608(L_93, /*hidden argument*/NULL); V_11 = L_93; BalancingGroup_t3928584086 * L_94 = V_11; String_t* L_95 = V_8; NullCheck(L_94); CapturingGroup_set_Name_m2861220216(L_94, L_95, /*hidden argument*/NULL); BalancingGroup_t3928584086 * L_96 = V_11; NullCheck(L_96); bool L_97 = CapturingGroup_get_IsNamed_m2190134608(L_96, /*hidden argument*/NULL); if (!L_97) { goto IL_034d; } } { ArrayList_t2121638921 * L_98 = __this->get_caps_2(); BalancingGroup_t3928584086 * L_99 = V_11; NullCheck(L_98); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_98, L_99); } IL_034d: { Hashtable_t3875263730 * L_100 = __this->get_refs_3(); BalancingGroup_t3928584086 * L_101 = V_11; String_t* L_102 = V_10; NullCheck(L_100); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_100, L_101, L_102); BalancingGroup_t3928584086 * L_103 = V_11; int32_t* L_104 = ___options0; Parser_ParseGroup_m2536720048(__this, L_103, (*((int32_t*)L_104)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); BalancingGroup_t3928584086 * L_105 = V_11; return L_105; } IL_036a: { ArgumentException_t124305799 * L_106 = Parser_NewParseException_m3475856021(__this, _stringLiteral3067922023, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_106); } IL_0376: { int32_t L_107 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_107+(int32_t)1))); int32_t L_108 = __this->get_ptr_1(); V_13 = L_108; String_t* L_109 = Parser_ParseName_m417255288(__this, /*hidden argument*/NULL); V_14 = L_109; String_t* L_110 = V_14; if (!L_110) { goto IL_03b3; } } { String_t* L_111 = __this->get_pattern_0(); int32_t L_112 = __this->get_ptr_1(); NullCheck(L_111); uint16_t L_113 = String_get_Chars_m3015341861(L_111, L_112, /*hidden argument*/NULL); if ((((int32_t)L_113) == ((int32_t)((int32_t)41)))) { goto IL_043a; } } IL_03b3: { int32_t L_114 = V_13; __this->set_ptr_1(L_114); ExpressionAssertion_t563003706 * L_115 = (ExpressionAssertion_t563003706 *)il2cpp_codegen_object_new(ExpressionAssertion_t563003706_il2cpp_TypeInfo_var); ExpressionAssertion__ctor_m2776942238(L_115, /*hidden argument*/NULL); V_15 = L_115; String_t* L_116 = __this->get_pattern_0(); int32_t L_117 = __this->get_ptr_1(); NullCheck(L_116); uint16_t L_118 = String_get_Chars_m3015341861(L_116, L_117, /*hidden argument*/NULL); if ((!(((uint32_t)L_118) == ((uint32_t)((int32_t)63))))) { goto IL_0406; } } { int32_t L_119 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_119+(int32_t)1))); ExpressionAssertion_t563003706 * L_120 = V_15; bool L_121 = Parser_ParseAssertionType_m3709247266(__this, L_120, /*hidden argument*/NULL); if (L_121) { goto IL_0401; } } { ArgumentException_t124305799 * L_122 = Parser_NewParseException_m3475856021(__this, _stringLiteral4145232579, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_122); } IL_0401: { goto IL_0416; } IL_0406: { ExpressionAssertion_t563003706 * L_123 = V_15; NullCheck(L_123); ExpressionAssertion_set_Negate_m1902108060(L_123, (bool)0, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_124 = V_15; NullCheck(L_124); ExpressionAssertion_set_Reverse_m3599260152(L_124, (bool)0, /*hidden argument*/NULL); } IL_0416: { Group_t1370157167 * L_125 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_125, /*hidden argument*/NULL); V_16 = L_125; Group_t1370157167 * L_126 = V_16; int32_t* L_127 = ___options0; Parser_ParseGroup_m2536720048(__this, L_126, (*((int32_t*)L_127)), (Assertion_t324477170 *)NULL, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_128 = V_15; Group_t1370157167 * L_129 = V_16; NullCheck(L_128); ExpressionAssertion_set_TestExpression_m828897591(L_128, L_129, /*hidden argument*/NULL); ExpressionAssertion_t563003706 * L_130 = V_15; V_12 = L_130; goto IL_046c; } IL_043a: { int32_t L_131 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_131+(int32_t)1))); String_t* L_132 = V_14; int32_t* L_133 = ___options0; bool L_134 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, (*((int32_t*)L_133)), /*hidden argument*/NULL); Literal_t3148194463 * L_135 = (Literal_t3148194463 *)il2cpp_codegen_object_new(Literal_t3148194463_il2cpp_TypeInfo_var); Literal__ctor_m1496565524(L_135, L_132, L_134, /*hidden argument*/NULL); CaptureAssertion_t1074818188 * L_136 = (CaptureAssertion_t1074818188 *)il2cpp_codegen_object_new(CaptureAssertion_t1074818188_il2cpp_TypeInfo_var); CaptureAssertion__ctor_m4132785567(L_136, L_135, /*hidden argument*/NULL); V_12 = L_136; Hashtable_t3875263730 * L_137 = __this->get_refs_3(); Assertion_t324477170 * L_138 = V_12; String_t* L_139 = V_14; NullCheck(L_137); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_137, L_138, L_139); } IL_046c: { Group_t1370157167 * L_140 = (Group_t1370157167 *)il2cpp_codegen_object_new(Group_t1370157167_il2cpp_TypeInfo_var); Group__ctor_m358391753(L_140, /*hidden argument*/NULL); V_17 = L_140; Group_t1370157167 * L_141 = V_17; int32_t* L_142 = ___options0; Assertion_t324477170 * L_143 = V_12; Parser_ParseGroup_m2536720048(__this, L_141, (*((int32_t*)L_142)), L_143, /*hidden argument*/NULL); Group_t1370157167 * L_144 = V_17; return L_144; } IL_0482: { int32_t L_145 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_145+(int32_t)1))); goto IL_04b7; } IL_0495: { int32_t L_146 = __this->get_ptr_1(); String_t* L_147 = __this->get_pattern_0(); NullCheck(L_147); int32_t L_148 = String_get_Length_m2979997331(L_147, /*hidden argument*/NULL); if ((((int32_t)L_146) < ((int32_t)L_148))) { goto IL_04b7; } } { ArgumentException_t124305799 * L_149 = Parser_NewParseException_m3475856021(__this, _stringLiteral3365577804, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_149); } IL_04b7: { String_t* L_150 = __this->get_pattern_0(); int32_t L_151 = __this->get_ptr_1(); int32_t L_152 = L_151; V_19 = L_152; __this->set_ptr_1(((int32_t)((int32_t)L_152+(int32_t)1))); int32_t L_153 = V_19; NullCheck(L_150); uint16_t L_154 = String_get_Chars_m3015341861(L_150, L_153, /*hidden argument*/NULL); if ((!(((uint32_t)L_154) == ((uint32_t)((int32_t)41))))) { goto IL_0495; } } { return (Expression_t1499093192 *)NULL; } IL_04de: { ArgumentException_t124305799 * L_155 = Parser_NewParseException_m3475856021(__this, _stringLiteral1833471417, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_155); } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::ParseAssertionType(System.Text.RegularExpressions.Syntax.ExpressionAssertion) extern "C" bool Parser_ParseAssertionType_m3709247266 (Parser_t3684504143 * __this, ExpressionAssertion_t563003706 * ___assertion0, const MethodInfo* method) { uint16_t V_0 = 0x0; { String_t* L_0 = __this->get_pattern_0(); int32_t L_1 = __this->get_ptr_1(); NullCheck(L_0); uint16_t L_2 = String_get_Chars_m3015341861(L_0, L_1, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)((int32_t)60))))) { goto IL_0075; } } { String_t* L_3 = __this->get_pattern_0(); int32_t L_4 = __this->get_ptr_1(); NullCheck(L_3); uint16_t L_5 = String_get_Chars_m3015341861(L_3, ((int32_t)((int32_t)L_4+(int32_t)1)), /*hidden argument*/NULL); V_0 = L_5; uint16_t L_6 = V_0; if ((((int32_t)L_6) == ((int32_t)((int32_t)33)))) { goto IL_004d; } } { uint16_t L_7 = V_0; if ((((int32_t)L_7) == ((int32_t)((int32_t)61)))) { goto IL_0041; } } { goto IL_0059; } IL_0041: { ExpressionAssertion_t563003706 * L_8 = ___assertion0; NullCheck(L_8); ExpressionAssertion_set_Negate_m1902108060(L_8, (bool)0, /*hidden argument*/NULL); goto IL_005b; } IL_004d: { ExpressionAssertion_t563003706 * L_9 = ___assertion0; NullCheck(L_9); ExpressionAssertion_set_Negate_m1902108060(L_9, (bool)1, /*hidden argument*/NULL); goto IL_005b; } IL_0059: { return (bool)0; } IL_005b: { ExpressionAssertion_t563003706 * L_10 = ___assertion0; NullCheck(L_10); ExpressionAssertion_set_Reverse_m3599260152(L_10, (bool)1, /*hidden argument*/NULL); int32_t L_11 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_11+(int32_t)2))); goto IL_00cb; } IL_0075: { String_t* L_12 = __this->get_pattern_0(); int32_t L_13 = __this->get_ptr_1(); NullCheck(L_12); uint16_t L_14 = String_get_Chars_m3015341861(L_12, L_13, /*hidden argument*/NULL); V_0 = L_14; uint16_t L_15 = V_0; if ((((int32_t)L_15) == ((int32_t)((int32_t)33)))) { goto IL_00a8; } } { uint16_t L_16 = V_0; if ((((int32_t)L_16) == ((int32_t)((int32_t)61)))) { goto IL_009c; } } { goto IL_00b4; } IL_009c: { ExpressionAssertion_t563003706 * L_17 = ___assertion0; NullCheck(L_17); ExpressionAssertion_set_Negate_m1902108060(L_17, (bool)0, /*hidden argument*/NULL); goto IL_00b6; } IL_00a8: { ExpressionAssertion_t563003706 * L_18 = ___assertion0; NullCheck(L_18); ExpressionAssertion_set_Negate_m1902108060(L_18, (bool)1, /*hidden argument*/NULL); goto IL_00b6; } IL_00b4: { return (bool)0; } IL_00b6: { ExpressionAssertion_t563003706 * L_19 = ___assertion0; NullCheck(L_19); ExpressionAssertion_set_Reverse_m3599260152(L_19, (bool)0, /*hidden argument*/NULL); int32_t L_20 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_20+(int32_t)1))); } IL_00cb: { return (bool)1; } } // System.Void System.Text.RegularExpressions.Syntax.Parser::ParseOptions(System.Text.RegularExpressions.RegexOptions&,System.Boolean) extern "C" void Parser_ParseOptions_m1196738735 (Parser_t3684504143 * __this, int32_t* ___options0, bool ___negate1, const MethodInfo* method) { uint16_t V_0 = 0x0; { goto IL_00ef; } IL_0005: { String_t* L_0 = __this->get_pattern_0(); int32_t L_1 = __this->get_ptr_1(); NullCheck(L_0); uint16_t L_2 = String_get_Chars_m3015341861(L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; uint16_t L_3 = V_0; if (((int32_t)((int32_t)L_3-(int32_t)((int32_t)105))) == 0) { goto IL_004d; } if (((int32_t)((int32_t)L_3-(int32_t)((int32_t)105))) == 1) { goto IL_0038; } if (((int32_t)((int32_t)L_3-(int32_t)((int32_t)105))) == 2) { goto IL_0038; } if (((int32_t)((int32_t)L_3-(int32_t)((int32_t)105))) == 3) { goto IL_0038; } if (((int32_t)((int32_t)L_3-(int32_t)((int32_t)105))) == 4) { goto IL_006a; } if (((int32_t)((int32_t)L_3-(int32_t)((int32_t)105))) == 5) { goto IL_0087; } } IL_0038: { uint16_t L_4 = V_0; if ((((int32_t)L_4) == ((int32_t)((int32_t)115)))) { goto IL_00a4; } } { uint16_t L_5 = V_0; if ((((int32_t)L_5) == ((int32_t)((int32_t)120)))) { goto IL_00c2; } } { goto IL_00e0; } IL_004d: { bool L_6 = ___negate1; if (!L_6) { goto IL_005f; } } { int32_t* L_7 = ___options0; int32_t* L_8 = ___options0; *((int32_t*)(L_7)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_8))&(int32_t)((int32_t)-2))); goto IL_0065; } IL_005f: { int32_t* L_9 = ___options0; int32_t* L_10 = ___options0; *((int32_t*)(L_9)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_10))|(int32_t)1)); } IL_0065: { goto IL_00e1; } IL_006a: { bool L_11 = ___negate1; if (!L_11) { goto IL_007c; } } { int32_t* L_12 = ___options0; int32_t* L_13 = ___options0; *((int32_t*)(L_12)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_13))&(int32_t)((int32_t)-3))); goto IL_0082; } IL_007c: { int32_t* L_14 = ___options0; int32_t* L_15 = ___options0; *((int32_t*)(L_14)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_15))|(int32_t)2)); } IL_0082: { goto IL_00e1; } IL_0087: { bool L_16 = ___negate1; if (!L_16) { goto IL_0099; } } { int32_t* L_17 = ___options0; int32_t* L_18 = ___options0; *((int32_t*)(L_17)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_18))&(int32_t)((int32_t)-5))); goto IL_009f; } IL_0099: { int32_t* L_19 = ___options0; int32_t* L_20 = ___options0; *((int32_t*)(L_19)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_20))|(int32_t)4)); } IL_009f: { goto IL_00e1; } IL_00a4: { bool L_21 = ___negate1; if (!L_21) { goto IL_00b6; } } { int32_t* L_22 = ___options0; int32_t* L_23 = ___options0; *((int32_t*)(L_22)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_23))&(int32_t)((int32_t)-17))); goto IL_00bd; } IL_00b6: { int32_t* L_24 = ___options0; int32_t* L_25 = ___options0; *((int32_t*)(L_24)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_25))|(int32_t)((int32_t)16))); } IL_00bd: { goto IL_00e1; } IL_00c2: { bool L_26 = ___negate1; if (!L_26) { goto IL_00d4; } } { int32_t* L_27 = ___options0; int32_t* L_28 = ___options0; *((int32_t*)(L_27)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_28))&(int32_t)((int32_t)-33))); goto IL_00db; } IL_00d4: { int32_t* L_29 = ___options0; int32_t* L_30 = ___options0; *((int32_t*)(L_29)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_30))|(int32_t)((int32_t)32))); } IL_00db: { goto IL_00e1; } IL_00e0: { return; } IL_00e1: { int32_t L_31 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_31+(int32_t)1))); } IL_00ef: { goto IL_0005; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.Parser::ParseCharacterClass(System.Text.RegularExpressions.RegexOptions) extern Il2CppClass* CharacterClass_t630081023_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* ObjectU5BU5D_t11523773_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral8084015; extern Il2CppCodeGenString* _stringLiteral91; extern Il2CppCodeGenString* _stringLiteral45; extern Il2CppCodeGenString* _stringLiteral3507740435; extern Il2CppCodeGenString* _stringLiteral453281670; extern const uint32_t Parser_ParseCharacterClass_m4053595992_MetadataUsageId; extern "C" Expression_t1499093192 * Parser_ParseCharacterClass_m4053595992 (Parser_t3684504143 * __this, int32_t ___options0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseCharacterClass_m4053595992_MetadataUsageId); s_Il2CppMethodIntialized = true; } bool V_0 = false; bool V_1 = false; CharacterClass_t630081023 * V_2 = NULL; int32_t V_3 = 0; int32_t V_4 = 0; bool V_5 = false; bool V_6 = false; int32_t V_7 = 0; CharacterClass_t630081023 * G_B24_0 = NULL; CharacterClass_t630081023 * G_B23_0 = NULL; int32_t G_B25_0 = 0; CharacterClass_t630081023 * G_B25_1 = NULL; CharacterClass_t630081023 * G_B28_0 = NULL; CharacterClass_t630081023 * G_B27_0 = NULL; int32_t G_B29_0 = 0; CharacterClass_t630081023 * G_B29_1 = NULL; CharacterClass_t630081023 * G_B32_0 = NULL; CharacterClass_t630081023 * G_B31_0 = NULL; int32_t G_B33_0 = 0; CharacterClass_t630081023 * G_B33_1 = NULL; { V_0 = (bool)0; String_t* L_0 = __this->get_pattern_0(); int32_t L_1 = __this->get_ptr_1(); NullCheck(L_0); uint16_t L_2 = String_get_Chars_m3015341861(L_0, L_1, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)((int32_t)94))))) { goto IL_002a; } } { V_0 = (bool)1; int32_t L_3 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_3+(int32_t)1))); } IL_002a: { int32_t L_4 = ___options0; bool L_5 = Parser_IsECMAScript_m432342092(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); V_1 = L_5; bool L_6 = V_0; int32_t L_7 = ___options0; bool L_8 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); CharacterClass_t630081023 * L_9 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m318669623(L_9, L_6, L_8, /*hidden argument*/NULL); V_2 = L_9; String_t* L_10 = __this->get_pattern_0(); int32_t L_11 = __this->get_ptr_1(); NullCheck(L_10); uint16_t L_12 = String_get_Chars_m3015341861(L_10, L_11, /*hidden argument*/NULL); if ((!(((uint32_t)L_12) == ((uint32_t)((int32_t)93))))) { goto IL_006c; } } { CharacterClass_t630081023 * L_13 = V_2; NullCheck(L_13); CharacterClass_AddCharacter_m509912608(L_13, ((int32_t)93), /*hidden argument*/NULL); int32_t L_14 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_14+(int32_t)1))); } IL_006c: { V_3 = (-1); V_4 = (-1); V_5 = (bool)0; V_6 = (bool)0; goto IL_027f; } IL_007c: { String_t* L_15 = __this->get_pattern_0(); int32_t L_16 = __this->get_ptr_1(); int32_t L_17 = L_16; V_7 = L_17; __this->set_ptr_1(((int32_t)((int32_t)L_17+(int32_t)1))); int32_t L_18 = V_7; NullCheck(L_15); uint16_t L_19 = String_get_Chars_m3015341861(L_15, L_18, /*hidden argument*/NULL); V_3 = L_19; int32_t L_20 = V_3; if ((!(((uint32_t)L_20) == ((uint32_t)((int32_t)93))))) { goto IL_00ab; } } { V_6 = (bool)1; goto IL_0295; } IL_00ab: { int32_t L_21 = V_3; if ((!(((uint32_t)L_21) == ((uint32_t)((int32_t)45))))) { goto IL_00ca; } } { int32_t L_22 = V_4; if ((((int32_t)L_22) < ((int32_t)0))) { goto IL_00ca; } } { bool L_23 = V_5; if (L_23) { goto IL_00ca; } } { V_5 = (bool)1; goto IL_027f; } IL_00ca: { int32_t L_24 = V_3; if ((!(((uint32_t)L_24) == ((uint32_t)((int32_t)92))))) { goto IL_0212; } } { int32_t L_25 = Parser_ParseEscape_m675256065(__this, /*hidden argument*/NULL); V_3 = L_25; int32_t L_26 = V_3; if ((((int32_t)L_26) < ((int32_t)0))) { goto IL_00e5; } } { goto IL_0212; } IL_00e5: { String_t* L_27 = __this->get_pattern_0(); int32_t L_28 = __this->get_ptr_1(); int32_t L_29 = L_28; V_7 = L_29; __this->set_ptr_1(((int32_t)((int32_t)L_29+(int32_t)1))); int32_t L_30 = V_7; NullCheck(L_27); uint16_t L_31 = String_get_Chars_m3015341861(L_27, L_30, /*hidden argument*/NULL); V_3 = L_31; int32_t L_32 = V_3; V_7 = L_32; int32_t L_33 = V_7; if (((int32_t)((int32_t)L_33-(int32_t)((int32_t)80))) == 0) { goto IL_01d1; } if (((int32_t)((int32_t)L_33-(int32_t)((int32_t)80))) == 1) { goto IL_0121; } if (((int32_t)((int32_t)L_33-(int32_t)((int32_t)80))) == 2) { goto IL_0121; } if (((int32_t)((int32_t)L_33-(int32_t)((int32_t)80))) == 3) { goto IL_01b3; } } IL_0121: { int32_t L_34 = V_7; if (((int32_t)((int32_t)L_34-(int32_t)((int32_t)112))) == 0) { goto IL_01d1; } if (((int32_t)((int32_t)L_34-(int32_t)((int32_t)112))) == 1) { goto IL_013b; } if (((int32_t)((int32_t)L_34-(int32_t)((int32_t)112))) == 2) { goto IL_013b; } if (((int32_t)((int32_t)L_34-(int32_t)((int32_t)112))) == 3) { goto IL_01b3; } } IL_013b: { int32_t L_35 = V_7; if (((int32_t)((int32_t)L_35-(int32_t)((int32_t)98))) == 0) { goto IL_0171; } if (((int32_t)((int32_t)L_35-(int32_t)((int32_t)98))) == 1) { goto IL_0151; } if (((int32_t)((int32_t)L_35-(int32_t)((int32_t)98))) == 2) { goto IL_0178; } } IL_0151: { int32_t L_36 = V_7; if ((((int32_t)L_36) == ((int32_t)((int32_t)68)))) { goto IL_0178; } } { int32_t L_37 = V_7; if ((((int32_t)L_37) == ((int32_t)((int32_t)87)))) { goto IL_0196; } } { int32_t L_38 = V_7; if ((((int32_t)L_38) == ((int32_t)((int32_t)119)))) { goto IL_0196; } } { goto IL_01e7; } IL_0171: { V_3 = 8; goto IL_0212; } IL_0178: { CharacterClass_t630081023 * L_39 = V_2; bool L_40 = V_1; G_B23_0 = L_39; if (!L_40) { G_B24_0 = L_39; goto IL_0186; } } { G_B25_0 = ((int32_t)9); G_B25_1 = G_B23_0; goto IL_0187; } IL_0186: { G_B25_0 = 4; G_B25_1 = G_B24_0; } IL_0187: { int32_t L_41 = V_3; NullCheck(G_B25_1); CharacterClass_AddCategory_m385157186(G_B25_1, G_B25_0, (bool)((((int32_t)L_41) == ((int32_t)((int32_t)68)))? 1 : 0), /*hidden argument*/NULL); goto IL_01ec; } IL_0196: { CharacterClass_t630081023 * L_42 = V_2; bool L_43 = V_1; G_B27_0 = L_42; if (!L_43) { G_B28_0 = L_42; goto IL_01a3; } } { G_B29_0 = 8; G_B29_1 = G_B27_0; goto IL_01a4; } IL_01a3: { G_B29_0 = 3; G_B29_1 = G_B28_0; } IL_01a4: { int32_t L_44 = V_3; NullCheck(G_B29_1); CharacterClass_AddCategory_m385157186(G_B29_1, G_B29_0, (bool)((((int32_t)L_44) == ((int32_t)((int32_t)87)))? 1 : 0), /*hidden argument*/NULL); goto IL_01ec; } IL_01b3: { CharacterClass_t630081023 * L_45 = V_2; bool L_46 = V_1; G_B31_0 = L_45; if (!L_46) { G_B32_0 = L_45; goto IL_01c1; } } { G_B33_0 = ((int32_t)10); G_B33_1 = G_B31_0; goto IL_01c2; } IL_01c1: { G_B33_0 = 5; G_B33_1 = G_B32_0; } IL_01c2: { int32_t L_47 = V_3; NullCheck(G_B33_1); CharacterClass_AddCategory_m385157186(G_B33_1, G_B33_0, (bool)((((int32_t)L_47) == ((int32_t)((int32_t)83)))? 1 : 0), /*hidden argument*/NULL); goto IL_01ec; } IL_01d1: { CharacterClass_t630081023 * L_48 = V_2; uint16_t L_49 = Parser_ParseUnicodeCategory_m1866187541(__this, /*hidden argument*/NULL); int32_t L_50 = V_3; NullCheck(L_48); CharacterClass_AddCategory_m385157186(L_48, L_49, (bool)((((int32_t)L_50) == ((int32_t)((int32_t)80)))? 1 : 0), /*hidden argument*/NULL); goto IL_01ec; } IL_01e7: { goto IL_0212; } IL_01ec: { bool L_51 = V_5; if (!L_51) { goto IL_020a; } } { int32_t L_52 = V_3; int32_t L_53 = L_52; Il2CppObject * L_54 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_53); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_55 = String_Concat_m389863537(NULL /*static, unused*/, _stringLiteral8084015, L_54, /*hidden argument*/NULL); ArgumentException_t124305799 * L_56 = Parser_NewParseException_m3475856021(__this, L_55, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_56); } IL_020a: { V_4 = (-1); goto IL_027f; } IL_0212: { bool L_57 = V_5; if (!L_57) { goto IL_0274; } } { int32_t L_58 = V_3; int32_t L_59 = V_4; if ((((int32_t)L_58) >= ((int32_t)L_59))) { goto IL_025e; } } { ObjectU5BU5D_t11523773* L_60 = ((ObjectU5BU5D_t11523773*)SZArrayNew(ObjectU5BU5D_t11523773_il2cpp_TypeInfo_var, (uint32_t)5)); NullCheck(L_60); IL2CPP_ARRAY_BOUNDS_CHECK(L_60, 0); ArrayElementTypeCheck (L_60, _stringLiteral91); (L_60)->SetAt(static_cast<il2cpp_array_size_t>(0), (Il2CppObject *)_stringLiteral91); ObjectU5BU5D_t11523773* L_61 = L_60; int32_t L_62 = V_4; int32_t L_63 = L_62; Il2CppObject * L_64 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_63); NullCheck(L_61); IL2CPP_ARRAY_BOUNDS_CHECK(L_61, 1); ArrayElementTypeCheck (L_61, L_64); (L_61)->SetAt(static_cast<il2cpp_array_size_t>(1), (Il2CppObject *)L_64); ObjectU5BU5D_t11523773* L_65 = L_61; NullCheck(L_65); IL2CPP_ARRAY_BOUNDS_CHECK(L_65, 2); ArrayElementTypeCheck (L_65, _stringLiteral45); (L_65)->SetAt(static_cast<il2cpp_array_size_t>(2), (Il2CppObject *)_stringLiteral45); ObjectU5BU5D_t11523773* L_66 = L_65; int32_t L_67 = V_3; int32_t L_68 = L_67; Il2CppObject * L_69 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_68); NullCheck(L_66); IL2CPP_ARRAY_BOUNDS_CHECK(L_66, 3); ArrayElementTypeCheck (L_66, L_69); (L_66)->SetAt(static_cast<il2cpp_array_size_t>(3), (Il2CppObject *)L_69); ObjectU5BU5D_t11523773* L_70 = L_66; NullCheck(L_70); IL2CPP_ARRAY_BOUNDS_CHECK(L_70, 4); ArrayElementTypeCheck (L_70, _stringLiteral3507740435); (L_70)->SetAt(static_cast<il2cpp_array_size_t>(4), (Il2CppObject *)_stringLiteral3507740435); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_71 = String_Concat_m3016520001(NULL /*static, unused*/, L_70, /*hidden argument*/NULL); ArgumentException_t124305799 * L_72 = Parser_NewParseException_m3475856021(__this, L_71, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_72); } IL_025e: { CharacterClass_t630081023 * L_73 = V_2; int32_t L_74 = V_4; int32_t L_75 = V_3; NullCheck(L_73); CharacterClass_AddRange_m4184687523(L_73, (((int32_t)((uint16_t)L_74))), (((int32_t)((uint16_t)L_75))), /*hidden argument*/NULL); V_4 = (-1); V_5 = (bool)0; goto IL_027f; } IL_0274: { CharacterClass_t630081023 * L_76 = V_2; int32_t L_77 = V_3; NullCheck(L_76); CharacterClass_AddCharacter_m509912608(L_76, (((int32_t)((uint16_t)L_77))), /*hidden argument*/NULL); int32_t L_78 = V_3; V_4 = L_78; } IL_027f: { int32_t L_79 = __this->get_ptr_1(); String_t* L_80 = __this->get_pattern_0(); NullCheck(L_80); int32_t L_81 = String_get_Length_m2979997331(L_80, /*hidden argument*/NULL); if ((((int32_t)L_79) < ((int32_t)L_81))) { goto IL_007c; } } IL_0295: { bool L_82 = V_6; if (L_82) { goto IL_02a8; } } { ArgumentException_t124305799 * L_83 = Parser_NewParseException_m3475856021(__this, _stringLiteral453281670, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_83); } IL_02a8: { bool L_84 = V_5; if (!L_84) { goto IL_02b7; } } { CharacterClass_t630081023 * L_85 = V_2; NullCheck(L_85); CharacterClass_AddCharacter_m509912608(L_85, ((int32_t)45), /*hidden argument*/NULL); } IL_02b7: { CharacterClass_t630081023 * L_86 = V_2; return L_86; } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::ParseRepetitionBounds(System.Int32&,System.Int32&,System.Text.RegularExpressions.RegexOptions) extern Il2CppCodeGenString* _stringLiteral4252729485; extern Il2CppCodeGenString* _stringLiteral3682243352; extern const uint32_t Parser_ParseRepetitionBounds_m2180911384_MetadataUsageId; extern "C" bool Parser_ParseRepetitionBounds_m2180911384 (Parser_t3684504143 * __this, int32_t* ___min0, int32_t* ___max1, int32_t ___options2, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseRepetitionBounds_m2180911384_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; uint16_t V_3 = 0x0; { int32_t* L_0 = ___min0; int32_t* L_1 = ___max1; int32_t L_2 = 0; V_2 = L_2; *((int32_t*)(L_1)) = (int32_t)L_2; int32_t L_3 = V_2; *((int32_t*)(L_0)) = (int32_t)L_3; int32_t L_4 = ___options2; bool L_5 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_5, /*hidden argument*/NULL); String_t* L_6 = __this->get_pattern_0(); int32_t L_7 = __this->get_ptr_1(); NullCheck(L_6); uint16_t L_8 = String_get_Chars_m3015341861(L_6, L_7, /*hidden argument*/NULL); if ((!(((uint32_t)L_8) == ((uint32_t)((int32_t)44))))) { goto IL_0033; } } { V_0 = (-1); goto IL_004a; } IL_0033: { int32_t L_9 = Parser_ParseNumber_m2475743354(__this, ((int32_t)10), 1, 0, /*hidden argument*/NULL); V_0 = L_9; int32_t L_10 = ___options2; bool L_11 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_10, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_11, /*hidden argument*/NULL); } IL_004a: { String_t* L_12 = __this->get_pattern_0(); int32_t L_13 = __this->get_ptr_1(); int32_t L_14 = L_13; V_2 = L_14; __this->set_ptr_1(((int32_t)((int32_t)L_14+(int32_t)1))); int32_t L_15 = V_2; NullCheck(L_12); uint16_t L_16 = String_get_Chars_m3015341861(L_12, L_15, /*hidden argument*/NULL); V_3 = L_16; uint16_t L_17 = V_3; if ((((int32_t)L_17) == ((int32_t)((int32_t)44)))) { goto IL_0083; } } { uint16_t L_18 = V_3; if ((((int32_t)L_18) == ((int32_t)((int32_t)125)))) { goto IL_007c; } } { goto IL_00d0; } IL_007c: { int32_t L_19 = V_0; V_1 = L_19; goto IL_00d2; } IL_0083: { int32_t L_20 = ___options2; bool L_21 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_20, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_21, /*hidden argument*/NULL); int32_t L_22 = Parser_ParseNumber_m2475743354(__this, ((int32_t)10), 1, 0, /*hidden argument*/NULL); V_1 = L_22; int32_t L_23 = ___options2; bool L_24 = Parser_IsIgnorePatternWhitespace_m4039716246(NULL /*static, unused*/, L_23, /*hidden argument*/NULL); Parser_ConsumeWhitespace_m3800733805(__this, L_24, /*hidden argument*/NULL); String_t* L_25 = __this->get_pattern_0(); int32_t L_26 = __this->get_ptr_1(); int32_t L_27 = L_26; V_2 = L_27; __this->set_ptr_1(((int32_t)((int32_t)L_27+(int32_t)1))); int32_t L_28 = V_2; NullCheck(L_25); uint16_t L_29 = String_get_Chars_m3015341861(L_25, L_28, /*hidden argument*/NULL); if ((((int32_t)L_29) == ((int32_t)((int32_t)125)))) { goto IL_00cb; } } { return (bool)0; } IL_00cb: { goto IL_00d2; } IL_00d0: { return (bool)0; } IL_00d2: { int32_t L_30 = V_0; if ((((int32_t)L_30) > ((int32_t)((int32_t)2147483647LL)))) { goto IL_00e8; } } { int32_t L_31 = V_1; if ((((int32_t)L_31) <= ((int32_t)((int32_t)2147483647LL)))) { goto IL_00f4; } } IL_00e8: { ArgumentException_t124305799 * L_32 = Parser_NewParseException_m3475856021(__this, _stringLiteral4252729485, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_32); } IL_00f4: { int32_t L_33 = V_1; if ((((int32_t)L_33) < ((int32_t)0))) { goto IL_010e; } } { int32_t L_34 = V_1; int32_t L_35 = V_0; if ((((int32_t)L_34) >= ((int32_t)L_35))) { goto IL_010e; } } { ArgumentException_t124305799 * L_36 = Parser_NewParseException_m3475856021(__this, _stringLiteral3682243352, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_36); } IL_010e: { int32_t* L_37 = ___min0; int32_t L_38 = V_0; *((int32_t*)(L_37)) = (int32_t)L_38; int32_t L_39 = V_1; if ((((int32_t)L_39) <= ((int32_t)0))) { goto IL_0120; } } { int32_t* L_40 = ___max1; int32_t L_41 = V_1; *((int32_t*)(L_40)) = (int32_t)L_41; goto IL_0127; } IL_0120: { int32_t* L_42 = ___max1; *((int32_t*)(L_42)) = (int32_t)((int32_t)2147483647LL); } IL_0127: { return (bool)1; } } // System.Text.RegularExpressions.Category System.Text.RegularExpressions.Syntax.Parser::ParseUnicodeCategory() extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3468227296; extern Il2CppCodeGenString* _stringLiteral1400403538; extern Il2CppCodeGenString* _stringLiteral1255; extern const uint32_t Parser_ParseUnicodeCategory_m1866187541_MetadataUsageId; extern "C" uint16_t Parser_ParseUnicodeCategory_m1866187541 (Parser_t3684504143 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseUnicodeCategory_m1866187541_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* V_0 = NULL; uint16_t V_1 = 0; int32_t V_2 = 0; { String_t* L_0 = __this->get_pattern_0(); int32_t L_1 = __this->get_ptr_1(); int32_t L_2 = L_1; V_2 = L_2; __this->set_ptr_1(((int32_t)((int32_t)L_2+(int32_t)1))); int32_t L_3 = V_2; NullCheck(L_0); uint16_t L_4 = String_get_Chars_m3015341861(L_0, L_3, /*hidden argument*/NULL); if ((((int32_t)L_4) == ((int32_t)((int32_t)123)))) { goto IL_002f; } } { ArgumentException_t124305799 * L_5 = Parser_NewParseException_m3475856021(__this, _stringLiteral3468227296, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_5); } IL_002f: { String_t* L_6 = __this->get_pattern_0(); int32_t* L_7 = __this->get_address_of_ptr_1(); String_t* L_8 = Parser_ParseName_m3152672479(NULL /*static, unused*/, L_6, L_7, /*hidden argument*/NULL); V_0 = L_8; String_t* L_9 = V_0; if (L_9) { goto IL_0053; } } { ArgumentException_t124305799 * L_10 = Parser_NewParseException_m3475856021(__this, _stringLiteral3468227296, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_10); } IL_0053: { String_t* L_11 = V_0; uint16_t L_12 = CategoryUtils_CategoryFromName_m242979705(NULL /*static, unused*/, L_11, /*hidden argument*/NULL); V_1 = L_12; uint16_t L_13 = V_1; if (L_13) { goto IL_0077; } } { String_t* L_14 = V_0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_15 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral1400403538, L_14, _stringLiteral1255, /*hidden argument*/NULL); ArgumentException_t124305799 * L_16 = Parser_NewParseException_m3475856021(__this, L_15, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_16); } IL_0077: { String_t* L_17 = __this->get_pattern_0(); int32_t L_18 = __this->get_ptr_1(); int32_t L_19 = L_18; V_2 = L_19; __this->set_ptr_1(((int32_t)((int32_t)L_19+(int32_t)1))); int32_t L_20 = V_2; NullCheck(L_17); uint16_t L_21 = String_get_Chars_m3015341861(L_17, L_20, /*hidden argument*/NULL); if ((((int32_t)L_21) == ((int32_t)((int32_t)125)))) { goto IL_00a6; } } { ArgumentException_t124305799 * L_22 = Parser_NewParseException_m3475856021(__this, _stringLiteral3468227296, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_22); } IL_00a6: { uint16_t L_23 = V_1; return L_23; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.Parser::ParseSpecial(System.Text.RegularExpressions.RegexOptions) extern Il2CppClass* CharacterClass_t630081023_il2cpp_TypeInfo_var; extern Il2CppClass* PositionAssertion_t3660056009_il2cpp_TypeInfo_var; extern Il2CppClass* BackslashNumber_t1411804623_il2cpp_TypeInfo_var; extern Il2CppClass* Reference_t2379893051_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral393806137; extern const uint32_t Parser_ParseSpecial_m1376060474_MetadataUsageId; extern "C" Expression_t1499093192 * Parser_ParseSpecial_m1376060474 (Parser_t3684504143 * __this, int32_t ___options0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseSpecial_m1376060474_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; bool V_1 = false; Expression_t1499093192 * V_2 = NULL; int32_t V_3 = 0; Reference_t2379893051 * V_4 = NULL; uint16_t V_5 = 0x0; String_t* V_6 = NULL; Reference_t2379893051 * V_7 = NULL; int32_t V_8 = 0; uint16_t V_9 = 0x0; int32_t G_B11_0 = 0; int32_t G_B15_0 = 0; int32_t G_B19_0 = 0; int32_t G_B24_0 = 0; int32_t G_B28_0 = 0; int32_t G_B32_0 = 0; { int32_t L_0 = __this->get_ptr_1(); V_0 = L_0; int32_t L_1 = ___options0; bool L_2 = Parser_IsECMAScript_m432342092(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); V_1 = L_2; V_2 = (Expression_t1499093192 *)NULL; String_t* L_3 = __this->get_pattern_0(); int32_t L_4 = __this->get_ptr_1(); int32_t L_5 = L_4; V_8 = L_5; __this->set_ptr_1(((int32_t)((int32_t)L_5+(int32_t)1))); int32_t L_6 = V_8; NullCheck(L_3); uint16_t L_7 = String_get_Chars_m3015341861(L_3, L_6, /*hidden argument*/NULL); V_9 = L_7; uint16_t L_8 = V_9; if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 0) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 1) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 2) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 3) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 4) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 5) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 6) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 7) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 8) { goto IL_0229; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 9) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 10) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 11) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 12) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 13) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 14) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 15) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 16) { goto IL_01e0; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 17) { goto IL_021c; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 18) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 19) { goto IL_0181; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 20) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 21) { goto IL_0096; } if (((int32_t)((int32_t)L_8-(int32_t)((int32_t)49))) == 22) { goto IL_0204; } } IL_0096: { uint16_t L_9 = V_9; if (((int32_t)((int32_t)L_9-(int32_t)((int32_t)80))) == 0) { goto IL_01ce; } if (((int32_t)((int32_t)L_9-(int32_t)((int32_t)80))) == 1) { goto IL_00b0; } if (((int32_t)((int32_t)L_9-(int32_t)((int32_t)80))) == 2) { goto IL_00b0; } if (((int32_t)((int32_t)L_9-(int32_t)((int32_t)80))) == 3) { goto IL_01b4; } } IL_00b0: { uint16_t L_10 = V_9; if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)87))) == 0) { goto IL_019b; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)87))) == 1) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)87))) == 2) { goto IL_00ca; } if (((int32_t)((int32_t)L_10-(int32_t)((int32_t)87))) == 3) { goto IL_01ec; } } IL_00ca: { uint16_t L_11 = V_9; if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)112))) == 0) { goto IL_016f; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)112))) == 1) { goto IL_00e4; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)112))) == 2) { goto IL_00e4; } if (((int32_t)((int32_t)L_11-(int32_t)((int32_t)112))) == 3) { goto IL_0155; } } IL_00e4: { uint16_t L_12 = V_9; if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)119))) == 0) { goto IL_013c; } if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)119))) == 1) { goto IL_00fe; } if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)119))) == 2) { goto IL_00fe; } if (((int32_t)((int32_t)L_12-(int32_t)((int32_t)119))) == 3) { goto IL_01f8; } } IL_00fe: { uint16_t L_13 = V_9; if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)98))) == 0) { goto IL_0210; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)98))) == 1) { goto IL_0114; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)98))) == 2) { goto IL_0122; } } IL_0114: { uint16_t L_14 = V_9; if ((((int32_t)L_14) == ((int32_t)((int32_t)107)))) { goto IL_027c; } } { goto IL_0328; } IL_0122: { bool L_15 = V_1; if (!L_15) { goto IL_012f; } } { G_B11_0 = ((int32_t)9); goto IL_0130; } IL_012f: { G_B11_0 = 4; } IL_0130: { CharacterClass_t630081023 * L_16 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_16, G_B11_0, (bool)0, /*hidden argument*/NULL); V_2 = L_16; goto IL_032f; } IL_013c: { bool L_17 = V_1; if (!L_17) { goto IL_0148; } } { G_B15_0 = 8; goto IL_0149; } IL_0148: { G_B15_0 = 3; } IL_0149: { CharacterClass_t630081023 * L_18 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_18, G_B15_0, (bool)0, /*hidden argument*/NULL); V_2 = L_18; goto IL_032f; } IL_0155: { bool L_19 = V_1; if (!L_19) { goto IL_0162; } } { G_B19_0 = ((int32_t)10); goto IL_0163; } IL_0162: { G_B19_0 = 5; } IL_0163: { CharacterClass_t630081023 * L_20 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_20, G_B19_0, (bool)0, /*hidden argument*/NULL); V_2 = L_20; goto IL_032f; } IL_016f: { uint16_t L_21 = Parser_ParseUnicodeCategory_m1866187541(__this, /*hidden argument*/NULL); CharacterClass_t630081023 * L_22 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_22, L_21, (bool)0, /*hidden argument*/NULL); V_2 = L_22; goto IL_032f; } IL_0181: { bool L_23 = V_1; if (!L_23) { goto IL_018e; } } { G_B24_0 = ((int32_t)9); goto IL_018f; } IL_018e: { G_B24_0 = 4; } IL_018f: { CharacterClass_t630081023 * L_24 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_24, G_B24_0, (bool)1, /*hidden argument*/NULL); V_2 = L_24; goto IL_032f; } IL_019b: { bool L_25 = V_1; if (!L_25) { goto IL_01a7; } } { G_B28_0 = 8; goto IL_01a8; } IL_01a7: { G_B28_0 = 3; } IL_01a8: { CharacterClass_t630081023 * L_26 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_26, G_B28_0, (bool)1, /*hidden argument*/NULL); V_2 = L_26; goto IL_032f; } IL_01b4: { bool L_27 = V_1; if (!L_27) { goto IL_01c1; } } { G_B32_0 = ((int32_t)10); goto IL_01c2; } IL_01c1: { G_B32_0 = 5; } IL_01c2: { CharacterClass_t630081023 * L_28 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_28, G_B32_0, (bool)1, /*hidden argument*/NULL); V_2 = L_28; goto IL_032f; } IL_01ce: { uint16_t L_29 = Parser_ParseUnicodeCategory_m1866187541(__this, /*hidden argument*/NULL); CharacterClass_t630081023 * L_30 = (CharacterClass_t630081023 *)il2cpp_codegen_object_new(CharacterClass_t630081023_il2cpp_TypeInfo_var); CharacterClass__ctor_m3672999653(L_30, L_29, (bool)1, /*hidden argument*/NULL); V_2 = L_30; goto IL_032f; } IL_01e0: { PositionAssertion_t3660056009 * L_31 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_31, 2, /*hidden argument*/NULL); V_2 = L_31; goto IL_032f; } IL_01ec: { PositionAssertion_t3660056009 * L_32 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_32, 5, /*hidden argument*/NULL); V_2 = L_32; goto IL_032f; } IL_01f8: { PositionAssertion_t3660056009 * L_33 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_33, 6, /*hidden argument*/NULL); V_2 = L_33; goto IL_032f; } IL_0204: { PositionAssertion_t3660056009 * L_34 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_34, 4, /*hidden argument*/NULL); V_2 = L_34; goto IL_032f; } IL_0210: { PositionAssertion_t3660056009 * L_35 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_35, 8, /*hidden argument*/NULL); V_2 = L_35; goto IL_032f; } IL_021c: { PositionAssertion_t3660056009 * L_36 = (PositionAssertion_t3660056009 *)il2cpp_codegen_object_new(PositionAssertion_t3660056009_il2cpp_TypeInfo_var); PositionAssertion__ctor_m2712509165(L_36, ((int32_t)9), /*hidden argument*/NULL); V_2 = L_36; goto IL_032f; } IL_0229: { int32_t L_37 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_37-(int32_t)1))); int32_t L_38 = Parser_ParseNumber_m2475743354(__this, ((int32_t)10), 1, 0, /*hidden argument*/NULL); V_3 = L_38; int32_t L_39 = V_3; if ((((int32_t)L_39) >= ((int32_t)0))) { goto IL_0252; } } { int32_t L_40 = V_0; __this->set_ptr_1(L_40); return (Expression_t1499093192 *)NULL; } IL_0252: { int32_t L_41 = ___options0; bool L_42 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_41, /*hidden argument*/NULL); bool L_43 = V_1; BackslashNumber_t1411804623 * L_44 = (BackslashNumber_t1411804623 *)il2cpp_codegen_object_new(BackslashNumber_t1411804623_il2cpp_TypeInfo_var); BackslashNumber__ctor_m1444209053(L_44, L_42, L_43, /*hidden argument*/NULL); V_4 = L_44; Hashtable_t3875263730 * L_45 = __this->get_refs_3(); Reference_t2379893051 * L_46 = V_4; String_t* L_47 = Int32_ToString_m1286526384((&V_3), /*hidden argument*/NULL); NullCheck(L_45); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_45, L_46, L_47); Reference_t2379893051 * L_48 = V_4; V_2 = L_48; goto IL_032f; } IL_027c: { String_t* L_49 = __this->get_pattern_0(); int32_t L_50 = __this->get_ptr_1(); int32_t L_51 = L_50; V_8 = L_51; __this->set_ptr_1(((int32_t)((int32_t)L_51+(int32_t)1))); int32_t L_52 = V_8; NullCheck(L_49); uint16_t L_53 = String_get_Chars_m3015341861(L_49, L_52, /*hidden argument*/NULL); V_5 = L_53; uint16_t L_54 = V_5; if ((!(((uint32_t)L_54) == ((uint32_t)((int32_t)60))))) { goto IL_02ae; } } { V_5 = ((int32_t)62); goto IL_02c3; } IL_02ae: { uint16_t L_55 = V_5; if ((((int32_t)L_55) == ((int32_t)((int32_t)39)))) { goto IL_02c3; } } { ArgumentException_t124305799 * L_56 = Parser_NewParseException_m3475856021(__this, _stringLiteral393806137, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_56); } IL_02c3: { String_t* L_57 = Parser_ParseName_m417255288(__this, /*hidden argument*/NULL); V_6 = L_57; String_t* L_58 = V_6; if (!L_58) { goto IL_02ea; } } { String_t* L_59 = __this->get_pattern_0(); int32_t L_60 = __this->get_ptr_1(); NullCheck(L_59); uint16_t L_61 = String_get_Chars_m3015341861(L_59, L_60, /*hidden argument*/NULL); uint16_t L_62 = V_5; if ((((int32_t)L_61) == ((int32_t)L_62))) { goto IL_02f6; } } IL_02ea: { ArgumentException_t124305799 * L_63 = Parser_NewParseException_m3475856021(__this, _stringLiteral393806137, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_63); } IL_02f6: { int32_t L_64 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_64+(int32_t)1))); int32_t L_65 = ___options0; bool L_66 = Parser_IsIgnoreCase_m3077668423(NULL /*static, unused*/, L_65, /*hidden argument*/NULL); Reference_t2379893051 * L_67 = (Reference_t2379893051 *)il2cpp_codegen_object_new(Reference_t2379893051_il2cpp_TypeInfo_var); Reference__ctor_m425097396(L_67, L_66, /*hidden argument*/NULL); V_7 = L_67; Hashtable_t3875263730 * L_68 = __this->get_refs_3(); Reference_t2379893051 * L_69 = V_7; String_t* L_70 = V_6; NullCheck(L_68); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_68, L_69, L_70); Reference_t2379893051 * L_71 = V_7; V_2 = L_71; goto IL_032f; } IL_0328: { V_2 = (Expression_t1499093192 *)NULL; goto IL_032f; } IL_032f: { Expression_t1499093192 * L_72 = V_2; if (L_72) { goto IL_033c; } } { int32_t L_73 = V_0; __this->set_ptr_1(L_73); } IL_033c: { Expression_t1499093192 * L_74 = V_2; return L_74; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseEscape() extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* ArgumentException_t124305799_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3644351722; extern Il2CppCodeGenString* _stringLiteral1493704104; extern Il2CppCodeGenString* _stringLiteral2376660857; extern const uint32_t Parser_ParseEscape_m675256065_MetadataUsageId; extern "C" int32_t Parser_ParseEscape_m675256065 (Parser_t3684504143 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ParseEscape_m675256065_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; int32_t V_3 = 0; int32_t V_4 = 0; uint16_t V_5 = 0x0; { int32_t L_0 = __this->get_ptr_1(); V_0 = L_0; int32_t L_1 = V_0; String_t* L_2 = __this->get_pattern_0(); NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); if ((((int32_t)L_1) < ((int32_t)L_3))) { goto IL_0034; } } { String_t* L_4 = __this->get_pattern_0(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_5 = String_Format_m2471250780(NULL /*static, unused*/, _stringLiteral3644351722, L_4, /*hidden argument*/NULL); String_t* L_6 = __this->get_pattern_0(); ArgumentException_t124305799 * L_7 = (ArgumentException_t124305799 *)il2cpp_codegen_object_new(ArgumentException_t124305799_il2cpp_TypeInfo_var); ArgumentException__ctor_m732321503(L_7, L_5, L_6, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_7); } IL_0034: { String_t* L_8 = __this->get_pattern_0(); int32_t L_9 = __this->get_ptr_1(); int32_t L_10 = L_9; V_4 = L_10; __this->set_ptr_1(((int32_t)((int32_t)L_10+(int32_t)1))); int32_t L_11 = V_4; NullCheck(L_8); uint16_t L_12 = String_get_Chars_m3015341861(L_8, L_11, /*hidden argument*/NULL); V_5 = L_12; uint16_t L_13 = V_5; if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 0) { goto IL_00d1; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 1) { goto IL_008a; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 2) { goto IL_008a; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 3) { goto IL_008a; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 4) { goto IL_00c8; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 5) { goto IL_008a; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 6) { goto IL_00c5; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 7) { goto IL_0140; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 8) { goto IL_00cb; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 9) { goto IL_008a; } if (((int32_t)((int32_t)L_13-(int32_t)((int32_t)110))) == 10) { goto IL_0118; } } IL_008a: { uint16_t L_14 = V_5; if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)97))) == 0) { goto IL_00c3; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)97))) == 1) { goto IL_00ac; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)97))) == 2) { goto IL_0168; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)97))) == 3) { goto IL_00ac; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)97))) == 4) { goto IL_00d4; } if (((int32_t)((int32_t)L_14-(int32_t)((int32_t)97))) == 5) { goto IL_00ce; } } IL_00ac: { uint16_t L_15 = V_5; if ((((int32_t)L_15) == ((int32_t)((int32_t)48)))) { goto IL_00da; } } { uint16_t L_16 = V_5; if ((((int32_t)L_16) == ((int32_t)((int32_t)92)))) { goto IL_00d7; } } { goto IL_01a8; } IL_00c3: { return 7; } IL_00c5: { return ((int32_t)9); } IL_00c8: { return ((int32_t)13); } IL_00cb: { return ((int32_t)11); } IL_00ce: { return ((int32_t)12); } IL_00d1: { return ((int32_t)10); } IL_00d4: { return ((int32_t)27); } IL_00d7: { return ((int32_t)92); } IL_00da: { int32_t L_17 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_17-(int32_t)1))); int32_t L_18 = __this->get_ptr_1(); V_2 = L_18; String_t* L_19 = __this->get_pattern_0(); int32_t* L_20 = __this->get_address_of_ptr_1(); int32_t L_21 = Parser_ParseOctal_m1398273866(NULL /*static, unused*/, L_19, L_20, /*hidden argument*/NULL); V_3 = L_21; int32_t L_22 = V_3; if ((!(((uint32_t)L_22) == ((uint32_t)(-1))))) { goto IL_0116; } } { int32_t L_23 = V_2; int32_t L_24 = __this->get_ptr_1(); if ((!(((uint32_t)L_23) == ((uint32_t)L_24)))) { goto IL_0116; } } { return 0; } IL_0116: { int32_t L_25 = V_3; return L_25; } IL_0118: { String_t* L_26 = __this->get_pattern_0(); int32_t* L_27 = __this->get_address_of_ptr_1(); int32_t L_28 = Parser_ParseHex_m370479069(NULL /*static, unused*/, L_26, L_27, 2, /*hidden argument*/NULL); V_1 = L_28; int32_t L_29 = V_1; if ((((int32_t)L_29) >= ((int32_t)0))) { goto IL_013e; } } { ArgumentException_t124305799 * L_30 = Parser_NewParseException_m3475856021(__this, _stringLiteral1493704104, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_30); } IL_013e: { int32_t L_31 = V_1; return L_31; } IL_0140: { String_t* L_32 = __this->get_pattern_0(); int32_t* L_33 = __this->get_address_of_ptr_1(); int32_t L_34 = Parser_ParseHex_m370479069(NULL /*static, unused*/, L_32, L_33, 4, /*hidden argument*/NULL); V_1 = L_34; int32_t L_35 = V_1; if ((((int32_t)L_35) >= ((int32_t)0))) { goto IL_0166; } } { ArgumentException_t124305799 * L_36 = Parser_NewParseException_m3475856021(__this, _stringLiteral1493704104, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_36); } IL_0166: { int32_t L_37 = V_1; return L_37; } IL_0168: { String_t* L_38 = __this->get_pattern_0(); int32_t L_39 = __this->get_ptr_1(); int32_t L_40 = L_39; V_4 = L_40; __this->set_ptr_1(((int32_t)((int32_t)L_40+(int32_t)1))); int32_t L_41 = V_4; NullCheck(L_38); uint16_t L_42 = String_get_Chars_m3015341861(L_38, L_41, /*hidden argument*/NULL); V_1 = L_42; int32_t L_43 = V_1; if ((((int32_t)L_43) < ((int32_t)((int32_t)64)))) { goto IL_019c; } } { int32_t L_44 = V_1; if ((((int32_t)L_44) > ((int32_t)((int32_t)95)))) { goto IL_019c; } } { int32_t L_45 = V_1; return ((int32_t)((int32_t)L_45-(int32_t)((int32_t)64))); } IL_019c: { ArgumentException_t124305799 * L_46 = Parser_NewParseException_m3475856021(__this, _stringLiteral2376660857, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_46); } IL_01a8: { int32_t L_47 = V_0; __this->set_ptr_1(L_47); return (-1); } } // System.String System.Text.RegularExpressions.Syntax.Parser::ParseName() extern "C" String_t* Parser_ParseName_m417255288 (Parser_t3684504143 * __this, const MethodInfo* method) { { String_t* L_0 = __this->get_pattern_0(); int32_t* L_1 = __this->get_address_of_ptr_1(); String_t* L_2 = Parser_ParseName_m3152672479(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); return L_2; } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsNameChar(System.Char) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t Parser_IsNameChar_m1287282583_MetadataUsageId; extern "C" bool Parser_IsNameChar_m1287282583 (Il2CppObject * __this /* static, unused */, uint16_t ___c0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_IsNameChar_m1287282583_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { uint16_t L_0 = ___c0; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); int32_t L_1 = Char_GetUnicodeCategory_m494586991(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; int32_t L_2 = V_0; if ((!(((uint32_t)L_2) == ((uint32_t)3)))) { goto IL_0010; } } { return (bool)0; } IL_0010: { int32_t L_3 = V_0; if ((!(((uint32_t)L_3) == ((uint32_t)((int32_t)18))))) { goto IL_001a; } } { return (bool)1; } IL_001a: { uint16_t L_4 = ___c0; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_5 = Char_IsLetterOrDigit_m2290383044(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); return L_5; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseNumber(System.Int32,System.Int32,System.Int32) extern "C" int32_t Parser_ParseNumber_m2475743354 (Parser_t3684504143 * __this, int32_t ___b0, int32_t ___min1, int32_t ___max2, const MethodInfo* method) { { String_t* L_0 = __this->get_pattern_0(); int32_t* L_1 = __this->get_address_of_ptr_1(); int32_t L_2 = ___b0; int32_t L_3 = ___min1; int32_t L_4 = ___max2; int32_t L_5 = Parser_ParseNumber_m633788361(NULL /*static, unused*/, L_0, L_1, L_2, L_3, L_4, /*hidden argument*/NULL); return L_5; } } // System.Int32 System.Text.RegularExpressions.Syntax.Parser::ParseDigit(System.Char,System.Int32,System.Int32) extern "C" int32_t Parser_ParseDigit_m3105438222 (Il2CppObject * __this /* static, unused */, uint16_t ___c0, int32_t ___b1, int32_t ___n2, const MethodInfo* method) { int32_t V_0 = 0; { int32_t L_0 = ___b1; V_0 = L_0; int32_t L_1 = V_0; if (((int32_t)((int32_t)L_1-(int32_t)8)) == 0) { goto IL_0023; } if (((int32_t)((int32_t)L_1-(int32_t)8)) == 1) { goto IL_0016; } if (((int32_t)((int32_t)L_1-(int32_t)8)) == 2) { goto IL_003a; } } IL_0016: { int32_t L_2 = V_0; if ((((int32_t)L_2) == ((int32_t)((int32_t)16)))) { goto IL_0051; } } { goto IL_0098; } IL_0023: { uint16_t L_3 = ___c0; if ((((int32_t)L_3) < ((int32_t)((int32_t)48)))) { goto IL_0038; } } { uint16_t L_4 = ___c0; if ((((int32_t)L_4) > ((int32_t)((int32_t)55)))) { goto IL_0038; } } { uint16_t L_5 = ___c0; return ((int32_t)((int32_t)L_5-(int32_t)((int32_t)48))); } IL_0038: { return (-1); } IL_003a: { uint16_t L_6 = ___c0; if ((((int32_t)L_6) < ((int32_t)((int32_t)48)))) { goto IL_004f; } } { uint16_t L_7 = ___c0; if ((((int32_t)L_7) > ((int32_t)((int32_t)57)))) { goto IL_004f; } } { uint16_t L_8 = ___c0; return ((int32_t)((int32_t)L_8-(int32_t)((int32_t)48))); } IL_004f: { return (-1); } IL_0051: { uint16_t L_9 = ___c0; if ((((int32_t)L_9) < ((int32_t)((int32_t)48)))) { goto IL_0066; } } { uint16_t L_10 = ___c0; if ((((int32_t)L_10) > ((int32_t)((int32_t)57)))) { goto IL_0066; } } { uint16_t L_11 = ___c0; return ((int32_t)((int32_t)L_11-(int32_t)((int32_t)48))); } IL_0066: { uint16_t L_12 = ___c0; if ((((int32_t)L_12) < ((int32_t)((int32_t)97)))) { goto IL_007e; } } { uint16_t L_13 = ___c0; if ((((int32_t)L_13) > ((int32_t)((int32_t)102)))) { goto IL_007e; } } { uint16_t L_14 = ___c0; return ((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)10)+(int32_t)L_14))-(int32_t)((int32_t)97))); } IL_007e: { uint16_t L_15 = ___c0; if ((((int32_t)L_15) < ((int32_t)((int32_t)65)))) { goto IL_0096; } } { uint16_t L_16 = ___c0; if ((((int32_t)L_16) > ((int32_t)((int32_t)70)))) { goto IL_0096; } } { uint16_t L_17 = ___c0; return ((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)10)+(int32_t)L_17))-(int32_t)((int32_t)65))); } IL_0096: { return (-1); } IL_0098: { return (-1); } } // System.Void System.Text.RegularExpressions.Syntax.Parser::ConsumeWhitespace(System.Boolean) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t Parser_ConsumeWhitespace_m3800733805_MetadataUsageId; extern "C" void Parser_ConsumeWhitespace_m3800733805 (Parser_t3684504143 * __this, bool ___ignore0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ConsumeWhitespace_m3800733805_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { goto IL_0188; } IL_0005: { String_t* L_0 = __this->get_pattern_0(); int32_t L_1 = __this->get_ptr_1(); NullCheck(L_0); uint16_t L_2 = String_get_Chars_m3015341861(L_0, L_1, /*hidden argument*/NULL); if ((!(((uint32_t)L_2) == ((uint32_t)((int32_t)40))))) { goto IL_00bc; } } { int32_t L_3 = __this->get_ptr_1(); String_t* L_4 = __this->get_pattern_0(); NullCheck(L_4); int32_t L_5 = String_get_Length_m2979997331(L_4, /*hidden argument*/NULL); if ((((int32_t)((int32_t)((int32_t)L_3+(int32_t)3))) < ((int32_t)L_5))) { goto IL_0036; } } { return; } IL_0036: { String_t* L_6 = __this->get_pattern_0(); int32_t L_7 = __this->get_ptr_1(); NullCheck(L_6); uint16_t L_8 = String_get_Chars_m3015341861(L_6, ((int32_t)((int32_t)L_7+(int32_t)1)), /*hidden argument*/NULL); if ((!(((uint32_t)L_8) == ((uint32_t)((int32_t)63))))) { goto IL_006a; } } { String_t* L_9 = __this->get_pattern_0(); int32_t L_10 = __this->get_ptr_1(); NullCheck(L_9); uint16_t L_11 = String_get_Chars_m3015341861(L_9, ((int32_t)((int32_t)L_10+(int32_t)2)), /*hidden argument*/NULL); if ((((int32_t)L_11) == ((int32_t)((int32_t)35)))) { goto IL_006b; } } IL_006a: { return; } IL_006b: { int32_t L_12 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_12+(int32_t)3))); goto IL_007e; } IL_007e: { int32_t L_13 = __this->get_ptr_1(); String_t* L_14 = __this->get_pattern_0(); NullCheck(L_14); int32_t L_15 = String_get_Length_m2979997331(L_14, /*hidden argument*/NULL); if ((((int32_t)L_13) >= ((int32_t)L_15))) { goto IL_00b7; } } { String_t* L_16 = __this->get_pattern_0(); int32_t L_17 = __this->get_ptr_1(); int32_t L_18 = L_17; V_0 = L_18; __this->set_ptr_1(((int32_t)((int32_t)L_18+(int32_t)1))); int32_t L_19 = V_0; NullCheck(L_16); uint16_t L_20 = String_get_Chars_m3015341861(L_16, L_19, /*hidden argument*/NULL); if ((!(((uint32_t)L_20) == ((uint32_t)((int32_t)41))))) { goto IL_007e; } } IL_00b7: { goto IL_0188; } IL_00bc: { bool L_21 = ___ignore0; if (!L_21) { goto IL_011d; } } { String_t* L_22 = __this->get_pattern_0(); int32_t L_23 = __this->get_ptr_1(); NullCheck(L_22); uint16_t L_24 = String_get_Chars_m3015341861(L_22, L_23, /*hidden argument*/NULL); if ((!(((uint32_t)L_24) == ((uint32_t)((int32_t)35))))) { goto IL_011d; } } { goto IL_00df; } IL_00df: { int32_t L_25 = __this->get_ptr_1(); String_t* L_26 = __this->get_pattern_0(); NullCheck(L_26); int32_t L_27 = String_get_Length_m2979997331(L_26, /*hidden argument*/NULL); if ((((int32_t)L_25) >= ((int32_t)L_27))) { goto IL_0118; } } { String_t* L_28 = __this->get_pattern_0(); int32_t L_29 = __this->get_ptr_1(); int32_t L_30 = L_29; V_0 = L_30; __this->set_ptr_1(((int32_t)((int32_t)L_30+(int32_t)1))); int32_t L_31 = V_0; NullCheck(L_28); uint16_t L_32 = String_get_Chars_m3015341861(L_28, L_31, /*hidden argument*/NULL); if ((!(((uint32_t)L_32) == ((uint32_t)((int32_t)10))))) { goto IL_00df; } } IL_0118: { goto IL_0188; } IL_011d: { bool L_33 = ___ignore0; if (!L_33) { goto IL_0187; } } { String_t* L_34 = __this->get_pattern_0(); int32_t L_35 = __this->get_ptr_1(); NullCheck(L_34); uint16_t L_36 = String_get_Chars_m3015341861(L_34, L_35, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_37 = Char_IsWhiteSpace_m2745315955(NULL /*static, unused*/, L_36, /*hidden argument*/NULL); if (!L_37) { goto IL_0187; } } { goto IL_0151; } IL_0143: { int32_t L_38 = __this->get_ptr_1(); __this->set_ptr_1(((int32_t)((int32_t)L_38+(int32_t)1))); } IL_0151: { int32_t L_39 = __this->get_ptr_1(); String_t* L_40 = __this->get_pattern_0(); NullCheck(L_40); int32_t L_41 = String_get_Length_m2979997331(L_40, /*hidden argument*/NULL); if ((((int32_t)L_39) >= ((int32_t)L_41))) { goto IL_0182; } } { String_t* L_42 = __this->get_pattern_0(); int32_t L_43 = __this->get_ptr_1(); NullCheck(L_42); uint16_t L_44 = String_get_Chars_m3015341861(L_42, L_43, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_45 = Char_IsWhiteSpace_m2745315955(NULL /*static, unused*/, L_44, /*hidden argument*/NULL); if (L_45) { goto IL_0143; } } IL_0182: { goto IL_0188; } IL_0187: { return; } IL_0188: { int32_t L_46 = __this->get_ptr_1(); String_t* L_47 = __this->get_pattern_0(); NullCheck(L_47); int32_t L_48 = String_get_Length_m2979997331(L_47, /*hidden argument*/NULL); if ((((int32_t)L_46) < ((int32_t)L_48))) { goto IL_0005; } } { return; } } // System.Void System.Text.RegularExpressions.Syntax.Parser::ResolveReferences() extern Il2CppClass* Hashtable_t3875263730_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* CapturingGroup_t1439411180_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* ArrayList_t2121638921_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerable_t287189635_il2cpp_TypeInfo_var; extern Il2CppClass* Expression_t1499093192_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* CaptureAssertion_t1074818188_il2cpp_TypeInfo_var; extern Il2CppClass* BackslashNumber_t1411804623_il2cpp_TypeInfo_var; extern Il2CppClass* Reference_t2379893051_il2cpp_TypeInfo_var; extern Il2CppClass* BalancingGroup_t3928584086_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral4142515425; extern Il2CppCodeGenString* _stringLiteral2294451703; extern Il2CppCodeGenString* _stringLiteral104584949; extern const uint32_t Parser_ResolveReferences_m1842037937_MetadataUsageId; extern "C" void Parser_ResolveReferences_m1842037937 (Parser_t3684504143 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_ResolveReferences_m1842037937_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; Hashtable_t3875263730 * V_1 = NULL; ArrayList_t2121638921 * V_2 = NULL; CapturingGroup_t1439411180 * V_3 = NULL; Il2CppObject * V_4 = NULL; CapturingGroup_t1439411180 * V_5 = NULL; Il2CppObject * V_6 = NULL; CapturingGroup_t1439411180 * V_7 = NULL; int32_t V_8 = 0; int32_t V_9 = 0; String_t* V_10 = NULL; Expression_t1499093192 * V_11 = NULL; Il2CppObject * V_12 = NULL; String_t* V_13 = NULL; BackslashNumber_t1411804623 * V_14 = NULL; CapturingGroup_t1439411180 * V_15 = NULL; Il2CppObject * V_16 = NULL; int32_t V_17 = 0; Il2CppObject * V_18 = NULL; Il2CppObject * V_19 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); String_t* G_B50_0 = NULL; Parser_t3684504143 * G_B50_1 = NULL; String_t* G_B49_0 = NULL; Parser_t3684504143 * G_B49_1 = NULL; String_t* G_B51_0 = NULL; String_t* G_B51_1 = NULL; Parser_t3684504143 * G_B51_2 = NULL; { V_0 = 1; Hashtable_t3875263730 * L_0 = (Hashtable_t3875263730 *)il2cpp_codegen_object_new(Hashtable_t3875263730_il2cpp_TypeInfo_var); Hashtable__ctor_m1514037738(L_0, /*hidden argument*/NULL); V_1 = L_0; V_2 = (ArrayList_t2121638921 *)NULL; ArrayList_t2121638921 * L_1 = __this->get_caps_2(); NullCheck(L_1); Il2CppObject * L_2 = VirtFuncInvoker0< Il2CppObject * >::Invoke(39 /* System.Collections.IEnumerator System.Collections.ArrayList::GetEnumerator() */, L_1); V_4 = L_2; } IL_0017: try { // begin try (depth: 1) { goto IL_0060; } IL_001c: { Il2CppObject * L_3 = V_4; NullCheck(L_3); Il2CppObject * L_4 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_3); V_3 = ((CapturingGroup_t1439411180 *)CastclassClass(L_4, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); CapturingGroup_t1439411180 * L_5 = V_3; NullCheck(L_5); String_t* L_6 = CapturingGroup_get_Name_m1678290617(L_5, /*hidden argument*/NULL); if (!L_6) { goto IL_0039; } } IL_0034: { goto IL_0060; } IL_0039: { Hashtable_t3875263730 * L_7 = V_1; String_t* L_8 = Int32_ToString_m1286526384((&V_0), /*hidden argument*/NULL); CapturingGroup_t1439411180 * L_9 = V_3; NullCheck(L_7); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_7, L_8, L_9); CapturingGroup_t1439411180 * L_10 = V_3; int32_t L_11 = V_0; int32_t L_12 = L_11; V_0 = ((int32_t)((int32_t)L_12+(int32_t)1)); NullCheck(L_10); CapturingGroup_set_Index_m1904349670(L_10, L_12, /*hidden argument*/NULL); int32_t L_13 = __this->get_num_groups_4(); __this->set_num_groups_4(((int32_t)((int32_t)L_13+(int32_t)1))); } IL_0060: { Il2CppObject * L_14 = V_4; NullCheck(L_14); bool L_15 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_14); if (L_15) { goto IL_001c; } } IL_006c: { IL2CPP_LEAVE(0x87, FINALLY_0071); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_0071; } FINALLY_0071: { // begin finally (depth: 1) { Il2CppObject * L_16 = V_4; V_16 = ((Il2CppObject *)IsInst(L_16, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_17 = V_16; if (L_17) { goto IL_007f; } } IL_007e: { IL2CPP_END_FINALLY(113) } IL_007f: { Il2CppObject * L_18 = V_16; NullCheck(L_18); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_18); IL2CPP_END_FINALLY(113) } } // end finally (depth: 1) IL2CPP_CLEANUP(113) { IL2CPP_JUMP_TBL(0x87, IL_0087) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0087: { ArrayList_t2121638921 * L_19 = __this->get_caps_2(); NullCheck(L_19); Il2CppObject * L_20 = VirtFuncInvoker0< Il2CppObject * >::Invoke(39 /* System.Collections.IEnumerator System.Collections.ArrayList::GetEnumerator() */, L_19); V_6 = L_20; } IL_0094: try { // begin try (depth: 1) { goto IL_020a; } IL_0099: { Il2CppObject * L_21 = V_6; NullCheck(L_21); Il2CppObject * L_22 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_21); V_5 = ((CapturingGroup_t1439411180 *)CastclassClass(L_22, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); CapturingGroup_t1439411180 * L_23 = V_5; NullCheck(L_23); String_t* L_24 = CapturingGroup_get_Name_m1678290617(L_23, /*hidden argument*/NULL); if (L_24) { goto IL_00b8; } } IL_00b3: { goto IL_020a; } IL_00b8: { Hashtable_t3875263730 * L_25 = V_1; CapturingGroup_t1439411180 * L_26 = V_5; NullCheck(L_26); String_t* L_27 = CapturingGroup_get_Name_m1678290617(L_26, /*hidden argument*/NULL); NullCheck(L_25); bool L_28 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(25 /* System.Boolean System.Collections.Hashtable::Contains(System.Object) */, L_25, L_27); if (!L_28) { goto IL_011d; } } IL_00ca: { Hashtable_t3875263730 * L_29 = V_1; CapturingGroup_t1439411180 * L_30 = V_5; NullCheck(L_30); String_t* L_31 = CapturingGroup_get_Name_m1678290617(L_30, /*hidden argument*/NULL); NullCheck(L_29); Il2CppObject * L_32 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_29, L_31); V_7 = ((CapturingGroup_t1439411180 *)CastclassClass(L_32, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); CapturingGroup_t1439411180 * L_33 = V_5; CapturingGroup_t1439411180 * L_34 = V_7; NullCheck(L_34); int32_t L_35 = CapturingGroup_get_Index_m1539088601(L_34, /*hidden argument*/NULL); NullCheck(L_33); CapturingGroup_set_Index_m1904349670(L_33, L_35, /*hidden argument*/NULL); CapturingGroup_t1439411180 * L_36 = V_5; NullCheck(L_36); int32_t L_37 = CapturingGroup_get_Index_m1539088601(L_36, /*hidden argument*/NULL); int32_t L_38 = V_0; if ((!(((uint32_t)L_37) == ((uint32_t)L_38)))) { goto IL_0102; } } IL_00f9: { int32_t L_39 = V_0; V_0 = ((int32_t)((int32_t)L_39+(int32_t)1)); goto IL_0118; } IL_0102: { CapturingGroup_t1439411180 * L_40 = V_5; NullCheck(L_40); int32_t L_41 = CapturingGroup_get_Index_m1539088601(L_40, /*hidden argument*/NULL); int32_t L_42 = V_0; if ((((int32_t)L_41) <= ((int32_t)L_42))) { goto IL_0118; } } IL_010f: { ArrayList_t2121638921 * L_43 = V_2; CapturingGroup_t1439411180 * L_44 = V_5; NullCheck(L_43); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_43, L_44); } IL_0118: { goto IL_020a; } IL_011d: { CapturingGroup_t1439411180 * L_45 = V_5; NullCheck(L_45); String_t* L_46 = CapturingGroup_get_Name_m1678290617(L_45, /*hidden argument*/NULL); NullCheck(L_46); uint16_t L_47 = String_get_Chars_m3015341861(L_46, 0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_48 = Char_IsDigit_m1743537211(NULL /*static, unused*/, L_47, /*hidden argument*/NULL); if (!L_48) { goto IL_01ac; } } IL_0134: { V_8 = 0; CapturingGroup_t1439411180 * L_49 = V_5; NullCheck(L_49); String_t* L_50 = CapturingGroup_get_Name_m1678290617(L_49, /*hidden argument*/NULL); int32_t L_51 = Parser_ParseDecimal_m3118847812(NULL /*static, unused*/, L_50, (&V_8), /*hidden argument*/NULL); V_9 = L_51; int32_t L_52 = V_8; CapturingGroup_t1439411180 * L_53 = V_5; NullCheck(L_53); String_t* L_54 = CapturingGroup_get_Name_m1678290617(L_53, /*hidden argument*/NULL); NullCheck(L_54); int32_t L_55 = String_get_Length_m2979997331(L_54, /*hidden argument*/NULL); if ((!(((uint32_t)L_52) == ((uint32_t)L_55)))) { goto IL_01ac; } } IL_015a: { CapturingGroup_t1439411180 * L_56 = V_5; int32_t L_57 = V_9; NullCheck(L_56); CapturingGroup_set_Index_m1904349670(L_56, L_57, /*hidden argument*/NULL); Hashtable_t3875263730 * L_58 = V_1; CapturingGroup_t1439411180 * L_59 = V_5; NullCheck(L_59); String_t* L_60 = CapturingGroup_get_Name_m1678290617(L_59, /*hidden argument*/NULL); CapturingGroup_t1439411180 * L_61 = V_5; NullCheck(L_58); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_58, L_60, L_61); int32_t L_62 = __this->get_num_groups_4(); __this->set_num_groups_4(((int32_t)((int32_t)L_62+(int32_t)1))); int32_t L_63 = V_9; int32_t L_64 = V_0; if ((!(((uint32_t)L_63) == ((uint32_t)L_64)))) { goto IL_0191; } } IL_0188: { int32_t L_65 = V_0; V_0 = ((int32_t)((int32_t)L_65+(int32_t)1)); goto IL_01a7; } IL_0191: { ArrayList_t2121638921 * L_66 = V_2; if (L_66) { goto IL_019e; } } IL_0197: { ArrayList_t2121638921 * L_67 = (ArrayList_t2121638921 *)il2cpp_codegen_object_new(ArrayList_t2121638921_il2cpp_TypeInfo_var); ArrayList__ctor_m3809992068(L_67, 4, /*hidden argument*/NULL); V_2 = L_67; } IL_019e: { ArrayList_t2121638921 * L_68 = V_2; CapturingGroup_t1439411180 * L_69 = V_5; NullCheck(L_68); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_68, L_69); } IL_01a7: { goto IL_020a; } IL_01ac: { String_t* L_70 = Int32_ToString_m1286526384((&V_0), /*hidden argument*/NULL); V_10 = L_70; goto IL_01ca; } IL_01ba: { int32_t L_71 = V_0; int32_t L_72 = ((int32_t)((int32_t)L_71+(int32_t)1)); V_0 = L_72; V_17 = L_72; String_t* L_73 = Int32_ToString_m1286526384((&V_17), /*hidden argument*/NULL); V_10 = L_73; } IL_01ca: { Hashtable_t3875263730 * L_74 = V_1; String_t* L_75 = V_10; NullCheck(L_74); bool L_76 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(25 /* System.Boolean System.Collections.Hashtable::Contains(System.Object) */, L_74, L_75); if (L_76) { goto IL_01ba; } } IL_01d7: { Hashtable_t3875263730 * L_77 = V_1; String_t* L_78 = V_10; CapturingGroup_t1439411180 * L_79 = V_5; NullCheck(L_77); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_77, L_78, L_79); Hashtable_t3875263730 * L_80 = V_1; CapturingGroup_t1439411180 * L_81 = V_5; NullCheck(L_81); String_t* L_82 = CapturingGroup_get_Name_m1678290617(L_81, /*hidden argument*/NULL); CapturingGroup_t1439411180 * L_83 = V_5; NullCheck(L_80); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_80, L_82, L_83); CapturingGroup_t1439411180 * L_84 = V_5; int32_t L_85 = V_0; int32_t L_86 = L_85; V_0 = ((int32_t)((int32_t)L_86+(int32_t)1)); NullCheck(L_84); CapturingGroup_set_Index_m1904349670(L_84, L_86, /*hidden argument*/NULL); int32_t L_87 = __this->get_num_groups_4(); __this->set_num_groups_4(((int32_t)((int32_t)L_87+(int32_t)1))); } IL_020a: { Il2CppObject * L_88 = V_6; NullCheck(L_88); bool L_89 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_88); if (L_89) { goto IL_0099; } } IL_0216: { IL2CPP_LEAVE(0x231, FINALLY_021b); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_021b; } FINALLY_021b: { // begin finally (depth: 1) { Il2CppObject * L_90 = V_6; V_18 = ((Il2CppObject *)IsInst(L_90, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_91 = V_18; if (L_91) { goto IL_0229; } } IL_0228: { IL2CPP_END_FINALLY(539) } IL_0229: { Il2CppObject * L_92 = V_18; NullCheck(L_92); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_92); IL2CPP_END_FINALLY(539) } } // end finally (depth: 1) IL2CPP_CLEANUP(539) { IL2CPP_JUMP_TBL(0x231, IL_0231) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0231: { int32_t L_93 = V_0; __this->set_gap_5(L_93); ArrayList_t2121638921 * L_94 = V_2; if (!L_94) { goto IL_0245; } } { ArrayList_t2121638921 * L_95 = V_2; Parser_HandleExplicitNumericGroups_m2933059971(__this, L_95, /*hidden argument*/NULL); } IL_0245: { Hashtable_t3875263730 * L_96 = __this->get_refs_3(); NullCheck(L_96); Il2CppObject * L_97 = VirtFuncInvoker0< Il2CppObject * >::Invoke(18 /* System.Collections.ICollection System.Collections.Hashtable::get_Keys() */, L_96); NullCheck(L_97); Il2CppObject * L_98 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Collections.IEnumerator System.Collections.IEnumerable::GetEnumerator() */, IEnumerable_t287189635_il2cpp_TypeInfo_var, L_97); V_12 = L_98; } IL_0257: try { // begin try (depth: 1) { goto IL_036d; } IL_025c: { Il2CppObject * L_99 = V_12; NullCheck(L_99); Il2CppObject * L_100 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_99); V_11 = ((Expression_t1499093192 *)CastclassClass(L_100, Expression_t1499093192_il2cpp_TypeInfo_var)); Hashtable_t3875263730 * L_101 = __this->get_refs_3(); Expression_t1499093192 * L_102 = V_11; NullCheck(L_101); Il2CppObject * L_103 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_101, L_102); V_13 = ((String_t*)CastclassSealed(L_103, String_t_il2cpp_TypeInfo_var)); Hashtable_t3875263730 * L_104 = V_1; String_t* L_105 = V_13; NullCheck(L_104); bool L_106 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(25 /* System.Boolean System.Collections.Hashtable::Contains(System.Object) */, L_104, L_105); if (L_106) { goto IL_0306; } } IL_028b: { Expression_t1499093192 * L_107 = V_11; if (!((CaptureAssertion_t1074818188 *)IsInstClass(L_107, CaptureAssertion_t1074818188_il2cpp_TypeInfo_var))) { goto IL_02ae; } } IL_0297: { String_t* L_108 = V_13; NullCheck(L_108); uint16_t L_109 = String_get_Chars_m3015341861(L_108, 0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_110 = Char_IsDigit_m1743537211(NULL /*static, unused*/, L_109, /*hidden argument*/NULL); if (L_110) { goto IL_02ae; } } IL_02a9: { goto IL_036d; } IL_02ae: { Expression_t1499093192 * L_111 = V_11; V_14 = ((BackslashNumber_t1411804623 *)IsInstClass(L_111, BackslashNumber_t1411804623_il2cpp_TypeInfo_var)); BackslashNumber_t1411804623 * L_112 = V_14; if (!L_112) { goto IL_02d2; } } IL_02be: { BackslashNumber_t1411804623 * L_113 = V_14; String_t* L_114 = V_13; Hashtable_t3875263730 * L_115 = V_1; NullCheck(L_113); bool L_116 = BackslashNumber_ResolveReference_m705827744(L_113, L_114, L_115, /*hidden argument*/NULL); if (!L_116) { goto IL_02d2; } } IL_02cd: { goto IL_036d; } IL_02d2: { String_t* L_117 = V_13; NullCheck(L_117); uint16_t L_118 = String_get_Chars_m3015341861(L_117, 0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_119 = Char_IsDigit_m1743537211(NULL /*static, unused*/, L_118, /*hidden argument*/NULL); G_B49_0 = _stringLiteral4142515425; G_B49_1 = __this; if (!L_119) { G_B50_0 = _stringLiteral4142515425; G_B50_1 = __this; goto IL_02f4; } } IL_02ea: { G_B51_0 = _stringLiteral2294451703; G_B51_1 = G_B49_0; G_B51_2 = G_B49_1; goto IL_02f9; } IL_02f4: { G_B51_0 = _stringLiteral104584949; G_B51_1 = G_B50_0; G_B51_2 = G_B50_1; } IL_02f9: { String_t* L_120 = V_13; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_121 = String_Concat_m1825781833(NULL /*static, unused*/, G_B51_1, G_B51_0, L_120, /*hidden argument*/NULL); NullCheck(G_B51_2); ArgumentException_t124305799 * L_122 = Parser_NewParseException_m3475856021(G_B51_2, L_121, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_122); } IL_0306: { Hashtable_t3875263730 * L_123 = V_1; String_t* L_124 = V_13; NullCheck(L_123); Il2CppObject * L_125 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_123, L_124); V_15 = ((CapturingGroup_t1439411180 *)CastclassClass(L_125, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); Expression_t1499093192 * L_126 = V_11; if (!((Reference_t2379893051 *)IsInstClass(L_126, Reference_t2379893051_il2cpp_TypeInfo_var))) { goto IL_0334; } } IL_0321: { Expression_t1499093192 * L_127 = V_11; CapturingGroup_t1439411180 * L_128 = V_15; NullCheck(((Reference_t2379893051 *)CastclassClass(L_127, Reference_t2379893051_il2cpp_TypeInfo_var))); Reference_set_CapturingGroup_m716261254(((Reference_t2379893051 *)CastclassClass(L_127, Reference_t2379893051_il2cpp_TypeInfo_var)), L_128, /*hidden argument*/NULL); goto IL_036d; } IL_0334: { Expression_t1499093192 * L_129 = V_11; if (!((CaptureAssertion_t1074818188 *)IsInstClass(L_129, CaptureAssertion_t1074818188_il2cpp_TypeInfo_var))) { goto IL_0353; } } IL_0340: { Expression_t1499093192 * L_130 = V_11; CapturingGroup_t1439411180 * L_131 = V_15; NullCheck(((CaptureAssertion_t1074818188 *)CastclassClass(L_130, CaptureAssertion_t1074818188_il2cpp_TypeInfo_var))); CaptureAssertion_set_CapturingGroup_m1020834945(((CaptureAssertion_t1074818188 *)CastclassClass(L_130, CaptureAssertion_t1074818188_il2cpp_TypeInfo_var)), L_131, /*hidden argument*/NULL); goto IL_036d; } IL_0353: { Expression_t1499093192 * L_132 = V_11; if (!((BalancingGroup_t3928584086 *)IsInstClass(L_132, BalancingGroup_t3928584086_il2cpp_TypeInfo_var))) { goto IL_036d; } } IL_035f: { Expression_t1499093192 * L_133 = V_11; CapturingGroup_t1439411180 * L_134 = V_15; NullCheck(((BalancingGroup_t3928584086 *)CastclassClass(L_133, BalancingGroup_t3928584086_il2cpp_TypeInfo_var))); BalancingGroup_set_Balance_m1819477787(((BalancingGroup_t3928584086 *)CastclassClass(L_133, BalancingGroup_t3928584086_il2cpp_TypeInfo_var)), L_134, /*hidden argument*/NULL); } IL_036d: { Il2CppObject * L_135 = V_12; NullCheck(L_135); bool L_136 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_135); if (L_136) { goto IL_025c; } } IL_0379: { IL2CPP_LEAVE(0x394, FINALLY_037e); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_037e; } FINALLY_037e: { // begin finally (depth: 1) { Il2CppObject * L_137 = V_12; V_19 = ((Il2CppObject *)IsInst(L_137, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_138 = V_19; if (L_138) { goto IL_038c; } } IL_038b: { IL2CPP_END_FINALLY(894) } IL_038c: { Il2CppObject * L_139 = V_19; NullCheck(L_139); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_139); IL2CPP_END_FINALLY(894) } } // end finally (depth: 1) IL2CPP_CLEANUP(894) { IL2CPP_JUMP_TBL(0x394, IL_0394) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0394: { return; } } // System.Void System.Text.RegularExpressions.Syntax.Parser::HandleExplicitNumericGroups(System.Collections.ArrayList) extern Il2CppClass* CapturingGroup_t1439411180_il2cpp_TypeInfo_var; extern const uint32_t Parser_HandleExplicitNumericGroups_m2933059971_MetadataUsageId; extern "C" void Parser_HandleExplicitNumericGroups_m2933059971 (Parser_t3684504143 * __this, ArrayList_t2121638921 * ___explicit_numeric_groups0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_HandleExplicitNumericGroups_m2933059971_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; CapturingGroup_t1439411180 * V_3 = NULL; int32_t V_4 = 0; CapturingGroup_t1439411180 * V_5 = NULL; { int32_t L_0 = __this->get_gap_5(); V_0 = L_0; V_1 = 0; ArrayList_t2121638921 * L_1 = ___explicit_numeric_groups0; NullCheck(L_1); int32_t L_2 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_1); V_2 = L_2; ArrayList_t2121638921 * L_3 = ___explicit_numeric_groups0; NullCheck(L_3); VirtActionInvoker0::Invoke(41 /* System.Void System.Collections.ArrayList::Sort() */, L_3); goto IL_004d; } IL_001b: { ArrayList_t2121638921 * L_4 = ___explicit_numeric_groups0; int32_t L_5 = V_1; NullCheck(L_4); Il2CppObject * L_6 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_4, L_5); V_3 = ((CapturingGroup_t1439411180 *)CastclassClass(L_6, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); CapturingGroup_t1439411180 * L_7 = V_3; NullCheck(L_7); int32_t L_8 = CapturingGroup_get_Index_m1539088601(L_7, /*hidden argument*/NULL); int32_t L_9 = V_0; if ((((int32_t)L_8) <= ((int32_t)L_9))) { goto IL_0039; } } { goto IL_0054; } IL_0039: { CapturingGroup_t1439411180 * L_10 = V_3; NullCheck(L_10); int32_t L_11 = CapturingGroup_get_Index_m1539088601(L_10, /*hidden argument*/NULL); int32_t L_12 = V_0; if ((!(((uint32_t)L_11) == ((uint32_t)L_12)))) { goto IL_0049; } } { int32_t L_13 = V_0; V_0 = ((int32_t)((int32_t)L_13+(int32_t)1)); } IL_0049: { int32_t L_14 = V_1; V_1 = ((int32_t)((int32_t)L_14+(int32_t)1)); } IL_004d: { int32_t L_15 = V_1; int32_t L_16 = V_2; if ((((int32_t)L_15) < ((int32_t)L_16))) { goto IL_001b; } } IL_0054: { int32_t L_17 = V_0; __this->set_gap_5(L_17); int32_t L_18 = V_0; V_4 = L_18; goto IL_00a7; } IL_0063: { ArrayList_t2121638921 * L_19 = ___explicit_numeric_groups0; int32_t L_20 = V_1; NullCheck(L_19); Il2CppObject * L_21 = VirtFuncInvoker1< Il2CppObject *, int32_t >::Invoke(18 /* System.Object System.Collections.ArrayList::get_Item(System.Int32) */, L_19, L_20); V_5 = ((CapturingGroup_t1439411180 *)CastclassClass(L_21, CapturingGroup_t1439411180_il2cpp_TypeInfo_var)); CapturingGroup_t1439411180 * L_22 = V_5; NullCheck(L_22); int32_t L_23 = CapturingGroup_get_Index_m1539088601(L_22, /*hidden argument*/NULL); int32_t L_24 = V_4; if ((!(((uint32_t)L_23) == ((uint32_t)L_24)))) { goto IL_008e; } } { CapturingGroup_t1439411180 * L_25 = V_5; int32_t L_26 = V_0; NullCheck(L_25); CapturingGroup_set_Index_m1904349670(L_25, ((int32_t)((int32_t)L_26-(int32_t)1)), /*hidden argument*/NULL); goto IL_00a3; } IL_008e: { CapturingGroup_t1439411180 * L_27 = V_5; NullCheck(L_27); int32_t L_28 = CapturingGroup_get_Index_m1539088601(L_27, /*hidden argument*/NULL); V_4 = L_28; CapturingGroup_t1439411180 * L_29 = V_5; int32_t L_30 = V_0; int32_t L_31 = L_30; V_0 = ((int32_t)((int32_t)L_31+(int32_t)1)); NullCheck(L_29); CapturingGroup_set_Index_m1904349670(L_29, L_31, /*hidden argument*/NULL); } IL_00a3: { int32_t L_32 = V_1; V_1 = ((int32_t)((int32_t)L_32+(int32_t)1)); } IL_00a7: { int32_t L_33 = V_1; int32_t L_34 = V_2; if ((((int32_t)L_33) < ((int32_t)L_34))) { goto IL_0063; } } { return; } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsIgnoreCase(System.Text.RegularExpressions.RegexOptions) extern "C" bool Parser_IsIgnoreCase_m3077668423 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { { int32_t L_0 = ___options0; return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)1))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsMultiline(System.Text.RegularExpressions.RegexOptions) extern "C" bool Parser_IsMultiline_m1332832164 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { { int32_t L_0 = ___options0; return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)2))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsExplicitCapture(System.Text.RegularExpressions.RegexOptions) extern "C" bool Parser_IsExplicitCapture_m2152082175 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { { int32_t L_0 = ___options0; return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)4))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsSingleline(System.Text.RegularExpressions.RegexOptions) extern "C" bool Parser_IsSingleline_m4108862573 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { { int32_t L_0 = ___options0; return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)((int32_t)16)))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsIgnorePatternWhitespace(System.Text.RegularExpressions.RegexOptions) extern "C" bool Parser_IsIgnorePatternWhitespace_m4039716246 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { { int32_t L_0 = ___options0; return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)((int32_t)32)))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Text.RegularExpressions.Syntax.Parser::IsECMAScript(System.Text.RegularExpressions.RegexOptions) extern "C" bool Parser_IsECMAScript_m432342092 (Il2CppObject * __this /* static, unused */, int32_t ___options0, const MethodInfo* method) { { int32_t L_0 = ___options0; return (bool)((((int32_t)((((int32_t)((int32_t)((int32_t)L_0&(int32_t)((int32_t)256)))) == ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.ArgumentException System.Text.RegularExpressions.Syntax.Parser::NewParseException(System.String) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* ArgumentException_t124305799_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2466344626; extern Il2CppCodeGenString* _stringLiteral1045073; extern const uint32_t Parser_NewParseException_m3475856021_MetadataUsageId; extern "C" ArgumentException_t124305799 * Parser_NewParseException_m3475856021 (Parser_t3684504143 * __this, String_t* ___msg0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Parser_NewParseException_m3475856021_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = __this->get_pattern_0(); String_t* L_1 = ___msg0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_2 = String_Concat_m2933632197(NULL /*static, unused*/, _stringLiteral2466344626, L_0, _stringLiteral1045073, L_1, /*hidden argument*/NULL); ___msg0 = L_2; String_t* L_3 = ___msg0; String_t* L_4 = __this->get_pattern_0(); ArgumentException_t124305799 * L_5 = (ArgumentException_t124305799 *)il2cpp_codegen_object_new(ArgumentException_t124305799_il2cpp_TypeInfo_var); ArgumentException__ctor_m732321503(L_5, L_3, L_4, /*hidden argument*/NULL); return L_5; } } // System.Void System.Text.RegularExpressions.Syntax.PositionAssertion::.ctor(System.Text.RegularExpressions.Position) extern "C" void PositionAssertion__ctor_m2712509165 (PositionAssertion_t3660056009 * __this, uint16_t ___pos0, const MethodInfo* method) { { Expression__ctor_m89241894(__this, /*hidden argument*/NULL); uint16_t L_0 = ___pos0; __this->set_pos_0(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.PositionAssertion::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t PositionAssertion_Compile_m2491919992_MetadataUsageId; extern "C" void PositionAssertion_Compile_m2491919992 (PositionAssertion_t3660056009 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PositionAssertion_Compile_m2491919992_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = ___cmp0; uint16_t L_1 = __this->get_pos_0(); NullCheck(L_0); InterfaceActionInvoker1< uint16_t >::Invoke(9 /* System.Void System.Text.RegularExpressions.ICompiler::EmitPosition(System.Text.RegularExpressions.Position) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0, L_1); return; } } // System.Void System.Text.RegularExpressions.Syntax.PositionAssertion::GetWidth(System.Int32&,System.Int32&) extern "C" void PositionAssertion_GetWidth_m4112110283 (PositionAssertion_t3660056009 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { int32_t V_0 = 0; { int32_t* L_0 = ___min0; int32_t* L_1 = ___max1; int32_t L_2 = 0; V_0 = L_2; *((int32_t*)(L_1)) = (int32_t)L_2; int32_t L_3 = V_0; *((int32_t*)(L_0)) = (int32_t)L_3; return; } } // System.Boolean System.Text.RegularExpressions.Syntax.PositionAssertion::IsComplex() extern "C" bool PositionAssertion_IsComplex_m2141947785 (PositionAssertion_t3660056009 * __this, const MethodInfo* method) { { return (bool)0; } } // System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.PositionAssertion::GetAnchorInfo(System.Boolean) extern Il2CppClass* AnchorInfo_t1997143859_il2cpp_TypeInfo_var; extern const uint32_t PositionAssertion_GetAnchorInfo_m3911354203_MetadataUsageId; extern "C" AnchorInfo_t1997143859 * PositionAssertion_GetAnchorInfo_m3911354203 (PositionAssertion_t3660056009 * __this, bool ___revers0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (PositionAssertion_GetAnchorInfo_m3911354203_MetadataUsageId); s_Il2CppMethodIntialized = true; } uint16_t V_0 = 0; { uint16_t L_0 = __this->get_pos_0(); V_0 = L_0; uint16_t L_1 = V_0; if (((int32_t)((int32_t)L_1-(int32_t)2)) == 0) { goto IL_0020; } if (((int32_t)((int32_t)L_1-(int32_t)2)) == 1) { goto IL_0020; } if (((int32_t)((int32_t)L_1-(int32_t)2)) == 2) { goto IL_0020; } } { goto IL_002f; } IL_0020: { uint16_t L_2 = __this->get_pos_0(); AnchorInfo_t1997143859 * L_3 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m3146766459(L_3, __this, 0, 0, L_2, /*hidden argument*/NULL); return L_3; } IL_002f: { AnchorInfo_t1997143859 * L_4 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m774944594(L_4, __this, 0, /*hidden argument*/NULL); return L_4; } } // System.Void System.Text.RegularExpressions.Syntax.Reference::.ctor(System.Boolean) extern "C" void Reference__ctor_m425097396 (Reference_t2379893051 * __this, bool ___ignore0, const MethodInfo* method) { { Expression__ctor_m89241894(__this, /*hidden argument*/NULL); bool L_0 = ___ignore0; __this->set_ignore_1(L_0); return; } } // System.Text.RegularExpressions.Syntax.CapturingGroup System.Text.RegularExpressions.Syntax.Reference::get_CapturingGroup() extern "C" CapturingGroup_t1439411180 * Reference_get_CapturingGroup_m2373399431 (Reference_t2379893051 * __this, const MethodInfo* method) { { CapturingGroup_t1439411180 * L_0 = __this->get_group_0(); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.Reference::set_CapturingGroup(System.Text.RegularExpressions.Syntax.CapturingGroup) extern "C" void Reference_set_CapturingGroup_m716261254 (Reference_t2379893051 * __this, CapturingGroup_t1439411180 * ___value0, const MethodInfo* method) { { CapturingGroup_t1439411180 * L_0 = ___value0; __this->set_group_0(L_0); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.Reference::get_IgnoreCase() extern "C" bool Reference_get_IgnoreCase_m1035334716 (Reference_t2379893051 * __this, const MethodInfo* method) { { bool L_0 = __this->get_ignore_1(); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.Reference::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t Reference_Compile_m2087049322_MetadataUsageId; extern "C" void Reference_Compile_m2087049322 (Reference_t2379893051 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Reference_Compile_m2087049322_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = ___cmp0; CapturingGroup_t1439411180 * L_1 = __this->get_group_0(); NullCheck(L_1); int32_t L_2 = CapturingGroup_get_Index_m1539088601(L_1, /*hidden argument*/NULL); bool L_3 = __this->get_ignore_1(); bool L_4 = ___reverse1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, bool, bool >::Invoke(14 /* System.Void System.Text.RegularExpressions.ICompiler::EmitReference(System.Int32,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0, L_2, L_3, L_4); return; } } // System.Void System.Text.RegularExpressions.Syntax.Reference::GetWidth(System.Int32&,System.Int32&) extern "C" void Reference_GetWidth_m2365245465 (Reference_t2379893051 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { { int32_t* L_0 = ___min0; *((int32_t*)(L_0)) = (int32_t)0; int32_t* L_1 = ___max1; *((int32_t*)(L_1)) = (int32_t)((int32_t)2147483647LL); return; } } // System.Boolean System.Text.RegularExpressions.Syntax.Reference::IsComplex() extern "C" bool Reference_IsComplex_m868186199 (Reference_t2379893051 * __this, const MethodInfo* method) { { return (bool)1; } } // System.Void System.Text.RegularExpressions.Syntax.RegularExpression::.ctor() extern "C" void RegularExpression__ctor_m365120276 (RegularExpression_t1734534468 * __this, const MethodInfo* method) { { Group__ctor_m358391753(__this, /*hidden argument*/NULL); __this->set_group_count_1(0); return; } } // System.Void System.Text.RegularExpressions.Syntax.RegularExpression::set_GroupCount(System.Int32) extern "C" void RegularExpression_set_GroupCount_m508599630 (RegularExpression_t1734534468 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_group_count_1(L_0); return; } } // System.Void System.Text.RegularExpressions.Syntax.RegularExpression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t RegularExpression_Compile_m201671475_MetadataUsageId; extern "C" void RegularExpression_Compile_m201671475 (RegularExpression_t1734534468 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (RegularExpression_Compile_m201671475_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; AnchorInfo_t1997143859 * V_2 = NULL; LinkRef_t1270295572 * V_3 = NULL; { VirtActionInvoker2< int32_t*, int32_t* >::Invoke(5 /* System.Void System.Text.RegularExpressions.Syntax.Group::GetWidth(System.Int32&,System.Int32&) */, __this, (&V_0), (&V_1)); Il2CppObject * L_0 = ___cmp0; int32_t L_1 = __this->get_group_count_1(); int32_t L_2 = V_0; int32_t L_3 = V_1; NullCheck(L_0); InterfaceActionInvoker3< int32_t, int32_t, int32_t >::Invoke(23 /* System.Void System.Text.RegularExpressions.ICompiler::EmitInfo(System.Int32,System.Int32,System.Int32) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_0, L_1, L_2, L_3); bool L_4 = ___reverse1; AnchorInfo_t1997143859 * L_5 = VirtFuncInvoker1< AnchorInfo_t1997143859 *, bool >::Invoke(6 /* System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Group::GetAnchorInfo(System.Boolean) */, __this, L_4); V_2 = L_5; Il2CppObject * L_6 = ___cmp0; NullCheck(L_6); LinkRef_t1270295572 * L_7 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_6); V_3 = L_7; Il2CppObject * L_8 = ___cmp0; bool L_9 = ___reverse1; AnchorInfo_t1997143859 * L_10 = V_2; NullCheck(L_10); int32_t L_11 = AnchorInfo_get_Offset_m110301077(L_10, /*hidden argument*/NULL); LinkRef_t1270295572 * L_12 = V_3; NullCheck(L_8); InterfaceActionInvoker3< bool, int32_t, LinkRef_t1270295572 * >::Invoke(25 /* System.Void System.Text.RegularExpressions.ICompiler::EmitAnchor(System.Boolean,System.Int32,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_8, L_9, L_11, L_12); AnchorInfo_t1997143859 * L_13 = V_2; NullCheck(L_13); bool L_14 = AnchorInfo_get_IsPosition_m467864027(L_13, /*hidden argument*/NULL); if (!L_14) { goto IL_0051; } } { Il2CppObject * L_15 = ___cmp0; AnchorInfo_t1997143859 * L_16 = V_2; NullCheck(L_16); uint16_t L_17 = AnchorInfo_get_Position_m1033547864(L_16, /*hidden argument*/NULL); NullCheck(L_15); InterfaceActionInvoker1< uint16_t >::Invoke(9 /* System.Void System.Text.RegularExpressions.ICompiler::EmitPosition(System.Text.RegularExpressions.Position) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_15, L_17); goto IL_006f; } IL_0051: { AnchorInfo_t1997143859 * L_18 = V_2; NullCheck(L_18); bool L_19 = AnchorInfo_get_IsSubstring_m506285889(L_18, /*hidden argument*/NULL); if (!L_19) { goto IL_006f; } } { Il2CppObject * L_20 = ___cmp0; AnchorInfo_t1997143859 * L_21 = V_2; NullCheck(L_21); String_t* L_22 = AnchorInfo_get_Substring_m1320966366(L_21, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_23 = V_2; NullCheck(L_23); bool L_24 = AnchorInfo_get_IgnoreCase_m843009482(L_23, /*hidden argument*/NULL); bool L_25 = ___reverse1; NullCheck(L_20); InterfaceActionInvoker3< String_t*, bool, bool >::Invoke(8 /* System.Void System.Text.RegularExpressions.ICompiler::EmitString(System.String,System.Boolean,System.Boolean) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_20, L_22, L_24, L_25); } IL_006f: { Il2CppObject * L_26 = ___cmp0; NullCheck(L_26); InterfaceActionInvoker0::Invoke(2 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTrue() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_26); Il2CppObject * L_27 = ___cmp0; LinkRef_t1270295572 * L_28 = V_3; NullCheck(L_27); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_27, L_28); Il2CppObject * L_29 = ___cmp0; bool L_30 = ___reverse1; Group_Compile_m767805470(__this, L_29, L_30, /*hidden argument*/NULL); Il2CppObject * L_31 = ___cmp0; NullCheck(L_31); InterfaceActionInvoker0::Invoke(2 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTrue() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_31); return; } } // System.Void System.Text.RegularExpressions.Syntax.Repetition::.ctor(System.Int32,System.Int32,System.Boolean) extern "C" void Repetition__ctor_m4270514692 (Repetition_t693899937 * __this, int32_t ___min0, int32_t ___max1, bool ___lazy2, const MethodInfo* method) { { CompositeExpression__ctor_m839662857(__this, /*hidden argument*/NULL); ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); ExpressionCollection_Add_m3422413233(L_0, (Expression_t1499093192 *)NULL, /*hidden argument*/NULL); int32_t L_1 = ___min0; __this->set_min_1(L_1); int32_t L_2 = ___max1; __this->set_max_2(L_2); bool L_3 = ___lazy2; __this->set_lazy_3(L_3); return; } } // System.Text.RegularExpressions.Syntax.Expression System.Text.RegularExpressions.Syntax.Repetition::get_Expression() extern "C" Expression_t1499093192 * Repetition_get_Expression_m2567702849 (Repetition_t693899937 * __this, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); NullCheck(L_0); Expression_t1499093192 * L_1 = ExpressionCollection_get_Item_m3558752946(L_0, 0, /*hidden argument*/NULL); return L_1; } } // System.Void System.Text.RegularExpressions.Syntax.Repetition::set_Expression(System.Text.RegularExpressions.Syntax.Expression) extern "C" void Repetition_set_Expression_m3471937174 (Repetition_t693899937 * __this, Expression_t1499093192 * ___value0, const MethodInfo* method) { { ExpressionCollection_t357621126 * L_0 = CompositeExpression_get_Expressions_m2158932996(__this, /*hidden argument*/NULL); Expression_t1499093192 * L_1 = ___value0; NullCheck(L_0); ExpressionCollection_set_Item_m3407994931(L_0, 0, L_1, /*hidden argument*/NULL); return; } } // System.Int32 System.Text.RegularExpressions.Syntax.Repetition::get_Minimum() extern "C" int32_t Repetition_get_Minimum_m1360004544 (Repetition_t693899937 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_min_1(); return L_0; } } // System.Void System.Text.RegularExpressions.Syntax.Repetition::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) extern Il2CppClass* ICompiler_t93500931_il2cpp_TypeInfo_var; extern const uint32_t Repetition_Compile_m4261647610_MetadataUsageId; extern "C" void Repetition_Compile_m4261647610 (Repetition_t693899937 * __this, Il2CppObject * ___cmp0, bool ___reverse1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Repetition_Compile_m4261647610_MetadataUsageId); s_Il2CppMethodIntialized = true; } LinkRef_t1270295572 * V_0 = NULL; LinkRef_t1270295572 * V_1 = NULL; { Expression_t1499093192 * L_0 = Repetition_get_Expression_m2567702849(__this, /*hidden argument*/NULL); NullCheck(L_0); bool L_1 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean System.Text.RegularExpressions.Syntax.Expression::IsComplex() */, L_0); if (!L_1) { goto IL_0049; } } { Il2CppObject * L_2 = ___cmp0; NullCheck(L_2); LinkRef_t1270295572 * L_3 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_2); V_0 = L_3; Il2CppObject * L_4 = ___cmp0; int32_t L_5 = __this->get_min_1(); int32_t L_6 = __this->get_max_2(); bool L_7 = __this->get_lazy_3(); LinkRef_t1270295572 * L_8 = V_0; NullCheck(L_4); InterfaceActionInvoker4< int32_t, int32_t, bool, LinkRef_t1270295572 * >::Invoke(20 /* System.Void System.Text.RegularExpressions.ICompiler::EmitRepeat(System.Int32,System.Int32,System.Boolean,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_4, L_5, L_6, L_7, L_8); Expression_t1499093192 * L_9 = Repetition_get_Expression_m2567702849(__this, /*hidden argument*/NULL); Il2CppObject * L_10 = ___cmp0; bool L_11 = ___reverse1; NullCheck(L_9); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_9, L_10, L_11); Il2CppObject * L_12 = ___cmp0; LinkRef_t1270295572 * L_13 = V_0; NullCheck(L_12); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(21 /* System.Void System.Text.RegularExpressions.ICompiler::EmitUntil(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_12, L_13); goto IL_0083; } IL_0049: { Il2CppObject * L_14 = ___cmp0; NullCheck(L_14); LinkRef_t1270295572 * L_15 = InterfaceFuncInvoker0< LinkRef_t1270295572 * >::Invoke(28 /* System.Text.RegularExpressions.LinkRef System.Text.RegularExpressions.ICompiler::NewLink() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_14); V_1 = L_15; Il2CppObject * L_16 = ___cmp0; int32_t L_17 = __this->get_min_1(); int32_t L_18 = __this->get_max_2(); bool L_19 = __this->get_lazy_3(); LinkRef_t1270295572 * L_20 = V_1; NullCheck(L_16); InterfaceActionInvoker4< int32_t, int32_t, bool, LinkRef_t1270295572 * >::Invoke(24 /* System.Void System.Text.RegularExpressions.ICompiler::EmitFastRepeat(System.Int32,System.Int32,System.Boolean,System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_16, L_17, L_18, L_19, L_20); Expression_t1499093192 * L_21 = Repetition_get_Expression_m2567702849(__this, /*hidden argument*/NULL); Il2CppObject * L_22 = ___cmp0; bool L_23 = ___reverse1; NullCheck(L_21); VirtActionInvoker2< Il2CppObject *, bool >::Invoke(4 /* System.Void System.Text.RegularExpressions.Syntax.Expression::Compile(System.Text.RegularExpressions.ICompiler,System.Boolean) */, L_21, L_22, L_23); Il2CppObject * L_24 = ___cmp0; NullCheck(L_24); InterfaceActionInvoker0::Invoke(2 /* System.Void System.Text.RegularExpressions.ICompiler::EmitTrue() */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_24); Il2CppObject * L_25 = ___cmp0; LinkRef_t1270295572 * L_26 = V_1; NullCheck(L_25); InterfaceActionInvoker1< LinkRef_t1270295572 * >::Invoke(29 /* System.Void System.Text.RegularExpressions.ICompiler::ResolveLink(System.Text.RegularExpressions.LinkRef) */, ICompiler_t93500931_il2cpp_TypeInfo_var, L_25, L_26); } IL_0083: { return; } } // System.Void System.Text.RegularExpressions.Syntax.Repetition::GetWidth(System.Int32&,System.Int32&) extern "C" void Repetition_GetWidth_m681452937 (Repetition_t693899937 * __this, int32_t* ___min0, int32_t* ___max1, const MethodInfo* method) { { Expression_t1499093192 * L_0 = Repetition_get_Expression_m2567702849(__this, /*hidden argument*/NULL); int32_t* L_1 = ___min0; int32_t* L_2 = ___max1; NullCheck(L_0); VirtActionInvoker2< int32_t*, int32_t* >::Invoke(5 /* System.Void System.Text.RegularExpressions.Syntax.Expression::GetWidth(System.Int32&,System.Int32&) */, L_0, L_1, L_2); int32_t* L_3 = ___min0; int32_t* L_4 = ___min0; int32_t L_5 = __this->get_min_1(); *((int32_t*)(L_3)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_4))*(int32_t)L_5)); int32_t* L_6 = ___max1; if ((((int32_t)(*((int32_t*)L_6))) == ((int32_t)((int32_t)2147483647LL)))) { goto IL_0034; } } { int32_t L_7 = __this->get_max_2(); if ((!(((uint32_t)L_7) == ((uint32_t)((int32_t)65535))))) { goto IL_0040; } } IL_0034: { int32_t* L_8 = ___max1; *((int32_t*)(L_8)) = (int32_t)((int32_t)2147483647LL); goto IL_004b; } IL_0040: { int32_t* L_9 = ___max1; int32_t* L_10 = ___max1; int32_t L_11 = __this->get_max_2(); *((int32_t*)(L_9)) = (int32_t)((int32_t)((int32_t)(*((int32_t*)L_10))*(int32_t)L_11)); } IL_004b: { return; } } // System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Repetition::GetAnchorInfo(System.Boolean) extern Il2CppClass* AnchorInfo_t1997143859_il2cpp_TypeInfo_var; extern Il2CppClass* StringBuilder_t3822575854_il2cpp_TypeInfo_var; extern const uint32_t Repetition_GetAnchorInfo_m337026333_MetadataUsageId; extern "C" AnchorInfo_t1997143859 * Repetition_GetAnchorInfo_m337026333 (Repetition_t693899937 * __this, bool ___reverse0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Repetition_GetAnchorInfo_m337026333_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; AnchorInfo_t1997143859 * V_1 = NULL; String_t* V_2 = NULL; StringBuilder_t3822575854 * V_3 = NULL; int32_t V_4 = 0; { int32_t L_0 = Expression_GetFixedWidth_m3994281404(__this, /*hidden argument*/NULL); V_0 = L_0; int32_t L_1 = Repetition_get_Minimum_m1360004544(__this, /*hidden argument*/NULL); if (L_1) { goto IL_001a; } } { int32_t L_2 = V_0; AnchorInfo_t1997143859 * L_3 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m774944594(L_3, __this, L_2, /*hidden argument*/NULL); return L_3; } IL_001a: { Expression_t1499093192 * L_4 = Repetition_get_Expression_m2567702849(__this, /*hidden argument*/NULL); bool L_5 = ___reverse0; NullCheck(L_4); AnchorInfo_t1997143859 * L_6 = VirtFuncInvoker1< AnchorInfo_t1997143859 *, bool >::Invoke(6 /* System.Text.RegularExpressions.Syntax.AnchorInfo System.Text.RegularExpressions.Syntax.Expression::GetAnchorInfo(System.Boolean) */, L_4, L_5); V_1 = L_6; AnchorInfo_t1997143859 * L_7 = V_1; NullCheck(L_7); bool L_8 = AnchorInfo_get_IsPosition_m467864027(L_7, /*hidden argument*/NULL); if (!L_8) { goto IL_0046; } } { AnchorInfo_t1997143859 * L_9 = V_1; NullCheck(L_9); int32_t L_10 = AnchorInfo_get_Offset_m110301077(L_9, /*hidden argument*/NULL); int32_t L_11 = V_0; AnchorInfo_t1997143859 * L_12 = V_1; NullCheck(L_12); uint16_t L_13 = AnchorInfo_get_Position_m1033547864(L_12, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_14 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m3146766459(L_14, __this, L_10, L_11, L_13, /*hidden argument*/NULL); return L_14; } IL_0046: { AnchorInfo_t1997143859 * L_15 = V_1; NullCheck(L_15); bool L_16 = AnchorInfo_get_IsSubstring_m506285889(L_15, /*hidden argument*/NULL); if (!L_16) { goto IL_00bc; } } { AnchorInfo_t1997143859 * L_17 = V_1; NullCheck(L_17); bool L_18 = AnchorInfo_get_IsComplete_m2840583659(L_17, /*hidden argument*/NULL); if (!L_18) { goto IL_00a2; } } { AnchorInfo_t1997143859 * L_19 = V_1; NullCheck(L_19); String_t* L_20 = AnchorInfo_get_Substring_m1320966366(L_19, /*hidden argument*/NULL); V_2 = L_20; String_t* L_21 = V_2; StringBuilder_t3822575854 * L_22 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m1143895062(L_22, L_21, /*hidden argument*/NULL); V_3 = L_22; V_4 = 1; goto IL_0080; } IL_0072: { StringBuilder_t3822575854 * L_23 = V_3; String_t* L_24 = V_2; NullCheck(L_23); StringBuilder_Append_m3898090075(L_23, L_24, /*hidden argument*/NULL); int32_t L_25 = V_4; V_4 = ((int32_t)((int32_t)L_25+(int32_t)1)); } IL_0080: { int32_t L_26 = V_4; int32_t L_27 = Repetition_get_Minimum_m1360004544(__this, /*hidden argument*/NULL); if ((((int32_t)L_26) < ((int32_t)L_27))) { goto IL_0072; } } { int32_t L_28 = V_0; StringBuilder_t3822575854 * L_29 = V_3; NullCheck(L_29); String_t* L_30 = StringBuilder_ToString_m350379841(L_29, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_31 = V_1; NullCheck(L_31); bool L_32 = AnchorInfo_get_IgnoreCase_m843009482(L_31, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_33 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m2237276956(L_33, __this, 0, L_28, L_30, L_32, /*hidden argument*/NULL); return L_33; } IL_00a2: { AnchorInfo_t1997143859 * L_34 = V_1; NullCheck(L_34); int32_t L_35 = AnchorInfo_get_Offset_m110301077(L_34, /*hidden argument*/NULL); int32_t L_36 = V_0; AnchorInfo_t1997143859 * L_37 = V_1; NullCheck(L_37); String_t* L_38 = AnchorInfo_get_Substring_m1320966366(L_37, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_39 = V_1; NullCheck(L_39); bool L_40 = AnchorInfo_get_IgnoreCase_m843009482(L_39, /*hidden argument*/NULL); AnchorInfo_t1997143859 * L_41 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m2237276956(L_41, __this, L_35, L_36, L_38, L_40, /*hidden argument*/NULL); return L_41; } IL_00bc: { int32_t L_42 = V_0; AnchorInfo_t1997143859 * L_43 = (AnchorInfo_t1997143859 *)il2cpp_codegen_object_new(AnchorInfo_t1997143859_il2cpp_TypeInfo_var); AnchorInfo__ctor_m774944594(L_43, __this, L_42, /*hidden argument*/NULL); return L_43; } } // System.Void System.Uri::.ctor(System.String) extern "C" void Uri__ctor_m1721267859 (Uri_t2776692961 * __this, String_t* ___uriString0, const MethodInfo* method) { { String_t* L_0 = ___uriString0; Uri__ctor_m1689224330(__this, L_0, (bool)0, /*hidden argument*/NULL); return; } } // System.Void System.Uri::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern Il2CppCodeGenString* _stringLiteral384360533; extern const uint32_t Uri__ctor_m4101815696_MetadataUsageId; extern "C" void Uri__ctor_m4101815696 (Uri_t2776692961 * __this, SerializationInfo_t2995724695 * ___serializationInfo0, StreamingContext_t986364934 ___streamingContext1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri__ctor_m4101815696_MetadataUsageId); s_Il2CppMethodIntialized = true; } { SerializationInfo_t2995724695 * L_0 = ___serializationInfo0; NullCheck(L_0); String_t* L_1 = SerializationInfo_GetString_m52579033(L_0, _stringLiteral384360533, /*hidden argument*/NULL); Uri__ctor_m1689224330(__this, L_1, (bool)1, /*hidden argument*/NULL); return; } } // System.Void System.Uri::.ctor(System.String,System.Boolean) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* UriFormatException_t1145000641_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3083898829; extern const uint32_t Uri__ctor_m1689224330_MetadataUsageId; extern "C" void Uri__ctor_m1689224330 (Uri_t2776692961 * __this, String_t* ___uriString0, bool ___dontEscape1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri__ctor_m1689224330_MetadataUsageId); s_Il2CppMethodIntialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_0 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_scheme_2(L_0); String_t* L_1 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_1); __this->set_port_4((-1)); String_t* L_2 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_path_5(L_2); String_t* L_3 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_query_6(L_3); String_t* L_4 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_fragment_7(L_4); String_t* L_5 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_userinfo_8(L_5); __this->set_isAbsoluteUri_11((bool)1); Object__ctor_m1772956182(__this, /*hidden argument*/NULL); bool L_6 = ___dontEscape1; __this->set_userEscaped_12(L_6); String_t* L_7 = ___uriString0; __this->set_source_1(L_7); Uri_ParseUri_m3771462925(__this, 1, /*hidden argument*/NULL); bool L_8 = __this->get_isAbsoluteUri_11(); if (L_8) { goto IL_0087; } } { String_t* L_9 = ___uriString0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_10 = String_Concat_m138640077(NULL /*static, unused*/, _stringLiteral3083898829, L_9, /*hidden argument*/NULL); UriFormatException_t1145000641 * L_11 = (UriFormatException_t1145000641 *)il2cpp_codegen_object_new(UriFormatException_t1145000641_il2cpp_TypeInfo_var); UriFormatException__ctor_m3185454499(L_11, L_10, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_11); } IL_0087: { return; } } // System.Void System.Uri::.cctor() extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* UriSchemeU5BU5D_t1246605964_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3633740456; extern Il2CppCodeGenString* _stringLiteral57242; extern Il2CppCodeGenString* _stringLiteral3143036; extern Il2CppCodeGenString* _stringLiteral101730; extern Il2CppCodeGenString* _stringLiteral3054753165; extern Il2CppCodeGenString* _stringLiteral3213448; extern Il2CppCodeGenString* _stringLiteral99617003; extern Il2CppCodeGenString* _stringLiteral3213394546; extern Il2CppCodeGenString* _stringLiteral3377875; extern Il2CppCodeGenString* _stringLiteral3386428; extern Il2CppCodeGenString* _stringLiteral1246071647; extern Il2CppCodeGenString* _stringLiteral1841314832; extern Il2CppCodeGenString* _stringLiteral58; extern const uint32_t Uri__cctor_m2145170622_MetadataUsageId; extern "C" void Uri__cctor_m2145170622 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri__cctor_m2145170622_MetadataUsageId); s_Il2CppMethodIntialized = true; } { ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_hexUpperChars_16(_stringLiteral3633740456); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_SchemeDelimiter_17(_stringLiteral57242); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeFile_18(_stringLiteral3143036); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeFtp_19(_stringLiteral101730); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeGopher_20(_stringLiteral3054753165); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeHttp_21(_stringLiteral3213448); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeHttps_22(_stringLiteral99617003); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeMailto_23(_stringLiteral3213394546); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeNews_24(_stringLiteral3377875); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeNntp_25(_stringLiteral3386428); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeNetPipe_26(_stringLiteral1246071647); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_UriSchemeNetTcp_27(_stringLiteral1841314832); UriSchemeU5BU5D_t1246605964* L_0 = ((UriSchemeU5BU5D_t1246605964*)SZArrayNew(UriSchemeU5BU5D_t1246605964_il2cpp_TypeInfo_var, (uint32_t)8)); NullCheck(L_0); IL2CPP_ARRAY_BOUNDS_CHECK(L_0, 0); String_t* L_1 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeHttp_21(); String_t* L_2 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); UriScheme_t3266528785 L_3; memset(&L_3, 0, sizeof(L_3)); UriScheme__ctor_m535258662(&L_3, L_1, L_2, ((int32_t)80), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_0)->GetAddressAt(static_cast<il2cpp_array_size_t>(0)))) = L_3; UriSchemeU5BU5D_t1246605964* L_4 = L_0; NullCheck(L_4); IL2CPP_ARRAY_BOUNDS_CHECK(L_4, 1); String_t* L_5 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeHttps_22(); String_t* L_6 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); UriScheme_t3266528785 L_7; memset(&L_7, 0, sizeof(L_7)); UriScheme__ctor_m535258662(&L_7, L_5, L_6, ((int32_t)443), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_4)->GetAddressAt(static_cast<il2cpp_array_size_t>(1)))) = L_7; UriSchemeU5BU5D_t1246605964* L_8 = L_4; NullCheck(L_8); IL2CPP_ARRAY_BOUNDS_CHECK(L_8, 2); String_t* L_9 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFtp_19(); String_t* L_10 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); UriScheme_t3266528785 L_11; memset(&L_11, 0, sizeof(L_11)); UriScheme__ctor_m535258662(&L_11, L_9, L_10, ((int32_t)21), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_8)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))) = L_11; UriSchemeU5BU5D_t1246605964* L_12 = L_8; NullCheck(L_12); IL2CPP_ARRAY_BOUNDS_CHECK(L_12, 3); String_t* L_13 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); String_t* L_14 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); UriScheme_t3266528785 L_15; memset(&L_15, 0, sizeof(L_15)); UriScheme__ctor_m535258662(&L_15, L_13, L_14, (-1), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_12)->GetAddressAt(static_cast<il2cpp_array_size_t>(3)))) = L_15; UriSchemeU5BU5D_t1246605964* L_16 = L_12; NullCheck(L_16); IL2CPP_ARRAY_BOUNDS_CHECK(L_16, 4); String_t* L_17 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); UriScheme_t3266528785 L_18; memset(&L_18, 0, sizeof(L_18)); UriScheme__ctor_m535258662(&L_18, L_17, _stringLiteral58, ((int32_t)25), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_16)->GetAddressAt(static_cast<il2cpp_array_size_t>(4)))) = L_18; UriSchemeU5BU5D_t1246605964* L_19 = L_16; NullCheck(L_19); IL2CPP_ARRAY_BOUNDS_CHECK(L_19, 5); String_t* L_20 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); UriScheme_t3266528785 L_21; memset(&L_21, 0, sizeof(L_21)); UriScheme__ctor_m535258662(&L_21, L_20, _stringLiteral58, ((int32_t)119), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_19)->GetAddressAt(static_cast<il2cpp_array_size_t>(5)))) = L_21; UriSchemeU5BU5D_t1246605964* L_22 = L_19; NullCheck(L_22); IL2CPP_ARRAY_BOUNDS_CHECK(L_22, 6); String_t* L_23 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNntp_25(); String_t* L_24 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); UriScheme_t3266528785 L_25; memset(&L_25, 0, sizeof(L_25)); UriScheme__ctor_m535258662(&L_25, L_23, L_24, ((int32_t)119), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_22)->GetAddressAt(static_cast<il2cpp_array_size_t>(6)))) = L_25; UriSchemeU5BU5D_t1246605964* L_26 = L_22; NullCheck(L_26); IL2CPP_ARRAY_BOUNDS_CHECK(L_26, 7); String_t* L_27 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeGopher_20(); String_t* L_28 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); UriScheme_t3266528785 L_29; memset(&L_29, 0, sizeof(L_29)); UriScheme__ctor_m535258662(&L_29, L_27, L_28, ((int32_t)70), /*hidden argument*/NULL); (*(UriScheme_t3266528785 *)((L_26)->GetAddressAt(static_cast<il2cpp_array_size_t>(7)))) = L_29; ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_schemes_28(L_26); return; } } // System.Void System.Uri::System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern Il2CppCodeGenString* _stringLiteral384360533; extern const uint32_t Uri_System_Runtime_Serialization_ISerializable_GetObjectData_m3581151196_MetadataUsageId; extern "C" void Uri_System_Runtime_Serialization_ISerializable_GetObjectData_m3581151196 (Uri_t2776692961 * __this, SerializationInfo_t2995724695 * ___info0, StreamingContext_t986364934 ___context1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_System_Runtime_Serialization_ISerializable_GetObjectData_m3581151196_MetadataUsageId); s_Il2CppMethodIntialized = true; } { SerializationInfo_t2995724695 * L_0 = ___info0; String_t* L_1 = Uri_get_AbsoluteUri_m2228269430(__this, /*hidden argument*/NULL); NullCheck(L_0); SerializationInfo_AddValue_m469120675(L_0, _stringLiteral384360533, L_1, /*hidden argument*/NULL); return; } } // System.String System.Uri::get_AbsoluteUri() extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Uri_get_AbsoluteUri_m2228269430_MetadataUsageId; extern "C" String_t* Uri_get_AbsoluteUri_m2228269430 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_get_AbsoluteUri_m2228269430_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); String_t* L_0 = __this->get_cachedAbsoluteUri_13(); if (L_0) { goto IL_006e; } } { String_t* L_1 = Uri_GetLeftPart_m2866425188(__this, 2, /*hidden argument*/NULL); __this->set_cachedAbsoluteUri_13(L_1); String_t* L_2 = __this->get_query_6(); NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); if ((((int32_t)L_3) <= ((int32_t)0))) { goto IL_0046; } } { String_t* L_4 = __this->get_cachedAbsoluteUri_13(); String_t* L_5 = __this->get_query_6(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_6 = String_Concat_m138640077(NULL /*static, unused*/, L_4, L_5, /*hidden argument*/NULL); __this->set_cachedAbsoluteUri_13(L_6); } IL_0046: { String_t* L_7 = __this->get_fragment_7(); NullCheck(L_7); int32_t L_8 = String_get_Length_m2979997331(L_7, /*hidden argument*/NULL); if ((((int32_t)L_8) <= ((int32_t)0))) { goto IL_006e; } } { String_t* L_9 = __this->get_cachedAbsoluteUri_13(); String_t* L_10 = __this->get_fragment_7(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_11 = String_Concat_m138640077(NULL /*static, unused*/, L_9, L_10, /*hidden argument*/NULL); __this->set_cachedAbsoluteUri_13(L_11); } IL_006e: { String_t* L_12 = __this->get_cachedAbsoluteUri_13(); return L_12; } } // System.String System.Uri::get_Authority() extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* Int32_t2847414787_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral58; extern const uint32_t Uri_get_Authority_m1914393796_MetadataUsageId; extern "C" String_t* Uri_get_Authority_m1914393796 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_get_Authority_m1914393796_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* G_B3_0 = NULL; { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); String_t* L_0 = Uri_get_Scheme_m2606456870(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_1 = Uri_GetDefaultPort_m711645873(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); int32_t L_2 = __this->get_port_4(); if ((!(((uint32_t)L_1) == ((uint32_t)L_2)))) { goto IL_0027; } } { String_t* L_3 = __this->get_host_3(); G_B3_0 = L_3; goto IL_0042; } IL_0027: { String_t* L_4 = __this->get_host_3(); int32_t L_5 = __this->get_port_4(); int32_t L_6 = L_5; Il2CppObject * L_7 = Box(Int32_t2847414787_il2cpp_TypeInfo_var, &L_6); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_8 = String_Concat_m2809334143(NULL /*static, unused*/, L_4, _stringLiteral58, L_7, /*hidden argument*/NULL); G_B3_0 = L_8; } IL_0042: { return G_B3_0; } } // System.String System.Uri::get_Host() extern "C" String_t* Uri_get_Host_m1446697833 (Uri_t2776692961 * __this, const MethodInfo* method) { { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); String_t* L_0 = __this->get_host_3(); return L_0; } } // System.Boolean System.Uri::get_IsFile() extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Uri_get_IsFile_m1860057402_MetadataUsageId; extern "C" bool Uri_get_IsFile_m1860057402 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_get_IsFile_m1860057402_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); String_t* L_0 = Uri_get_Scheme_m2606456870(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_1 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_2 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); return L_2; } } // System.Boolean System.Uri::get_IsLoopback() extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* IPAddress_t3220500535_il2cpp_TypeInfo_var; extern Il2CppClass* IPv6Address_t256391031_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2257901963; extern Il2CppCodeGenString* _stringLiteral3090360211; extern const uint32_t Uri_get_IsLoopback_m224603913_MetadataUsageId; extern "C" bool Uri_get_IsLoopback_m224603913 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_get_IsLoopback_m224603913_MetadataUsageId); s_Il2CppMethodIntialized = true; } IPAddress_t3220500535 * V_0 = NULL; IPv6Address_t256391031 * V_1 = NULL; { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); String_t* L_0 = Uri_get_Host_m1446697833(__this, /*hidden argument*/NULL); NullCheck(L_0); int32_t L_1 = String_get_Length_m2979997331(L_0, /*hidden argument*/NULL); if (L_1) { goto IL_001d; } } { bool L_2 = Uri_get_IsFile_m1860057402(__this, /*hidden argument*/NULL); return L_2; } IL_001d: { String_t* L_3 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_4 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_3, _stringLiteral2257901963, /*hidden argument*/NULL); if (L_4) { goto IL_0047; } } { String_t* L_5 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_6 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_5, _stringLiteral3090360211, /*hidden argument*/NULL); if (!L_6) { goto IL_0049; } } IL_0047: { return (bool)1; } IL_0049: { String_t* L_7 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(IPAddress_t3220500535_il2cpp_TypeInfo_var); bool L_8 = IPAddress_TryParse_m1385842418(NULL /*static, unused*/, L_7, (&V_0), /*hidden argument*/NULL); if (!L_8) { goto IL_006d; } } { IL2CPP_RUNTIME_CLASS_INIT(IPAddress_t3220500535_il2cpp_TypeInfo_var); IPAddress_t3220500535 * L_9 = ((IPAddress_t3220500535_StaticFields*)IPAddress_t3220500535_il2cpp_TypeInfo_var->static_fields)->get_Loopback_6(); IPAddress_t3220500535 * L_10 = V_0; NullCheck(L_9); bool L_11 = VirtFuncInvoker1< bool, Il2CppObject * >::Invoke(0 /* System.Boolean System.Net.IPAddress::Equals(System.Object) */, L_9, L_10); if (!L_11) { goto IL_006d; } } { return (bool)1; } IL_006d: { String_t* L_12 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(IPv6Address_t256391031_il2cpp_TypeInfo_var); bool L_13 = IPv6Address_TryParse_m711194034(NULL /*static, unused*/, L_12, (&V_1), /*hidden argument*/NULL); if (!L_13) { goto IL_008c; } } { IPv6Address_t256391031 * L_14 = V_1; IL2CPP_RUNTIME_CLASS_INIT(IPv6Address_t256391031_il2cpp_TypeInfo_var); bool L_15 = IPv6Address_IsLoopback_m3559367027(NULL /*static, unused*/, L_14, /*hidden argument*/NULL); if (!L_15) { goto IL_008c; } } { return (bool)1; } IL_008c: { return (bool)0; } } // System.Boolean System.Uri::get_IsUnc() extern "C" bool Uri_get_IsUnc_m766729742 (Uri_t2776692961 * __this, const MethodInfo* method) { { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); bool L_0 = __this->get_isUnc_9(); return L_0; } } // System.String System.Uri::get_Scheme() extern "C" String_t* Uri_get_Scheme_m2606456870 (Uri_t2776692961 * __this, const MethodInfo* method) { { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); String_t* L_0 = __this->get_scheme_2(); return L_0; } } // System.Boolean System.Uri::get_IsAbsoluteUri() extern "C" bool Uri_get_IsAbsoluteUri_m145672153 (Uri_t2776692961 * __this, const MethodInfo* method) { { bool L_0 = __this->get_isAbsoluteUri_11(); return L_0; } } // System.UriHostNameType System.Uri::CheckHostName(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* IPv6Address_t256391031_il2cpp_TypeInfo_var; extern const uint32_t Uri_CheckHostName_m294200959_MetadataUsageId; extern "C" int32_t Uri_CheckHostName_m294200959 (Il2CppObject * __this /* static, unused */, String_t* ___name0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_CheckHostName_m294200959_MetadataUsageId); s_Il2CppMethodIntialized = true; } IPv6Address_t256391031 * V_0 = NULL; { String_t* L_0 = ___name0; if (!L_0) { goto IL_0011; } } { String_t* L_1 = ___name0; NullCheck(L_1); int32_t L_2 = String_get_Length_m2979997331(L_1, /*hidden argument*/NULL); if (L_2) { goto IL_0013; } } IL_0011: { return (int32_t)(0); } IL_0013: { String_t* L_3 = ___name0; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_4 = Uri_IsIPv4Address_m3490090822(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_0020; } } { return (int32_t)(3); } IL_0020: { String_t* L_5 = ___name0; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_6 = Uri_IsDomainAddress_m740222981(NULL /*static, unused*/, L_5, /*hidden argument*/NULL); if (!L_6) { goto IL_002d; } } { return (int32_t)(2); } IL_002d: { String_t* L_7 = ___name0; IL2CPP_RUNTIME_CLASS_INIT(IPv6Address_t256391031_il2cpp_TypeInfo_var); bool L_8 = IPv6Address_TryParse_m711194034(NULL /*static, unused*/, L_7, (&V_0), /*hidden argument*/NULL); if (!L_8) { goto IL_003c; } } { return (int32_t)(4); } IL_003c: { return (int32_t)(0); } } // System.Boolean System.Uri::IsIPv4Address(System.String) extern Il2CppClass* CharU5BU5D_t3416858730_il2cpp_TypeInfo_var; extern const uint32_t Uri_IsIPv4Address_m3490090822_MetadataUsageId; extern "C" bool Uri_IsIPv4Address_m3490090822 (Il2CppObject * __this /* static, unused */, String_t* ___name0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_IsIPv4Address_m3490090822_MetadataUsageId); s_Il2CppMethodIntialized = true; } StringU5BU5D_t2956870243* V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; uint32_t V_3 = 0; { String_t* L_0 = ___name0; CharU5BU5D_t3416858730* L_1 = ((CharU5BU5D_t3416858730*)SZArrayNew(CharU5BU5D_t3416858730_il2cpp_TypeInfo_var, (uint32_t)1)); NullCheck(L_1); IL2CPP_ARRAY_BOUNDS_CHECK(L_1, 0); (L_1)->SetAt(static_cast<il2cpp_array_size_t>(0), (uint16_t)((int32_t)46)); NullCheck(L_0); StringU5BU5D_t2956870243* L_2 = String_Split_m290179486(L_0, L_1, /*hidden argument*/NULL); V_0 = L_2; StringU5BU5D_t2956870243* L_3 = V_0; NullCheck(L_3); if ((((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_3)->max_length))))) == ((int32_t)4))) { goto IL_001d; } } { return (bool)0; } IL_001d: { V_1 = 0; goto IL_0057; } IL_0024: { StringU5BU5D_t2956870243* L_4 = V_0; int32_t L_5 = V_1; NullCheck(L_4); IL2CPP_ARRAY_BOUNDS_CHECK(L_4, L_5); int32_t L_6 = L_5; NullCheck(((L_4)->GetAt(static_cast<il2cpp_array_size_t>(L_6)))); int32_t L_7 = String_get_Length_m2979997331(((L_4)->GetAt(static_cast<il2cpp_array_size_t>(L_6))), /*hidden argument*/NULL); V_2 = L_7; int32_t L_8 = V_2; if (L_8) { goto IL_0035; } } { return (bool)0; } IL_0035: { StringU5BU5D_t2956870243* L_9 = V_0; int32_t L_10 = V_1; NullCheck(L_9); IL2CPP_ARRAY_BOUNDS_CHECK(L_9, L_10); int32_t L_11 = L_10; bool L_12 = UInt32_TryParse_m537116052(NULL /*static, unused*/, ((L_9)->GetAt(static_cast<il2cpp_array_size_t>(L_11))), (&V_3), /*hidden argument*/NULL); if (L_12) { goto IL_0046; } } { return (bool)0; } IL_0046: { uint32_t L_13 = V_3; if ((!(((uint32_t)L_13) > ((uint32_t)((int32_t)255))))) { goto IL_0053; } } { return (bool)0; } IL_0053: { int32_t L_14 = V_1; V_1 = ((int32_t)((int32_t)L_14+(int32_t)1)); } IL_0057: { int32_t L_15 = V_1; if ((((int32_t)L_15) < ((int32_t)4))) { goto IL_0024; } } { return (bool)1; } } // System.Boolean System.Uri::IsDomainAddress(System.String) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t Uri_IsDomainAddress_m740222981_MetadataUsageId; extern "C" bool Uri_IsDomainAddress_m740222981 (Il2CppObject * __this /* static, unused */, String_t* ___name0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_IsDomainAddress_m740222981_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; uint16_t V_3 = 0x0; { String_t* L_0 = ___name0; NullCheck(L_0); int32_t L_1 = String_get_Length_m2979997331(L_0, /*hidden argument*/NULL); V_0 = L_1; V_1 = 0; V_2 = 0; goto IL_006e; } IL_0010: { String_t* L_2 = ___name0; int32_t L_3 = V_2; NullCheck(L_2); uint16_t L_4 = String_get_Chars_m3015341861(L_2, L_3, /*hidden argument*/NULL); V_3 = L_4; int32_t L_5 = V_1; if (L_5) { goto IL_0030; } } { uint16_t L_6 = V_3; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_7 = Char_IsLetterOrDigit_m2290383044(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); if (L_7) { goto IL_002b; } } { return (bool)0; } IL_002b: { goto IL_005c; } IL_0030: { uint16_t L_8 = V_3; if ((!(((uint32_t)L_8) == ((uint32_t)((int32_t)46))))) { goto IL_003f; } } { V_1 = 0; goto IL_005c; } IL_003f: { uint16_t L_9 = V_3; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_10 = Char_IsLetterOrDigit_m2290383044(NULL /*static, unused*/, L_9, /*hidden argument*/NULL); if (L_10) { goto IL_005c; } } { uint16_t L_11 = V_3; if ((((int32_t)L_11) == ((int32_t)((int32_t)45)))) { goto IL_005c; } } { uint16_t L_12 = V_3; if ((((int32_t)L_12) == ((int32_t)((int32_t)95)))) { goto IL_005c; } } { return (bool)0; } IL_005c: { int32_t L_13 = V_1; int32_t L_14 = ((int32_t)((int32_t)L_13+(int32_t)1)); V_1 = L_14; if ((!(((uint32_t)L_14) == ((uint32_t)((int32_t)64))))) { goto IL_006a; } } { return (bool)0; } IL_006a: { int32_t L_15 = V_2; V_2 = ((int32_t)((int32_t)L_15+(int32_t)1)); } IL_006e: { int32_t L_16 = V_2; int32_t L_17 = V_0; if ((((int32_t)L_16) < ((int32_t)L_17))) { goto IL_0010; } } { return (bool)1; } } // System.Boolean System.Uri::CheckSchemeName(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t Uri_CheckSchemeName_m3839723091_MetadataUsageId; extern "C" bool Uri_CheckSchemeName_m3839723091 (Il2CppObject * __this /* static, unused */, String_t* ___schemeName0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_CheckSchemeName_m3839723091_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; uint16_t V_2 = 0x0; { String_t* L_0 = ___schemeName0; if (!L_0) { goto IL_0011; } } { String_t* L_1 = ___schemeName0; NullCheck(L_1); int32_t L_2 = String_get_Length_m2979997331(L_1, /*hidden argument*/NULL); if (L_2) { goto IL_0013; } } IL_0011: { return (bool)0; } IL_0013: { String_t* L_3 = ___schemeName0; NullCheck(L_3); uint16_t L_4 = String_get_Chars_m3015341861(L_3, 0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_5 = Uri_IsAlpha_m171894930(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); if (L_5) { goto IL_0026; } } { return (bool)0; } IL_0026: { String_t* L_6 = ___schemeName0; NullCheck(L_6); int32_t L_7 = String_get_Length_m2979997331(L_6, /*hidden argument*/NULL); V_0 = L_7; V_1 = 1; goto IL_0070; } IL_0034: { String_t* L_8 = ___schemeName0; int32_t L_9 = V_1; NullCheck(L_8); uint16_t L_10 = String_get_Chars_m3015341861(L_8, L_9, /*hidden argument*/NULL); V_2 = L_10; uint16_t L_11 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); bool L_12 = Char_IsDigit_m1743537211(NULL /*static, unused*/, L_11, /*hidden argument*/NULL); if (L_12) { goto IL_006c; } } { uint16_t L_13 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_14 = Uri_IsAlpha_m171894930(NULL /*static, unused*/, L_13, /*hidden argument*/NULL); if (L_14) { goto IL_006c; } } { uint16_t L_15 = V_2; if ((((int32_t)L_15) == ((int32_t)((int32_t)46)))) { goto IL_006c; } } { uint16_t L_16 = V_2; if ((((int32_t)L_16) == ((int32_t)((int32_t)43)))) { goto IL_006c; } } { uint16_t L_17 = V_2; if ((((int32_t)L_17) == ((int32_t)((int32_t)45)))) { goto IL_006c; } } { return (bool)0; } IL_006c: { int32_t L_18 = V_1; V_1 = ((int32_t)((int32_t)L_18+(int32_t)1)); } IL_0070: { int32_t L_19 = V_1; int32_t L_20 = V_0; if ((((int32_t)L_19) < ((int32_t)L_20))) { goto IL_0034; } } { return (bool)1; } } // System.Boolean System.Uri::IsAlpha(System.Char) extern "C" bool Uri_IsAlpha_m171894930 (Il2CppObject * __this /* static, unused */, uint16_t ___c0, const MethodInfo* method) { int32_t V_0 = 0; int32_t G_B5_0 = 0; int32_t G_B7_0 = 0; { uint16_t L_0 = ___c0; V_0 = L_0; int32_t L_1 = V_0; if ((((int32_t)L_1) < ((int32_t)((int32_t)65)))) { goto IL_0012; } } { int32_t L_2 = V_0; if ((((int32_t)L_2) <= ((int32_t)((int32_t)90)))) { goto IL_0027; } } IL_0012: { int32_t L_3 = V_0; if ((((int32_t)L_3) < ((int32_t)((int32_t)97)))) { goto IL_0024; } } { int32_t L_4 = V_0; G_B5_0 = ((((int32_t)((((int32_t)L_4) > ((int32_t)((int32_t)122)))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0025; } IL_0024: { G_B5_0 = 0; } IL_0025: { G_B7_0 = G_B5_0; goto IL_0028; } IL_0027: { G_B7_0 = 1; } IL_0028: { return (bool)G_B7_0; } } // System.Boolean System.Uri::Equals(System.Object) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Uri_Equals_m2208061098_MetadataUsageId; extern "C" bool Uri_Equals_m2208061098 (Uri_t2776692961 * __this, Il2CppObject * ___comparant0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_Equals_m2208061098_MetadataUsageId); s_Il2CppMethodIntialized = true; } Uri_t2776692961 * V_0 = NULL; String_t* V_1 = NULL; { Il2CppObject * L_0 = ___comparant0; if (L_0) { goto IL_0008; } } { return (bool)0; } IL_0008: { Il2CppObject * L_1 = ___comparant0; V_0 = ((Uri_t2776692961 *)IsInstClass(L_1, Uri_t2776692961_il2cpp_TypeInfo_var)); Uri_t2776692961 * L_2 = V_0; if (L_2) { goto IL_002b; } } { Il2CppObject * L_3 = ___comparant0; V_1 = ((String_t*)IsInstSealed(L_3, String_t_il2cpp_TypeInfo_var)); String_t* L_4 = V_1; if (L_4) { goto IL_0024; } } { return (bool)0; } IL_0024: { String_t* L_5 = V_1; Uri_t2776692961 * L_6 = (Uri_t2776692961 *)il2cpp_codegen_object_new(Uri_t2776692961_il2cpp_TypeInfo_var); Uri__ctor_m1721267859(L_6, L_5, /*hidden argument*/NULL); V_0 = L_6; } IL_002b: { Uri_t2776692961 * L_7 = V_0; bool L_8 = Uri_InternalEquals_m2509473274(__this, L_7, /*hidden argument*/NULL); return L_8; } } // System.Boolean System.Uri::InternalEquals(System.Uri) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* CultureInfo_t3603717042_il2cpp_TypeInfo_var; extern const uint32_t Uri_InternalEquals_m2509473274_MetadataUsageId; extern "C" bool Uri_InternalEquals_m2509473274 (Uri_t2776692961 * __this, Uri_t2776692961 * ___uri0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_InternalEquals_m2509473274_MetadataUsageId); s_Il2CppMethodIntialized = true; } CultureInfo_t3603717042 * V_0 = NULL; int32_t G_B10_0 = 0; { bool L_0 = __this->get_isAbsoluteUri_11(); Uri_t2776692961 * L_1 = ___uri0; NullCheck(L_1); bool L_2 = L_1->get_isAbsoluteUri_11(); if ((((int32_t)L_0) == ((int32_t)L_2))) { goto IL_0013; } } { return (bool)0; } IL_0013: { bool L_3 = __this->get_isAbsoluteUri_11(); if (L_3) { goto IL_0030; } } { String_t* L_4 = __this->get_source_1(); Uri_t2776692961 * L_5 = ___uri0; NullCheck(L_5); String_t* L_6 = L_5->get_source_1(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_7 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_4, L_6, /*hidden argument*/NULL); return L_7; } IL_0030: { IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3603717042_il2cpp_TypeInfo_var); CultureInfo_t3603717042 * L_8 = CultureInfo_get_InvariantCulture_m764001524(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_8; String_t* L_9 = __this->get_scheme_2(); CultureInfo_t3603717042 * L_10 = V_0; NullCheck(L_9); String_t* L_11 = String_ToLower_m2140020155(L_9, L_10, /*hidden argument*/NULL); Uri_t2776692961 * L_12 = ___uri0; NullCheck(L_12); String_t* L_13 = L_12->get_scheme_2(); CultureInfo_t3603717042 * L_14 = V_0; NullCheck(L_13); String_t* L_15 = String_ToLower_m2140020155(L_13, L_14, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_16 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_11, L_15, /*hidden argument*/NULL); if (!L_16) { goto IL_00b4; } } { String_t* L_17 = __this->get_host_3(); CultureInfo_t3603717042 * L_18 = V_0; NullCheck(L_17); String_t* L_19 = String_ToLower_m2140020155(L_17, L_18, /*hidden argument*/NULL); Uri_t2776692961 * L_20 = ___uri0; NullCheck(L_20); String_t* L_21 = L_20->get_host_3(); CultureInfo_t3603717042 * L_22 = V_0; NullCheck(L_21); String_t* L_23 = String_ToLower_m2140020155(L_21, L_22, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_24 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_19, L_23, /*hidden argument*/NULL); if (!L_24) { goto IL_00b4; } } { int32_t L_25 = __this->get_port_4(); Uri_t2776692961 * L_26 = ___uri0; NullCheck(L_26); int32_t L_27 = L_26->get_port_4(); if ((!(((uint32_t)L_25) == ((uint32_t)L_27)))) { goto IL_00b4; } } { String_t* L_28 = __this->get_query_6(); Uri_t2776692961 * L_29 = ___uri0; NullCheck(L_29); String_t* L_30 = L_29->get_query_6(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_31 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_28, L_30, /*hidden argument*/NULL); if (!L_31) { goto IL_00b4; } } { String_t* L_32 = __this->get_path_5(); Uri_t2776692961 * L_33 = ___uri0; NullCheck(L_33); String_t* L_34 = L_33->get_path_5(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_35 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_32, L_34, /*hidden argument*/NULL); G_B10_0 = ((int32_t)(L_35)); goto IL_00b5; } IL_00b4: { G_B10_0 = 0; } IL_00b5: { return (bool)G_B10_0; } } // System.Int32 System.Uri::GetHashCode() extern Il2CppClass* CultureInfo_t3603717042_il2cpp_TypeInfo_var; extern const uint32_t Uri_GetHashCode_m629619726_MetadataUsageId; extern "C" int32_t Uri_GetHashCode_m629619726 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_GetHashCode_m629619726_MetadataUsageId); s_Il2CppMethodIntialized = true; } CultureInfo_t3603717042 * V_0 = NULL; { int32_t L_0 = __this->get_cachedHashCode_15(); if (L_0) { goto IL_007a; } } { IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3603717042_il2cpp_TypeInfo_var); CultureInfo_t3603717042 * L_1 = CultureInfo_get_InvariantCulture_m764001524(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = L_1; bool L_2 = __this->get_isAbsoluteUri_11(); if (!L_2) { goto IL_0069; } } { String_t* L_3 = __this->get_scheme_2(); CultureInfo_t3603717042 * L_4 = V_0; NullCheck(L_3); String_t* L_5 = String_ToLower_m2140020155(L_3, L_4, /*hidden argument*/NULL); NullCheck(L_5); int32_t L_6 = String_GetHashCode_m471729487(L_5, /*hidden argument*/NULL); String_t* L_7 = __this->get_host_3(); CultureInfo_t3603717042 * L_8 = V_0; NullCheck(L_7); String_t* L_9 = String_ToLower_m2140020155(L_7, L_8, /*hidden argument*/NULL); NullCheck(L_9); int32_t L_10 = String_GetHashCode_m471729487(L_9, /*hidden argument*/NULL); int32_t L_11 = __this->get_port_4(); String_t* L_12 = __this->get_query_6(); NullCheck(L_12); int32_t L_13 = String_GetHashCode_m471729487(L_12, /*hidden argument*/NULL); String_t* L_14 = __this->get_path_5(); NullCheck(L_14); int32_t L_15 = String_GetHashCode_m471729487(L_14, /*hidden argument*/NULL); __this->set_cachedHashCode_15(((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_6^(int32_t)L_10))^(int32_t)L_11))^(int32_t)L_13))^(int32_t)L_15))); goto IL_007a; } IL_0069: { String_t* L_16 = __this->get_source_1(); NullCheck(L_16); int32_t L_17 = String_GetHashCode_m471729487(L_16, /*hidden argument*/NULL); __this->set_cachedHashCode_15(L_17); } IL_007a: { int32_t L_18 = __this->get_cachedHashCode_15(); return L_18; } } // System.String System.Uri::GetLeftPart(System.UriPartial) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* StringBuilder_t3822575854_il2cpp_TypeInfo_var; extern Il2CppClass* Dictionary_2_t190145395_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m1958628151_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral3213394546; extern Il2CppCodeGenString* _stringLiteral3377875; extern const uint32_t Uri_GetLeftPart_m2866425188_MetadataUsageId; extern "C" String_t* Uri_GetLeftPart_m2866425188 (Uri_t2776692961 * __this, int32_t ___part0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_GetLeftPart_m2866425188_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; StringBuilder_t3822575854 * V_1 = NULL; StringBuilder_t3822575854 * V_2 = NULL; int32_t V_3 = 0; String_t* V_4 = NULL; Dictionary_2_t190145395 * V_5 = NULL; int32_t V_6 = 0; { Uri_EnsureAbsoluteUri_m3407571844(__this, /*hidden argument*/NULL); int32_t L_0 = ___part0; V_3 = L_0; int32_t L_1 = V_3; if (L_1 == 0) { goto IL_001f; } if (L_1 == 1) { goto IL_0031; } if (L_1 == 2) { goto IL_0134; } } { goto IL_02ad; } IL_001f: { String_t* L_2 = __this->get_scheme_2(); String_t* L_3 = Uri_GetOpaqueWiseSchemeDelimiter_m3781205887(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_4 = String_Concat_m138640077(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); return L_4; } IL_0031: { String_t* L_5 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_6 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_7 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); if (L_7) { goto IL_005b; } } { String_t* L_8 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_9 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_10 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_8, L_9, /*hidden argument*/NULL); if (!L_10) { goto IL_0061; } } IL_005b: { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_11 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); return L_11; } IL_0061: { StringBuilder_t3822575854 * L_12 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m135953004(L_12, /*hidden argument*/NULL); V_1 = L_12; StringBuilder_t3822575854 * L_13 = V_1; String_t* L_14 = __this->get_scheme_2(); NullCheck(L_13); StringBuilder_Append_m3898090075(L_13, L_14, /*hidden argument*/NULL); StringBuilder_t3822575854 * L_15 = V_1; String_t* L_16 = Uri_GetOpaqueWiseSchemeDelimiter_m3781205887(__this, /*hidden argument*/NULL); NullCheck(L_15); StringBuilder_Append_m3898090075(L_15, L_16, /*hidden argument*/NULL); String_t* L_17 = __this->get_path_5(); NullCheck(L_17); int32_t L_18 = String_get_Length_m2979997331(L_17, /*hidden argument*/NULL); if ((((int32_t)L_18) <= ((int32_t)1))) { goto IL_00c3; } } { String_t* L_19 = __this->get_path_5(); NullCheck(L_19); uint16_t L_20 = String_get_Chars_m3015341861(L_19, 1, /*hidden argument*/NULL); if ((!(((uint32_t)L_20) == ((uint32_t)((int32_t)58))))) { goto IL_00c3; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_21 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); String_t* L_22 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_23 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_21, L_22, /*hidden argument*/NULL); if (!L_23) { goto IL_00c3; } } { StringBuilder_t3822575854 * L_24 = V_1; NullCheck(L_24); StringBuilder_Append_m2143093878(L_24, ((int32_t)47), /*hidden argument*/NULL); } IL_00c3: { String_t* L_25 = __this->get_userinfo_8(); NullCheck(L_25); int32_t L_26 = String_get_Length_m2979997331(L_25, /*hidden argument*/NULL); if ((((int32_t)L_26) <= ((int32_t)0))) { goto IL_00e8; } } { StringBuilder_t3822575854 * L_27 = V_1; String_t* L_28 = __this->get_userinfo_8(); NullCheck(L_27); StringBuilder_t3822575854 * L_29 = StringBuilder_Append_m3898090075(L_27, L_28, /*hidden argument*/NULL); NullCheck(L_29); StringBuilder_Append_m2143093878(L_29, ((int32_t)64), /*hidden argument*/NULL); } IL_00e8: { StringBuilder_t3822575854 * L_30 = V_1; String_t* L_31 = __this->get_host_3(); NullCheck(L_30); StringBuilder_Append_m3898090075(L_30, L_31, /*hidden argument*/NULL); String_t* L_32 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_33 = Uri_GetDefaultPort_m711645873(NULL /*static, unused*/, L_32, /*hidden argument*/NULL); V_0 = L_33; int32_t L_34 = __this->get_port_4(); if ((((int32_t)L_34) == ((int32_t)(-1)))) { goto IL_012d; } } { int32_t L_35 = __this->get_port_4(); int32_t L_36 = V_0; if ((((int32_t)L_35) == ((int32_t)L_36))) { goto IL_012d; } } { StringBuilder_t3822575854 * L_37 = V_1; NullCheck(L_37); StringBuilder_t3822575854 * L_38 = StringBuilder_Append_m2143093878(L_37, ((int32_t)58), /*hidden argument*/NULL); int32_t L_39 = __this->get_port_4(); NullCheck(L_38); StringBuilder_Append_m2189222616(L_38, L_39, /*hidden argument*/NULL); } IL_012d: { StringBuilder_t3822575854 * L_40 = V_1; NullCheck(L_40); String_t* L_41 = StringBuilder_ToString_m350379841(L_40, /*hidden argument*/NULL); return L_41; } IL_0134: { StringBuilder_t3822575854 * L_42 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m135953004(L_42, /*hidden argument*/NULL); V_2 = L_42; StringBuilder_t3822575854 * L_43 = V_2; String_t* L_44 = __this->get_scheme_2(); NullCheck(L_43); StringBuilder_Append_m3898090075(L_43, L_44, /*hidden argument*/NULL); StringBuilder_t3822575854 * L_45 = V_2; String_t* L_46 = Uri_GetOpaqueWiseSchemeDelimiter_m3781205887(__this, /*hidden argument*/NULL); NullCheck(L_45); StringBuilder_Append_m3898090075(L_45, L_46, /*hidden argument*/NULL); String_t* L_47 = __this->get_path_5(); NullCheck(L_47); int32_t L_48 = String_get_Length_m2979997331(L_47, /*hidden argument*/NULL); if ((((int32_t)L_48) <= ((int32_t)1))) { goto IL_0196; } } { String_t* L_49 = __this->get_path_5(); NullCheck(L_49); uint16_t L_50 = String_get_Chars_m3015341861(L_49, 1, /*hidden argument*/NULL); if ((!(((uint32_t)L_50) == ((uint32_t)((int32_t)58))))) { goto IL_0196; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_51 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); String_t* L_52 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_53 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_51, L_52, /*hidden argument*/NULL); if (!L_53) { goto IL_0196; } } { StringBuilder_t3822575854 * L_54 = V_2; NullCheck(L_54); StringBuilder_Append_m2143093878(L_54, ((int32_t)47), /*hidden argument*/NULL); } IL_0196: { String_t* L_55 = __this->get_userinfo_8(); NullCheck(L_55); int32_t L_56 = String_get_Length_m2979997331(L_55, /*hidden argument*/NULL); if ((((int32_t)L_56) <= ((int32_t)0))) { goto IL_01bb; } } { StringBuilder_t3822575854 * L_57 = V_2; String_t* L_58 = __this->get_userinfo_8(); NullCheck(L_57); StringBuilder_t3822575854 * L_59 = StringBuilder_Append_m3898090075(L_57, L_58, /*hidden argument*/NULL); NullCheck(L_59); StringBuilder_Append_m2143093878(L_59, ((int32_t)64), /*hidden argument*/NULL); } IL_01bb: { StringBuilder_t3822575854 * L_60 = V_2; String_t* L_61 = __this->get_host_3(); NullCheck(L_60); StringBuilder_Append_m3898090075(L_60, L_61, /*hidden argument*/NULL); String_t* L_62 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_63 = Uri_GetDefaultPort_m711645873(NULL /*static, unused*/, L_62, /*hidden argument*/NULL); V_0 = L_63; int32_t L_64 = __this->get_port_4(); if ((((int32_t)L_64) == ((int32_t)(-1)))) { goto IL_0200; } } { int32_t L_65 = __this->get_port_4(); int32_t L_66 = V_0; if ((((int32_t)L_65) == ((int32_t)L_66))) { goto IL_0200; } } { StringBuilder_t3822575854 * L_67 = V_2; NullCheck(L_67); StringBuilder_t3822575854 * L_68 = StringBuilder_Append_m2143093878(L_67, ((int32_t)58), /*hidden argument*/NULL); int32_t L_69 = __this->get_port_4(); NullCheck(L_68); StringBuilder_Append_m2189222616(L_68, L_69, /*hidden argument*/NULL); } IL_0200: { String_t* L_70 = __this->get_path_5(); NullCheck(L_70); int32_t L_71 = String_get_Length_m2979997331(L_70, /*hidden argument*/NULL); if ((((int32_t)L_71) <= ((int32_t)0))) { goto IL_02a6; } } { String_t* L_72 = Uri_get_Scheme_m2606456870(__this, /*hidden argument*/NULL); V_4 = L_72; String_t* L_73 = V_4; if (!L_73) { goto IL_0284; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); Dictionary_2_t190145395 * L_74 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map14_30(); if (L_74) { goto IL_0253; } } { Dictionary_2_t190145395 * L_75 = (Dictionary_2_t190145395 *)il2cpp_codegen_object_new(Dictionary_2_t190145395_il2cpp_TypeInfo_var); Dictionary_2__ctor_m1958628151(L_75, 2, /*hidden argument*/Dictionary_2__ctor_m1958628151_MethodInfo_var); V_5 = L_75; Dictionary_2_t190145395 * L_76 = V_5; NullCheck(L_76); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_76, _stringLiteral3213394546, 0); Dictionary_2_t190145395 * L_77 = V_5; NullCheck(L_77); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_77, _stringLiteral3377875, 0); Dictionary_2_t190145395 * L_78 = V_5; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_U3CU3Ef__switchU24map14_30(L_78); } IL_0253: { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); Dictionary_2_t190145395 * L_79 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map14_30(); String_t* L_80 = V_4; NullCheck(L_79); bool L_81 = VirtFuncInvoker2< bool, String_t*, int32_t* >::Invoke(30 /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Int32>::TryGetValue(!0,!1&) */, L_79, L_80, (&V_6)); if (!L_81) { goto IL_0284; } } { int32_t L_82 = V_6; if (!L_82) { goto IL_0272; } } { goto IL_0284; } IL_0272: { StringBuilder_t3822575854 * L_83 = V_2; String_t* L_84 = __this->get_path_5(); NullCheck(L_83); StringBuilder_Append_m3898090075(L_83, L_84, /*hidden argument*/NULL); goto IL_02a6; } IL_0284: { StringBuilder_t3822575854 * L_85 = V_2; String_t* L_86 = __this->get_path_5(); String_t* L_87 = Uri_get_Scheme_m2606456870(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_88 = Uri_CompactEscaped_m2021013591(NULL /*static, unused*/, L_87, /*hidden argument*/NULL); String_t* L_89 = Uri_Reduce_m1169795993(NULL /*static, unused*/, L_86, L_88, /*hidden argument*/NULL); NullCheck(L_85); StringBuilder_Append_m3898090075(L_85, L_89, /*hidden argument*/NULL); goto IL_02a6; } IL_02a6: { StringBuilder_t3822575854 * L_90 = V_2; NullCheck(L_90); String_t* L_91 = StringBuilder_ToString_m350379841(L_90, /*hidden argument*/NULL); return L_91; } IL_02ad: { return (String_t*)NULL; } } // System.Int32 System.Uri::FromHex(System.Char) extern Il2CppClass* ArgumentException_t124305799_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral95582509; extern const uint32_t Uri_FromHex_m2865381007_MetadataUsageId; extern "C" int32_t Uri_FromHex_m2865381007 (Il2CppObject * __this /* static, unused */, uint16_t ___digit0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_FromHex_m2865381007_MetadataUsageId); s_Il2CppMethodIntialized = true; } { uint16_t L_0 = ___digit0; if ((((int32_t)((int32_t)48)) > ((int32_t)L_0))) { goto IL_0015; } } { uint16_t L_1 = ___digit0; if ((((int32_t)L_1) > ((int32_t)((int32_t)57)))) { goto IL_0015; } } { uint16_t L_2 = ___digit0; return ((int32_t)((int32_t)L_2-(int32_t)((int32_t)48))); } IL_0015: { uint16_t L_3 = ___digit0; if ((((int32_t)((int32_t)97)) > ((int32_t)L_3))) { goto IL_002d; } } { uint16_t L_4 = ___digit0; if ((((int32_t)L_4) > ((int32_t)((int32_t)102)))) { goto IL_002d; } } { uint16_t L_5 = ___digit0; return ((int32_t)((int32_t)((int32_t)((int32_t)L_5-(int32_t)((int32_t)97)))+(int32_t)((int32_t)10))); } IL_002d: { uint16_t L_6 = ___digit0; if ((((int32_t)((int32_t)65)) > ((int32_t)L_6))) { goto IL_0045; } } { uint16_t L_7 = ___digit0; if ((((int32_t)L_7) > ((int32_t)((int32_t)70)))) { goto IL_0045; } } { uint16_t L_8 = ___digit0; return ((int32_t)((int32_t)((int32_t)((int32_t)L_8-(int32_t)((int32_t)65)))+(int32_t)((int32_t)10))); } IL_0045: { ArgumentException_t124305799 * L_9 = (ArgumentException_t124305799 *)il2cpp_codegen_object_new(ArgumentException_t124305799_il2cpp_TypeInfo_var); ArgumentException__ctor_m3544856547(L_9, _stringLiteral95582509, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_9); } } // System.String System.Uri::HexEscape(System.Char) extern Il2CppClass* ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral1564195625; extern Il2CppCodeGenString* _stringLiteral37; extern const uint32_t Uri_HexEscape_m2779785335_MetadataUsageId; extern "C" String_t* Uri_HexEscape_m2779785335 (Il2CppObject * __this /* static, unused */, uint16_t ___character0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_HexEscape_m2779785335_MetadataUsageId); s_Il2CppMethodIntialized = true; } { uint16_t L_0 = ___character0; if ((((int32_t)L_0) <= ((int32_t)((int32_t)255)))) { goto IL_0016; } } { ArgumentOutOfRangeException_t3479058991 * L_1 = (ArgumentOutOfRangeException_t3479058991 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m2026296331(L_1, _stringLiteral1564195625, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0016: { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_2 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_hexUpperChars_16(); uint16_t L_3 = ___character0; NullCheck(L_2); uint16_t L_4 = String_get_Chars_m3015341861(L_2, ((int32_t)((int32_t)((int32_t)((int32_t)L_3&(int32_t)((int32_t)240)))>>(int32_t)4)), /*hidden argument*/NULL); uint16_t L_5 = L_4; Il2CppObject * L_6 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_5); String_t* L_7 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_hexUpperChars_16(); uint16_t L_8 = ___character0; NullCheck(L_7); uint16_t L_9 = String_get_Chars_m3015341861(L_7, ((int32_t)((int32_t)L_8&(int32_t)((int32_t)15))), /*hidden argument*/NULL); uint16_t L_10 = L_9; Il2CppObject * L_11 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_10); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_12 = String_Concat_m2809334143(NULL /*static, unused*/, _stringLiteral37, L_6, L_11, /*hidden argument*/NULL); return L_12; } } // System.Boolean System.Uri::IsHexDigit(System.Char) extern "C" bool Uri_IsHexDigit_m4109487926 (Il2CppObject * __this /* static, unused */, uint16_t ___digit0, const MethodInfo* method) { int32_t G_B7_0 = 0; int32_t G_B9_0 = 0; { uint16_t L_0 = ___digit0; if ((((int32_t)((int32_t)48)) > ((int32_t)L_0))) { goto IL_0010; } } { uint16_t L_1 = ___digit0; if ((((int32_t)L_1) <= ((int32_t)((int32_t)57)))) { goto IL_0035; } } IL_0010: { uint16_t L_2 = ___digit0; if ((((int32_t)((int32_t)97)) > ((int32_t)L_2))) { goto IL_0020; } } { uint16_t L_3 = ___digit0; if ((((int32_t)L_3) <= ((int32_t)((int32_t)102)))) { goto IL_0035; } } IL_0020: { uint16_t L_4 = ___digit0; if ((((int32_t)((int32_t)65)) > ((int32_t)L_4))) { goto IL_0032; } } { uint16_t L_5 = ___digit0; G_B7_0 = ((((int32_t)((((int32_t)L_5) > ((int32_t)((int32_t)70)))? 1 : 0)) == ((int32_t)0))? 1 : 0); goto IL_0033; } IL_0032: { G_B7_0 = 0; } IL_0033: { G_B9_0 = G_B7_0; goto IL_0036; } IL_0035: { G_B9_0 = 1; } IL_0036: { return (bool)G_B9_0; } } // System.Boolean System.Uri::IsHexEncoding(System.String,System.Int32) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern const uint32_t Uri_IsHexEncoding_m3196775920_MetadataUsageId; extern "C" bool Uri_IsHexEncoding_m3196775920 (Il2CppObject * __this /* static, unused */, String_t* ___pattern0, int32_t ___index1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_IsHexEncoding_m3196775920_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t G_B6_0 = 0; { int32_t L_0 = ___index1; String_t* L_1 = ___pattern0; NullCheck(L_1); int32_t L_2 = String_get_Length_m2979997331(L_1, /*hidden argument*/NULL); if ((((int32_t)((int32_t)((int32_t)L_0+(int32_t)3))) <= ((int32_t)L_2))) { goto IL_0010; } } { return (bool)0; } IL_0010: { String_t* L_3 = ___pattern0; int32_t L_4 = ___index1; int32_t L_5 = L_4; ___index1 = ((int32_t)((int32_t)L_5+(int32_t)1)); NullCheck(L_3); uint16_t L_6 = String_get_Chars_m3015341861(L_3, L_5, /*hidden argument*/NULL); if ((!(((uint32_t)L_6) == ((uint32_t)((int32_t)37))))) { goto IL_0047; } } { String_t* L_7 = ___pattern0; int32_t L_8 = ___index1; int32_t L_9 = L_8; ___index1 = ((int32_t)((int32_t)L_9+(int32_t)1)); NullCheck(L_7); uint16_t L_10 = String_get_Chars_m3015341861(L_7, L_9, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_11 = Uri_IsHexDigit_m4109487926(NULL /*static, unused*/, L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_0047; } } { String_t* L_12 = ___pattern0; int32_t L_13 = ___index1; NullCheck(L_12); uint16_t L_14 = String_get_Chars_m3015341861(L_12, L_13, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_15 = Uri_IsHexDigit_m4109487926(NULL /*static, unused*/, L_14, /*hidden argument*/NULL); G_B6_0 = ((int32_t)(L_15)); goto IL_0048; } IL_0047: { G_B6_0 = 0; } IL_0048: { return (bool)G_B6_0; } } // System.Void System.Uri::AppendQueryAndFragment(System.String&) extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Uri_AppendQueryAndFragment_m1562004088_MetadataUsageId; extern "C" void Uri_AppendQueryAndFragment_m1562004088 (Uri_t2776692961 * __this, String_t** ___result0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_AppendQueryAndFragment_m1562004088_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* V_0 = NULL; String_t* G_B4_0 = NULL; { String_t* L_0 = __this->get_query_6(); NullCheck(L_0); int32_t L_1 = String_get_Length_m2979997331(L_0, /*hidden argument*/NULL); if ((((int32_t)L_1) <= ((int32_t)0))) { goto IL_005e; } } { String_t* L_2 = __this->get_query_6(); NullCheck(L_2); uint16_t L_3 = String_get_Chars_m3015341861(L_2, 0, /*hidden argument*/NULL); if ((!(((uint32_t)L_3) == ((uint32_t)((int32_t)63))))) { goto IL_0047; } } { uint16_t L_4 = ((uint16_t)((int32_t)63)); Il2CppObject * L_5 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_4); String_t* L_6 = __this->get_query_6(); NullCheck(L_6); String_t* L_7 = String_Substring_m2809233063(L_6, 1, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_8 = Uri_Unescape_m416590285(NULL /*static, unused*/, L_7, (bool)0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_9 = String_Concat_m389863537(NULL /*static, unused*/, L_5, L_8, /*hidden argument*/NULL); G_B4_0 = L_9; goto IL_0053; } IL_0047: { String_t* L_10 = __this->get_query_6(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_11 = Uri_Unescape_m416590285(NULL /*static, unused*/, L_10, (bool)0, /*hidden argument*/NULL); G_B4_0 = L_11; } IL_0053: { V_0 = G_B4_0; String_t** L_12 = ___result0; String_t** L_13 = ___result0; String_t* L_14 = V_0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_15 = String_Concat_m138640077(NULL /*static, unused*/, (*((String_t**)L_13)), L_14, /*hidden argument*/NULL); *((Il2CppObject **)(L_12)) = (Il2CppObject *)L_15; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_12), (Il2CppObject *)L_15); } IL_005e: { String_t* L_16 = __this->get_fragment_7(); NullCheck(L_16); int32_t L_17 = String_get_Length_m2979997331(L_16, /*hidden argument*/NULL); if ((((int32_t)L_17) <= ((int32_t)0))) { goto IL_007e; } } { String_t** L_18 = ___result0; String_t** L_19 = ___result0; String_t* L_20 = __this->get_fragment_7(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_21 = String_Concat_m138640077(NULL /*static, unused*/, (*((String_t**)L_19)), L_20, /*hidden argument*/NULL); *((Il2CppObject **)(L_18)) = (Il2CppObject *)L_21; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_18), (Il2CppObject *)L_21); } IL_007e: { return; } } // System.String System.Uri::ToString() extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern const uint32_t Uri_ToString_m967075364_MetadataUsageId; extern "C" String_t* Uri_ToString_m967075364 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_ToString_m967075364_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = __this->get_cachedToString_14(); if (!L_0) { goto IL_0012; } } { String_t* L_1 = __this->get_cachedToString_14(); return L_1; } IL_0012: { bool L_2 = __this->get_isAbsoluteUri_11(); if (!L_2) { goto IL_0035; } } { String_t* L_3 = Uri_GetLeftPart_m2866425188(__this, 2, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_4 = Uri_Unescape_m416590285(NULL /*static, unused*/, L_3, (bool)1, /*hidden argument*/NULL); __this->set_cachedToString_14(L_4); goto IL_0047; } IL_0035: { String_t* L_5 = __this->get_path_5(); String_t* L_6 = VirtFuncInvoker1< String_t*, String_t* >::Invoke(5 /* System.String System.Uri::Unescape(System.String) */, __this, L_5); __this->set_cachedToString_14(L_6); } IL_0047: { String_t** L_7 = __this->get_address_of_cachedToString_14(); Uri_AppendQueryAndFragment_m1562004088(__this, L_7, /*hidden argument*/NULL); String_t* L_8 = __this->get_cachedToString_14(); return L_8; } } // System.String System.Uri::EscapeString(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern const uint32_t Uri_EscapeString_m2453046424_MetadataUsageId; extern "C" String_t* Uri_EscapeString_m2453046424 (Il2CppObject * __this /* static, unused */, String_t* ___str0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_EscapeString_m2453046424_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___str0; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_1 = Uri_EscapeString_m1653334917(NULL /*static, unused*/, L_0, (bool)0, (bool)1, (bool)1, /*hidden argument*/NULL); return L_1; } } // System.String System.Uri::EscapeString(System.String,System.Boolean,System.Boolean,System.Boolean) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* StringBuilder_t3822575854_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* Encoding_t180559927_il2cpp_TypeInfo_var; extern Il2CppClass* CharU5BU5D_t3416858730_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral216535523; extern Il2CppCodeGenString* _stringLiteral2172317803; extern const uint32_t Uri_EscapeString_m1653334917_MetadataUsageId; extern "C" String_t* Uri_EscapeString_m1653334917 (Il2CppObject * __this /* static, unused */, String_t* ___str0, bool ___escapeReserved1, bool ___escapeHex2, bool ___escapeBrackets3, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_EscapeString_m1653334917_MetadataUsageId); s_Il2CppMethodIntialized = true; } StringBuilder_t3822575854 * V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; ByteU5BU5D_t58506160* V_3 = NULL; int32_t V_4 = 0; int32_t V_5 = 0; uint16_t V_6 = 0x0; { String_t* L_0 = ___str0; if (L_0) { goto IL_000c; } } { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_1 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); return L_1; } IL_000c: { StringBuilder_t3822575854 * L_2 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m135953004(L_2, /*hidden argument*/NULL); V_0 = L_2; String_t* L_3 = ___str0; NullCheck(L_3); int32_t L_4 = String_get_Length_m2979997331(L_3, /*hidden argument*/NULL); V_1 = L_4; V_2 = 0; goto IL_0105; } IL_0020: { String_t* L_5 = ___str0; int32_t L_6 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_7 = Uri_IsHexEncoding_m3196775920(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); if (!L_7) { goto IL_0044; } } { StringBuilder_t3822575854 * L_8 = V_0; String_t* L_9 = ___str0; int32_t L_10 = V_2; NullCheck(L_9); String_t* L_11 = String_Substring_m675079568(L_9, L_10, 3, /*hidden argument*/NULL); NullCheck(L_8); StringBuilder_Append_m3898090075(L_8, L_11, /*hidden argument*/NULL); int32_t L_12 = V_2; V_2 = ((int32_t)((int32_t)L_12+(int32_t)2)); goto IL_0101; } IL_0044: { IL2CPP_RUNTIME_CLASS_INIT(Encoding_t180559927_il2cpp_TypeInfo_var); Encoding_t180559927 * L_13 = Encoding_get_UTF8_m619558519(NULL /*static, unused*/, /*hidden argument*/NULL); CharU5BU5D_t3416858730* L_14 = ((CharU5BU5D_t3416858730*)SZArrayNew(CharU5BU5D_t3416858730_il2cpp_TypeInfo_var, (uint32_t)1)); String_t* L_15 = ___str0; int32_t L_16 = V_2; NullCheck(L_15); uint16_t L_17 = String_get_Chars_m3015341861(L_15, L_16, /*hidden argument*/NULL); NullCheck(L_14); IL2CPP_ARRAY_BOUNDS_CHECK(L_14, 0); (L_14)->SetAt(static_cast<il2cpp_array_size_t>(0), (uint16_t)L_17); NullCheck(L_13); ByteU5BU5D_t58506160* L_18 = VirtFuncInvoker1< ByteU5BU5D_t58506160*, CharU5BU5D_t3416858730* >::Invoke(12 /* System.Byte[] System.Text.Encoding::GetBytes(System.Char[]) */, L_13, L_14); V_3 = L_18; ByteU5BU5D_t58506160* L_19 = V_3; NullCheck(L_19); V_4 = (((int32_t)((int32_t)(((Il2CppArray *)L_19)->max_length)))); V_5 = 0; goto IL_00f8; } IL_006c: { ByteU5BU5D_t58506160* L_20 = V_3; int32_t L_21 = V_5; NullCheck(L_20); IL2CPP_ARRAY_BOUNDS_CHECK(L_20, L_21); int32_t L_22 = L_21; V_6 = (((int32_t)((uint16_t)((L_20)->GetAt(static_cast<il2cpp_array_size_t>(L_22)))))); uint16_t L_23 = V_6; if ((((int32_t)L_23) <= ((int32_t)((int32_t)32)))) { goto IL_00d6; } } { uint16_t L_24 = V_6; if ((((int32_t)L_24) >= ((int32_t)((int32_t)127)))) { goto IL_00d6; } } { uint16_t L_25 = V_6; NullCheck(_stringLiteral216535523); int32_t L_26 = String_IndexOf_m2775210486(_stringLiteral216535523, L_25, /*hidden argument*/NULL); if ((!(((uint32_t)L_26) == ((uint32_t)(-1))))) { goto IL_00d6; } } { bool L_27 = ___escapeHex2; if (!L_27) { goto IL_00a6; } } { uint16_t L_28 = V_6; if ((((int32_t)L_28) == ((int32_t)((int32_t)35)))) { goto IL_00d6; } } IL_00a6: { bool L_29 = ___escapeBrackets3; if (!L_29) { goto IL_00be; } } { uint16_t L_30 = V_6; if ((((int32_t)L_30) == ((int32_t)((int32_t)91)))) { goto IL_00d6; } } { uint16_t L_31 = V_6; if ((((int32_t)L_31) == ((int32_t)((int32_t)93)))) { goto IL_00d6; } } IL_00be: { bool L_32 = ___escapeReserved1; if (!L_32) { goto IL_00e9; } } { uint16_t L_33 = V_6; NullCheck(_stringLiteral2172317803); int32_t L_34 = String_IndexOf_m2775210486(_stringLiteral2172317803, L_33, /*hidden argument*/NULL); if ((((int32_t)L_34) == ((int32_t)(-1)))) { goto IL_00e9; } } IL_00d6: { StringBuilder_t3822575854 * L_35 = V_0; uint16_t L_36 = V_6; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_37 = Uri_HexEscape_m2779785335(NULL /*static, unused*/, L_36, /*hidden argument*/NULL); NullCheck(L_35); StringBuilder_Append_m3898090075(L_35, L_37, /*hidden argument*/NULL); goto IL_00f2; } IL_00e9: { StringBuilder_t3822575854 * L_38 = V_0; uint16_t L_39 = V_6; NullCheck(L_38); StringBuilder_Append_m2143093878(L_38, L_39, /*hidden argument*/NULL); } IL_00f2: { int32_t L_40 = V_5; V_5 = ((int32_t)((int32_t)L_40+(int32_t)1)); } IL_00f8: { int32_t L_41 = V_5; int32_t L_42 = V_4; if ((((int32_t)L_41) < ((int32_t)L_42))) { goto IL_006c; } } IL_0101: { int32_t L_43 = V_2; V_2 = ((int32_t)((int32_t)L_43+(int32_t)1)); } IL_0105: { int32_t L_44 = V_2; int32_t L_45 = V_1; if ((((int32_t)L_44) < ((int32_t)L_45))) { goto IL_0020; } } { StringBuilder_t3822575854 * L_46 = V_0; NullCheck(L_46); String_t* L_47 = StringBuilder_ToString_m350379841(L_46, /*hidden argument*/NULL); return L_47; } } // System.Void System.Uri::ParseUri(System.UriKind) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* CultureInfo_t3603717042_il2cpp_TypeInfo_var; extern const uint32_t Uri_ParseUri_m3771462925_MetadataUsageId; extern "C" void Uri_ParseUri_m3771462925 (Uri_t2776692961 * __this, int32_t ___kind0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_ParseUri_m3771462925_MetadataUsageId); s_Il2CppMethodIntialized = true; } { int32_t L_0 = ___kind0; String_t* L_1 = __this->get_source_1(); Uri_Parse_m561053531(__this, L_0, L_1, /*hidden argument*/NULL); bool L_2 = __this->get_userEscaped_12(); if (!L_2) { goto IL_0019; } } { return; } IL_0019: { String_t* L_3 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_4 = Uri_EscapeString_m1653334917(NULL /*static, unused*/, L_3, (bool)0, (bool)1, (bool)0, /*hidden argument*/NULL); __this->set_host_3(L_4); String_t* L_5 = __this->get_host_3(); NullCheck(L_5); int32_t L_6 = String_get_Length_m2979997331(L_5, /*hidden argument*/NULL); if ((((int32_t)L_6) <= ((int32_t)1))) { goto IL_0086; } } { String_t* L_7 = __this->get_host_3(); NullCheck(L_7); uint16_t L_8 = String_get_Chars_m3015341861(L_7, 0, /*hidden argument*/NULL); if ((((int32_t)L_8) == ((int32_t)((int32_t)91)))) { goto IL_0086; } } { String_t* L_9 = __this->get_host_3(); String_t* L_10 = __this->get_host_3(); NullCheck(L_10); int32_t L_11 = String_get_Length_m2979997331(L_10, /*hidden argument*/NULL); NullCheck(L_9); uint16_t L_12 = String_get_Chars_m3015341861(L_9, ((int32_t)((int32_t)L_11-(int32_t)1)), /*hidden argument*/NULL); if ((((int32_t)L_12) == ((int32_t)((int32_t)93)))) { goto IL_0086; } } { String_t* L_13 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3603717042_il2cpp_TypeInfo_var); CultureInfo_t3603717042 * L_14 = CultureInfo_get_InvariantCulture_m764001524(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_13); String_t* L_15 = String_ToLower_m2140020155(L_13, L_14, /*hidden argument*/NULL); __this->set_host_3(L_15); } IL_0086: { String_t* L_16 = __this->get_path_5(); NullCheck(L_16); int32_t L_17 = String_get_Length_m2979997331(L_16, /*hidden argument*/NULL); if ((((int32_t)L_17) <= ((int32_t)0))) { goto IL_00a8; } } { String_t* L_18 = __this->get_path_5(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_19 = Uri_EscapeString_m2453046424(NULL /*static, unused*/, L_18, /*hidden argument*/NULL); __this->set_path_5(L_19); } IL_00a8: { return; } } // System.String System.Uri::Unescape(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern const uint32_t Uri_Unescape_m4097037232_MetadataUsageId; extern "C" String_t* Uri_Unescape_m4097037232 (Uri_t2776692961 * __this, String_t* ___str0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_Unescape_m4097037232_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___str0; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_1 = Uri_Unescape_m416590285(NULL /*static, unused*/, L_0, (bool)0, /*hidden argument*/NULL); return L_1; } } // System.String System.Uri::Unescape(System.String,System.Boolean) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* StringBuilder_t3822575854_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral37158; extern Il2CppCodeGenString* _stringLiteral37160; extern Il2CppCodeGenString* _stringLiteral37208; extern const uint32_t Uri_Unescape_m416590285_MetadataUsageId; extern "C" String_t* Uri_Unescape_m416590285 (Il2CppObject * __this /* static, unused */, String_t* ___str0, bool ___excludeSpecial1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_Unescape_m416590285_MetadataUsageId); s_Il2CppMethodIntialized = true; } StringBuilder_t3822575854 * V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; uint16_t V_3 = 0x0; uint16_t V_4 = 0x0; uint16_t V_5 = 0x0; { String_t* L_0 = ___str0; if (L_0) { goto IL_000c; } } { IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_1 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); return L_1; } IL_000c: { StringBuilder_t3822575854 * L_2 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m135953004(L_2, /*hidden argument*/NULL); V_0 = L_2; String_t* L_3 = ___str0; NullCheck(L_3); int32_t L_4 = String_get_Length_m2979997331(L_3, /*hidden argument*/NULL); V_1 = L_4; V_2 = 0; goto IL_00ca; } IL_0020: { String_t* L_5 = ___str0; int32_t L_6 = V_2; NullCheck(L_5); uint16_t L_7 = String_get_Chars_m3015341861(L_5, L_6, /*hidden argument*/NULL); V_3 = L_7; uint16_t L_8 = V_3; if ((!(((uint32_t)L_8) == ((uint32_t)((int32_t)37))))) { goto IL_00be; } } { String_t* L_9 = ___str0; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); uint16_t L_10 = Uri_HexUnescapeMultiByte_m3269245053(NULL /*static, unused*/, L_9, (&V_2), (&V_4), /*hidden argument*/NULL); V_5 = L_10; bool L_11 = ___excludeSpecial1; if (!L_11) { goto IL_005c; } } { uint16_t L_12 = V_5; if ((!(((uint32_t)L_12) == ((uint32_t)((int32_t)35))))) { goto IL_005c; } } { StringBuilder_t3822575854 * L_13 = V_0; NullCheck(L_13); StringBuilder_Append_m3898090075(L_13, _stringLiteral37158, /*hidden argument*/NULL); goto IL_00b5; } IL_005c: { bool L_14 = ___excludeSpecial1; if (!L_14) { goto IL_007c; } } { uint16_t L_15 = V_5; if ((!(((uint32_t)L_15) == ((uint32_t)((int32_t)37))))) { goto IL_007c; } } { StringBuilder_t3822575854 * L_16 = V_0; NullCheck(L_16); StringBuilder_Append_m3898090075(L_16, _stringLiteral37160, /*hidden argument*/NULL); goto IL_00b5; } IL_007c: { bool L_17 = ___excludeSpecial1; if (!L_17) { goto IL_009c; } } { uint16_t L_18 = V_5; if ((!(((uint32_t)L_18) == ((uint32_t)((int32_t)63))))) { goto IL_009c; } } { StringBuilder_t3822575854 * L_19 = V_0; NullCheck(L_19); StringBuilder_Append_m3898090075(L_19, _stringLiteral37208, /*hidden argument*/NULL); goto IL_00b5; } IL_009c: { StringBuilder_t3822575854 * L_20 = V_0; uint16_t L_21 = V_5; NullCheck(L_20); StringBuilder_Append_m2143093878(L_20, L_21, /*hidden argument*/NULL); uint16_t L_22 = V_4; if (!L_22) { goto IL_00b5; } } { StringBuilder_t3822575854 * L_23 = V_0; uint16_t L_24 = V_4; NullCheck(L_23); StringBuilder_Append_m2143093878(L_23, L_24, /*hidden argument*/NULL); } IL_00b5: { int32_t L_25 = V_2; V_2 = ((int32_t)((int32_t)L_25-(int32_t)1)); goto IL_00c6; } IL_00be: { StringBuilder_t3822575854 * L_26 = V_0; uint16_t L_27 = V_3; NullCheck(L_26); StringBuilder_Append_m2143093878(L_26, L_27, /*hidden argument*/NULL); } IL_00c6: { int32_t L_28 = V_2; V_2 = ((int32_t)((int32_t)L_28+(int32_t)1)); } IL_00ca: { int32_t L_29 = V_2; int32_t L_30 = V_1; if ((((int32_t)L_29) < ((int32_t)L_30))) { goto IL_0020; } } { StringBuilder_t3822575854 * L_31 = V_0; NullCheck(L_31); String_t* L_32 = StringBuilder_ToString_m350379841(L_31, /*hidden argument*/NULL); return L_32; } } // System.Void System.Uri::ParseAsWindowsUNC(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* CharU5BU5D_t3416858730_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral92; extern Il2CppCodeGenString* _stringLiteral47; extern const uint32_t Uri_ParseAsWindowsUNC_m3032435497_MetadataUsageId; extern "C" void Uri_ParseAsWindowsUNC_m3032435497 (Uri_t2776692961 * __this, String_t* ___uriString0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_ParseAsWindowsUNC_m3032435497_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_0 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); __this->set_scheme_2(L_0); __this->set_port_4((-1)); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_1 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_fragment_7(L_1); String_t* L_2 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_query_6(L_2); __this->set_isUnc_9((bool)1); String_t* L_3 = ___uriString0; CharU5BU5D_t3416858730* L_4 = ((CharU5BU5D_t3416858730*)SZArrayNew(CharU5BU5D_t3416858730_il2cpp_TypeInfo_var, (uint32_t)1)); NullCheck(L_4); IL2CPP_ARRAY_BOUNDS_CHECK(L_4, 0); (L_4)->SetAt(static_cast<il2cpp_array_size_t>(0), (uint16_t)((int32_t)92)); NullCheck(L_3); String_t* L_5 = String_TrimStart_m3483716918(L_3, L_4, /*hidden argument*/NULL); ___uriString0 = L_5; String_t* L_6 = ___uriString0; NullCheck(L_6); int32_t L_7 = String_IndexOf_m2775210486(L_6, ((int32_t)92), /*hidden argument*/NULL); V_0 = L_7; int32_t L_8 = V_0; if ((((int32_t)L_8) <= ((int32_t)0))) { goto IL_0072; } } { String_t* L_9 = ___uriString0; int32_t L_10 = V_0; NullCheck(L_9); String_t* L_11 = String_Substring_m2809233063(L_9, L_10, /*hidden argument*/NULL); __this->set_path_5(L_11); String_t* L_12 = ___uriString0; int32_t L_13 = V_0; NullCheck(L_12); String_t* L_14 = String_Substring_m675079568(L_12, 0, L_13, /*hidden argument*/NULL); __this->set_host_3(L_14); goto IL_0084; } IL_0072: { String_t* L_15 = ___uriString0; __this->set_host_3(L_15); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_16 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_path_5(L_16); } IL_0084: { String_t* L_17 = __this->get_path_5(); NullCheck(L_17); String_t* L_18 = String_Replace_m2915759397(L_17, _stringLiteral92, _stringLiteral47, /*hidden argument*/NULL); __this->set_path_5(L_18); return; } } // System.String System.Uri::ParseAsWindowsAbsoluteFilePath(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2703689566; extern Il2CppCodeGenString* _stringLiteral92; extern Il2CppCodeGenString* _stringLiteral47; extern const uint32_t Uri_ParseAsWindowsAbsoluteFilePath_m1155471572_MetadataUsageId; extern "C" String_t* Uri_ParseAsWindowsAbsoluteFilePath_m1155471572 (Uri_t2776692961 * __this, String_t* ___uriString0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_ParseAsWindowsAbsoluteFilePath_m1155471572_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = ___uriString0; NullCheck(L_0); int32_t L_1 = String_get_Length_m2979997331(L_0, /*hidden argument*/NULL); if ((((int32_t)L_1) <= ((int32_t)2))) { goto IL_002e; } } { String_t* L_2 = ___uriString0; NullCheck(L_2); uint16_t L_3 = String_get_Chars_m3015341861(L_2, 2, /*hidden argument*/NULL); if ((((int32_t)L_3) == ((int32_t)((int32_t)92)))) { goto IL_002e; } } { String_t* L_4 = ___uriString0; NullCheck(L_4); uint16_t L_5 = String_get_Chars_m3015341861(L_4, 2, /*hidden argument*/NULL); if ((((int32_t)L_5) == ((int32_t)((int32_t)47)))) { goto IL_002e; } } { return _stringLiteral2703689566; } IL_002e: { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_6 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); __this->set_scheme_2(L_6); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_7 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_7); __this->set_port_4((-1)); String_t* L_8 = ___uriString0; NullCheck(L_8); String_t* L_9 = String_Replace_m2915759397(L_8, _stringLiteral92, _stringLiteral47, /*hidden argument*/NULL); __this->set_path_5(L_9); String_t* L_10 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_fragment_7(L_10); String_t* L_11 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_query_6(L_11); return (String_t*)NULL; } } // System.Void System.Uri::ParseAsUnixAbsoluteFilePath(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* CharU5BU5D_t3416858730_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern const uint32_t Uri_ParseAsUnixAbsoluteFilePath_m1730599600_MetadataUsageId; extern "C" void Uri_ParseAsUnixAbsoluteFilePath_m1730599600 (Uri_t2776692961 * __this, String_t* ___uriString0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_ParseAsUnixAbsoluteFilePath_m1730599600_MetadataUsageId); s_Il2CppMethodIntialized = true; } { __this->set_isUnixFilePath_0((bool)1); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_0 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); __this->set_scheme_2(L_0); __this->set_port_4((-1)); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_1 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_fragment_7(L_1); String_t* L_2 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_query_6(L_2); String_t* L_3 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_3); __this->set_path_5((String_t*)NULL); String_t* L_4 = ___uriString0; NullCheck(L_4); int32_t L_5 = String_get_Length_m2979997331(L_4, /*hidden argument*/NULL); if ((((int32_t)L_5) < ((int32_t)2))) { goto IL_008f; } } { String_t* L_6 = ___uriString0; NullCheck(L_6); uint16_t L_7 = String_get_Chars_m3015341861(L_6, 0, /*hidden argument*/NULL); if ((!(((uint32_t)L_7) == ((uint32_t)((int32_t)47))))) { goto IL_008f; } } { String_t* L_8 = ___uriString0; NullCheck(L_8); uint16_t L_9 = String_get_Chars_m3015341861(L_8, 1, /*hidden argument*/NULL); if ((!(((uint32_t)L_9) == ((uint32_t)((int32_t)47))))) { goto IL_008f; } } { String_t* L_10 = ___uriString0; CharU5BU5D_t3416858730* L_11 = ((CharU5BU5D_t3416858730*)SZArrayNew(CharU5BU5D_t3416858730_il2cpp_TypeInfo_var, (uint32_t)1)); NullCheck(L_11); IL2CPP_ARRAY_BOUNDS_CHECK(L_11, 0); (L_11)->SetAt(static_cast<il2cpp_array_size_t>(0), (uint16_t)((int32_t)47)); NullCheck(L_10); String_t* L_12 = String_TrimStart_m3483716918(L_10, L_11, /*hidden argument*/NULL); ___uriString0 = L_12; uint16_t L_13 = ((uint16_t)((int32_t)47)); Il2CppObject * L_14 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_13); String_t* L_15 = ___uriString0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_16 = String_Concat_m389863537(NULL /*static, unused*/, L_14, L_15, /*hidden argument*/NULL); __this->set_path_5(L_16); } IL_008f: { String_t* L_17 = __this->get_path_5(); if (L_17) { goto IL_00a1; } } { String_t* L_18 = ___uriString0; __this->set_path_5(L_18); } IL_00a1: { return; } } // System.Void System.Uri::Parse(System.UriKind,System.String) extern Il2CppClass* ArgumentNullException_t3214793280_il2cpp_TypeInfo_var; extern Il2CppClass* UriFormatException_t1145000641_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral1278562461; extern const uint32_t Uri_Parse_m561053531_MetadataUsageId; extern "C" void Uri_Parse_m561053531 (Uri_t2776692961 * __this, int32_t ___kind0, String_t* ___uriString1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_Parse_m561053531_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* V_0 = NULL; { String_t* L_0 = ___uriString1; if (L_0) { goto IL_0011; } } { ArgumentNullException_t3214793280 * L_1 = (ArgumentNullException_t3214793280 *)il2cpp_codegen_object_new(ArgumentNullException_t3214793280_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m135444188(L_1, _stringLiteral1278562461, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0011: { int32_t L_2 = ___kind0; String_t* L_3 = ___uriString1; String_t* L_4 = Uri_ParseNoExceptions_m2517263517(__this, L_2, L_3, /*hidden argument*/NULL); V_0 = L_4; String_t* L_5 = V_0; if (!L_5) { goto IL_0027; } } { String_t* L_6 = V_0; UriFormatException_t1145000641 * L_7 = (UriFormatException_t1145000641 *)il2cpp_codegen_object_new(UriFormatException_t1145000641_il2cpp_TypeInfo_var); UriFormatException__ctor_m3185454499(L_7, L_6, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_7); } IL_0027: { return; } } // System.String System.Uri::ParseNoExceptions(System.UriKind,System.String) extern Il2CppClass* Path_t2029632748_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* CultureInfo_t3603717042_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* IPv6Address_t256391031_il2cpp_TypeInfo_var; extern Il2CppClass* DefaultUriParser_t625205023_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral2471698679; extern Il2CppCodeGenString* _stringLiteral792217255; extern Il2CppCodeGenString* _stringLiteral3592878077; extern Il2CppCodeGenString* _stringLiteral2850759705; extern Il2CppCodeGenString* _stringLiteral35; extern Il2CppCodeGenString* _stringLiteral1521396000; extern Il2CppCodeGenString* _stringLiteral66243408; extern Il2CppCodeGenString* _stringLiteral47; extern Il2CppCodeGenString* _stringLiteral3048776310; extern Il2CppCodeGenString* _stringLiteral1504; extern Il2CppCodeGenString* _stringLiteral1843308621; extern Il2CppCodeGenString* _stringLiteral91; extern Il2CppCodeGenString* _stringLiteral93; extern Il2CppCodeGenString* _stringLiteral2850294089; extern Il2CppCodeGenString* _stringLiteral41; extern const uint32_t Uri_ParseNoExceptions_m2517263517_MetadataUsageId; extern "C" String_t* Uri_ParseNoExceptions_m2517263517 (Uri_t2776692961 * __this, int32_t ___kind0, String_t* ___uriString1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_ParseNoExceptions_m2517263517_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; String_t* V_2 = NULL; int32_t V_3 = 0; int32_t V_4 = 0; bool V_5 = false; bool V_6 = false; bool V_7 = false; int32_t V_8 = 0; int32_t V_9 = 0; String_t* V_10 = NULL; bool V_11 = false; IPv6Address_t256391031 * V_12 = NULL; UriFormatException_t1145000641 * V_13 = NULL; int32_t G_B50_0 = 0; int32_t G_B55_0 = 0; int32_t G_B57_0 = 0; int32_t G_B139_0 = 0; { String_t* L_0 = ___uriString1; NullCheck(L_0); String_t* L_1 = String_Trim_m1030489823(L_0, /*hidden argument*/NULL); ___uriString1 = L_1; String_t* L_2 = ___uriString1; NullCheck(L_2); int32_t L_3 = String_get_Length_m2979997331(L_2, /*hidden argument*/NULL); V_0 = L_3; int32_t L_4 = V_0; if (L_4) { goto IL_002b; } } { int32_t L_5 = ___kind0; if ((((int32_t)L_5) == ((int32_t)2))) { goto IL_0022; } } { int32_t L_6 = ___kind0; if (L_6) { goto IL_002b; } } IL_0022: { __this->set_isAbsoluteUri_11((bool)0); return (String_t*)NULL; } IL_002b: { int32_t L_7 = V_0; if ((((int32_t)L_7) > ((int32_t)1))) { goto IL_003f; } } { int32_t L_8 = ___kind0; if ((((int32_t)L_8) == ((int32_t)2))) { goto IL_003f; } } { return _stringLiteral2471698679; } IL_003f: { V_1 = 0; String_t* L_9 = ___uriString1; NullCheck(L_9); int32_t L_10 = String_IndexOf_m2775210486(L_9, ((int32_t)58), /*hidden argument*/NULL); V_1 = L_10; int32_t L_11 = V_1; if (L_11) { goto IL_0056; } } { return _stringLiteral792217255; } IL_0056: { int32_t L_12 = V_1; if ((((int32_t)L_12) >= ((int32_t)0))) { goto IL_00d5; } } { String_t* L_13 = ___uriString1; NullCheck(L_13); uint16_t L_14 = String_get_Chars_m3015341861(L_13, 0, /*hidden argument*/NULL); if ((!(((uint32_t)L_14) == ((uint32_t)((int32_t)47))))) { goto IL_0091; } } { IL2CPP_RUNTIME_CLASS_INIT(Path_t2029632748_il2cpp_TypeInfo_var); uint16_t L_15 = ((Path_t2029632748_StaticFields*)Path_t2029632748_il2cpp_TypeInfo_var->static_fields)->get_DirectorySeparatorChar_2(); if ((!(((uint32_t)L_15) == ((uint32_t)((int32_t)47))))) { goto IL_0091; } } { String_t* L_16 = ___uriString1; Uri_ParseAsUnixAbsoluteFilePath_m1730599600(__this, L_16, /*hidden argument*/NULL); int32_t L_17 = ___kind0; if ((!(((uint32_t)L_17) == ((uint32_t)2)))) { goto IL_008c; } } { __this->set_isAbsoluteUri_11((bool)0); } IL_008c: { goto IL_00d3; } IL_0091: { String_t* L_18 = ___uriString1; NullCheck(L_18); int32_t L_19 = String_get_Length_m2979997331(L_18, /*hidden argument*/NULL); if ((((int32_t)L_19) < ((int32_t)2))) { goto IL_00c5; } } { String_t* L_20 = ___uriString1; NullCheck(L_20); uint16_t L_21 = String_get_Chars_m3015341861(L_20, 0, /*hidden argument*/NULL); if ((!(((uint32_t)L_21) == ((uint32_t)((int32_t)92))))) { goto IL_00c5; } } { String_t* L_22 = ___uriString1; NullCheck(L_22); uint16_t L_23 = String_get_Chars_m3015341861(L_22, 1, /*hidden argument*/NULL); if ((!(((uint32_t)L_23) == ((uint32_t)((int32_t)92))))) { goto IL_00c5; } } { String_t* L_24 = ___uriString1; Uri_ParseAsWindowsUNC_m3032435497(__this, L_24, /*hidden argument*/NULL); goto IL_00d3; } IL_00c5: { __this->set_isAbsoluteUri_11((bool)0); String_t* L_25 = ___uriString1; __this->set_path_5(L_25); } IL_00d3: { return (String_t*)NULL; } IL_00d5: { int32_t L_26 = V_1; if ((!(((uint32_t)L_26) == ((uint32_t)1)))) { goto IL_0105; } } { String_t* L_27 = ___uriString1; NullCheck(L_27); uint16_t L_28 = String_get_Chars_m3015341861(L_27, 0, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_29 = Uri_IsAlpha_m171894930(NULL /*static, unused*/, L_28, /*hidden argument*/NULL); if (L_29) { goto IL_00f3; } } { return _stringLiteral3592878077; } IL_00f3: { String_t* L_30 = ___uriString1; String_t* L_31 = Uri_ParseAsWindowsAbsoluteFilePath_m1155471572(__this, L_30, /*hidden argument*/NULL); V_2 = L_31; String_t* L_32 = V_2; if (!L_32) { goto IL_0103; } } { String_t* L_33 = V_2; return L_33; } IL_0103: { return (String_t*)NULL; } IL_0105: { String_t* L_34 = ___uriString1; int32_t L_35 = V_1; NullCheck(L_34); String_t* L_36 = String_Substring_m675079568(L_34, 0, L_35, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3603717042_il2cpp_TypeInfo_var); CultureInfo_t3603717042 * L_37 = CultureInfo_get_InvariantCulture_m764001524(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_36); String_t* L_38 = String_ToLower_m2140020155(L_36, L_37, /*hidden argument*/NULL); __this->set_scheme_2(L_38); String_t* L_39 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_40 = Uri_CheckSchemeName_m3839723091(NULL /*static, unused*/, L_39, /*hidden argument*/NULL); if (L_40) { goto IL_0138; } } { String_t* L_41 = Locale_GetText_m3269873186(NULL /*static, unused*/, _stringLiteral2850759705, /*hidden argument*/NULL); return L_41; } IL_0138: { int32_t L_42 = V_1; V_3 = ((int32_t)((int32_t)L_42+(int32_t)1)); String_t* L_43 = ___uriString1; NullCheck(L_43); int32_t L_44 = String_get_Length_m2979997331(L_43, /*hidden argument*/NULL); V_4 = L_44; String_t* L_45 = ___uriString1; int32_t L_46 = V_3; NullCheck(L_45); int32_t L_47 = String_IndexOf_m204546721(L_45, ((int32_t)35), L_46, /*hidden argument*/NULL); V_1 = L_47; bool L_48 = Uri_get_IsUnc_m766729742(__this, /*hidden argument*/NULL); if (L_48) { goto IL_019e; } } { int32_t L_49 = V_1; if ((((int32_t)L_49) == ((int32_t)(-1)))) { goto IL_019e; } } { bool L_50 = __this->get_userEscaped_12(); if (!L_50) { goto IL_017d; } } { String_t* L_51 = ___uriString1; int32_t L_52 = V_1; NullCheck(L_51); String_t* L_53 = String_Substring_m2809233063(L_51, L_52, /*hidden argument*/NULL); __this->set_fragment_7(L_53); goto IL_019b; } IL_017d: { String_t* L_54 = ___uriString1; int32_t L_55 = V_1; NullCheck(L_54); String_t* L_56 = String_Substring_m2809233063(L_54, ((int32_t)((int32_t)L_55+(int32_t)1)), /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_57 = Uri_EscapeString_m2453046424(NULL /*static, unused*/, L_56, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_58 = String_Concat_m138640077(NULL /*static, unused*/, _stringLiteral35, L_57, /*hidden argument*/NULL); __this->set_fragment_7(L_58); } IL_019b: { int32_t L_59 = V_1; V_4 = L_59; } IL_019e: { String_t* L_60 = ___uriString1; int32_t L_61 = V_3; int32_t L_62 = V_4; int32_t L_63 = V_3; NullCheck(L_60); int32_t L_64 = String_IndexOf_m2077558742(L_60, ((int32_t)63), L_61, ((int32_t)((int32_t)L_62-(int32_t)L_63)), /*hidden argument*/NULL); V_1 = L_64; int32_t L_65 = V_1; if ((((int32_t)L_65) == ((int32_t)(-1)))) { goto IL_01e3; } } { String_t* L_66 = ___uriString1; int32_t L_67 = V_1; int32_t L_68 = V_4; int32_t L_69 = V_1; NullCheck(L_66); String_t* L_70 = String_Substring_m675079568(L_66, L_67, ((int32_t)((int32_t)L_68-(int32_t)L_69)), /*hidden argument*/NULL); __this->set_query_6(L_70); int32_t L_71 = V_1; V_4 = L_71; bool L_72 = __this->get_userEscaped_12(); if (L_72) { goto IL_01e3; } } { String_t* L_73 = __this->get_query_6(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_74 = Uri_EscapeString_m2453046424(NULL /*static, unused*/, L_73, /*hidden argument*/NULL); __this->set_query_6(L_74); } IL_01e3: { String_t* L_75 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_76 = Uri_IsPredefinedScheme_m2987522946(NULL /*static, unused*/, L_75, /*hidden argument*/NULL); if (!L_76) { goto IL_0255; } } { String_t* L_77 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_78 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_79 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_77, L_78, /*hidden argument*/NULL); if (!L_79) { goto IL_0255; } } { String_t* L_80 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_81 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_82 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_80, L_81, /*hidden argument*/NULL); if (!L_82) { goto IL_0255; } } { int32_t L_83 = V_4; int32_t L_84 = V_3; if ((((int32_t)((int32_t)((int32_t)L_83-(int32_t)L_84))) < ((int32_t)2))) { goto IL_024f; } } { int32_t L_85 = V_4; int32_t L_86 = V_3; if ((((int32_t)((int32_t)((int32_t)L_85-(int32_t)L_86))) < ((int32_t)2))) { goto IL_0255; } } { String_t* L_87 = ___uriString1; int32_t L_88 = V_3; NullCheck(L_87); uint16_t L_89 = String_get_Chars_m3015341861(L_87, L_88, /*hidden argument*/NULL); if ((!(((uint32_t)L_89) == ((uint32_t)((int32_t)47))))) { goto IL_0255; } } { String_t* L_90 = ___uriString1; int32_t L_91 = V_3; NullCheck(L_90); uint16_t L_92 = String_get_Chars_m3015341861(L_90, ((int32_t)((int32_t)L_91+(int32_t)1)), /*hidden argument*/NULL); if ((((int32_t)L_92) == ((int32_t)((int32_t)47)))) { goto IL_0255; } } IL_024f: { return _stringLiteral1521396000; } IL_0255: { int32_t L_93 = V_4; int32_t L_94 = V_3; if ((((int32_t)((int32_t)((int32_t)L_93-(int32_t)L_94))) < ((int32_t)2))) { goto IL_027c; } } { String_t* L_95 = ___uriString1; int32_t L_96 = V_3; NullCheck(L_95); uint16_t L_97 = String_get_Chars_m3015341861(L_95, L_96, /*hidden argument*/NULL); if ((!(((uint32_t)L_97) == ((uint32_t)((int32_t)47))))) { goto IL_027c; } } { String_t* L_98 = ___uriString1; int32_t L_99 = V_3; NullCheck(L_98); uint16_t L_100 = String_get_Chars_m3015341861(L_98, ((int32_t)((int32_t)L_99+(int32_t)1)), /*hidden argument*/NULL); G_B50_0 = ((((int32_t)L_100) == ((int32_t)((int32_t)47)))? 1 : 0); goto IL_027d; } IL_027c: { G_B50_0 = 0; } IL_027d: { V_5 = (bool)G_B50_0; String_t* L_101 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_102 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_103 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_101, L_102, /*hidden argument*/NULL); if (!L_103) { goto IL_02b7; } } { bool L_104 = V_5; if (!L_104) { goto IL_02b7; } } { int32_t L_105 = V_4; int32_t L_106 = V_3; if ((((int32_t)((int32_t)((int32_t)L_105-(int32_t)L_106))) == ((int32_t)2))) { goto IL_02b4; } } { String_t* L_107 = ___uriString1; int32_t L_108 = V_3; NullCheck(L_107); uint16_t L_109 = String_get_Chars_m3015341861(L_107, ((int32_t)((int32_t)L_108+(int32_t)2)), /*hidden argument*/NULL); G_B55_0 = ((((int32_t)L_109) == ((int32_t)((int32_t)47)))? 1 : 0); goto IL_02b5; } IL_02b4: { G_B55_0 = 1; } IL_02b5: { G_B57_0 = G_B55_0; goto IL_02b8; } IL_02b7: { G_B57_0 = 0; } IL_02b8: { V_6 = (bool)G_B57_0; V_7 = (bool)0; bool L_110 = V_5; if (!L_110) { goto IL_03a8; } } { int32_t L_111 = ___kind0; if ((!(((uint32_t)L_111) == ((uint32_t)2)))) { goto IL_02d1; } } { return _stringLiteral66243408; } IL_02d1: { String_t* L_112 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_113 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_114 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_112, L_113, /*hidden argument*/NULL); if (!L_114) { goto IL_02ff; } } { String_t* L_115 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_116 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_117 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_115, L_116, /*hidden argument*/NULL); if (!L_117) { goto IL_02ff; } } { int32_t L_118 = V_3; V_3 = ((int32_t)((int32_t)L_118+(int32_t)2)); } IL_02ff: { String_t* L_119 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_120 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_121 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_119, L_120, /*hidden argument*/NULL); if (!L_121) { goto IL_0383; } } { V_8 = 2; int32_t L_122 = V_3; V_9 = L_122; goto IL_033f; } IL_031f: { String_t* L_123 = ___uriString1; int32_t L_124 = V_9; NullCheck(L_123); uint16_t L_125 = String_get_Chars_m3015341861(L_123, L_124, /*hidden argument*/NULL); if ((((int32_t)L_125) == ((int32_t)((int32_t)47)))) { goto IL_0333; } } { goto IL_0348; } IL_0333: { int32_t L_126 = V_8; V_8 = ((int32_t)((int32_t)L_126+(int32_t)1)); int32_t L_127 = V_9; V_9 = ((int32_t)((int32_t)L_127+(int32_t)1)); } IL_033f: { int32_t L_128 = V_9; int32_t L_129 = V_4; if ((((int32_t)L_128) < ((int32_t)L_129))) { goto IL_031f; } } IL_0348: { int32_t L_130 = V_8; if ((((int32_t)L_130) < ((int32_t)4))) { goto IL_0377; } } { V_6 = (bool)0; goto IL_035c; } IL_0358: { int32_t L_131 = V_3; V_3 = ((int32_t)((int32_t)L_131+(int32_t)1)); } IL_035c: { int32_t L_132 = V_3; int32_t L_133 = V_4; if ((((int32_t)L_132) >= ((int32_t)L_133))) { goto IL_0372; } } { String_t* L_134 = ___uriString1; int32_t L_135 = V_3; NullCheck(L_134); uint16_t L_136 = String_get_Chars_m3015341861(L_134, L_135, /*hidden argument*/NULL); if ((((int32_t)L_136) == ((int32_t)((int32_t)47)))) { goto IL_0358; } } IL_0372: { goto IL_0383; } IL_0377: { int32_t L_137 = V_8; if ((((int32_t)L_137) < ((int32_t)3))) { goto IL_0383; } } { int32_t L_138 = V_3; V_3 = ((int32_t)((int32_t)L_138+(int32_t)1)); } IL_0383: { int32_t L_139 = V_4; int32_t L_140 = V_3; if ((((int32_t)((int32_t)((int32_t)L_139-(int32_t)L_140))) <= ((int32_t)1))) { goto IL_03a3; } } { String_t* L_141 = ___uriString1; int32_t L_142 = V_3; NullCheck(L_141); uint16_t L_143 = String_get_Chars_m3015341861(L_141, ((int32_t)((int32_t)L_142+(int32_t)1)), /*hidden argument*/NULL); if ((!(((uint32_t)L_143) == ((uint32_t)((int32_t)58))))) { goto IL_03a3; } } { V_6 = (bool)0; V_7 = (bool)1; } IL_03a3: { goto IL_03d2; } IL_03a8: { String_t* L_144 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_145 = Uri_IsPredefinedScheme_m2987522946(NULL /*static, unused*/, L_144, /*hidden argument*/NULL); if (L_145) { goto IL_03d2; } } { String_t* L_146 = ___uriString1; int32_t L_147 = V_3; int32_t L_148 = V_4; int32_t L_149 = V_3; NullCheck(L_146); String_t* L_150 = String_Substring_m675079568(L_146, L_147, ((int32_t)((int32_t)L_148-(int32_t)L_149)), /*hidden argument*/NULL); __this->set_path_5(L_150); __this->set_isOpaquePart_10((bool)1); return (String_t*)NULL; } IL_03d2: { bool L_151 = V_6; if (!L_151) { goto IL_03e0; } } { V_1 = (-1); goto IL_040a; } IL_03e0: { String_t* L_152 = ___uriString1; int32_t L_153 = V_3; int32_t L_154 = V_4; int32_t L_155 = V_3; NullCheck(L_152); int32_t L_156 = String_IndexOf_m2077558742(L_152, ((int32_t)47), L_153, ((int32_t)((int32_t)L_154-(int32_t)L_155)), /*hidden argument*/NULL); V_1 = L_156; int32_t L_157 = V_1; if ((!(((uint32_t)L_157) == ((uint32_t)(-1))))) { goto IL_040a; } } { bool L_158 = V_7; if (!L_158) { goto IL_040a; } } { String_t* L_159 = ___uriString1; int32_t L_160 = V_3; int32_t L_161 = V_4; int32_t L_162 = V_3; NullCheck(L_159); int32_t L_163 = String_IndexOf_m2077558742(L_159, ((int32_t)92), L_160, ((int32_t)((int32_t)L_161-(int32_t)L_162)), /*hidden argument*/NULL); V_1 = L_163; } IL_040a: { int32_t L_164 = V_1; if ((!(((uint32_t)L_164) == ((uint32_t)(-1))))) { goto IL_044b; } } { String_t* L_165 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_166 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_167 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_165, L_166, /*hidden argument*/NULL); if (!L_167) { goto IL_0446; } } { String_t* L_168 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_169 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_170 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_168, L_169, /*hidden argument*/NULL); if (!L_170) { goto IL_0446; } } { __this->set_path_5(_stringLiteral47); } IL_0446: { goto IL_045f; } IL_044b: { String_t* L_171 = ___uriString1; int32_t L_172 = V_1; int32_t L_173 = V_4; int32_t L_174 = V_1; NullCheck(L_171); String_t* L_175 = String_Substring_m675079568(L_171, L_172, ((int32_t)((int32_t)L_173-(int32_t)L_174)), /*hidden argument*/NULL); __this->set_path_5(L_175); int32_t L_176 = V_1; V_4 = L_176; } IL_045f: { bool L_177 = V_6; if (!L_177) { goto IL_046d; } } { V_1 = (-1); goto IL_047b; } IL_046d: { String_t* L_178 = ___uriString1; int32_t L_179 = V_3; int32_t L_180 = V_4; int32_t L_181 = V_3; NullCheck(L_178); int32_t L_182 = String_IndexOf_m2077558742(L_178, ((int32_t)64), L_179, ((int32_t)((int32_t)L_180-(int32_t)L_181)), /*hidden argument*/NULL); V_1 = L_182; } IL_047b: { int32_t L_183 = V_1; if ((((int32_t)L_183) == ((int32_t)(-1)))) { goto IL_0496; } } { String_t* L_184 = ___uriString1; int32_t L_185 = V_3; int32_t L_186 = V_1; int32_t L_187 = V_3; NullCheck(L_184); String_t* L_188 = String_Substring_m675079568(L_184, L_185, ((int32_t)((int32_t)L_186-(int32_t)L_187)), /*hidden argument*/NULL); __this->set_userinfo_8(L_188); int32_t L_189 = V_1; V_3 = ((int32_t)((int32_t)L_189+(int32_t)1)); } IL_0496: { __this->set_port_4((-1)); bool L_190 = V_6; if (!L_190) { goto IL_04ab; } } { V_1 = (-1); goto IL_04bc; } IL_04ab: { String_t* L_191 = ___uriString1; int32_t L_192 = V_4; int32_t L_193 = V_4; int32_t L_194 = V_3; NullCheck(L_191); int32_t L_195 = String_LastIndexOf_m434357900(L_191, ((int32_t)58), ((int32_t)((int32_t)L_192-(int32_t)1)), ((int32_t)((int32_t)L_193-(int32_t)L_194)), /*hidden argument*/NULL); V_1 = L_195; } IL_04bc: { int32_t L_196 = V_1; if ((((int32_t)L_196) == ((int32_t)(-1)))) { goto IL_0566; } } { int32_t L_197 = V_1; int32_t L_198 = V_4; if ((((int32_t)L_197) == ((int32_t)((int32_t)((int32_t)L_198-(int32_t)1))))) { goto IL_0566; } } { String_t* L_199 = ___uriString1; int32_t L_200 = V_1; int32_t L_201 = V_4; int32_t L_202 = V_1; NullCheck(L_199); String_t* L_203 = String_Substring_m675079568(L_199, ((int32_t)((int32_t)L_200+(int32_t)1)), ((int32_t)((int32_t)L_201-(int32_t)((int32_t)((int32_t)L_202+(int32_t)1)))), /*hidden argument*/NULL); V_10 = L_203; String_t* L_204 = V_10; NullCheck(L_204); int32_t L_205 = String_get_Length_m2979997331(L_204, /*hidden argument*/NULL); if ((((int32_t)L_205) <= ((int32_t)0))) { goto IL_0544; } } { String_t* L_206 = V_10; String_t* L_207 = V_10; NullCheck(L_207); int32_t L_208 = String_get_Length_m2979997331(L_207, /*hidden argument*/NULL); NullCheck(L_206); uint16_t L_209 = String_get_Chars_m3015341861(L_206, ((int32_t)((int32_t)L_208-(int32_t)1)), /*hidden argument*/NULL); if ((((int32_t)L_209) == ((int32_t)((int32_t)93)))) { goto IL_0544; } } { String_t* L_210 = V_10; IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3603717042_il2cpp_TypeInfo_var); CultureInfo_t3603717042 * L_211 = CultureInfo_get_InvariantCulture_m764001524(NULL /*static, unused*/, /*hidden argument*/NULL); int32_t* L_212 = __this->get_address_of_port_4(); bool L_213 = Int32_TryParse_m2457543725(NULL /*static, unused*/, L_210, 7, L_211, L_212, /*hidden argument*/NULL); if (!L_213) { goto IL_0536; } } { int32_t L_214 = __this->get_port_4(); if ((((int32_t)L_214) < ((int32_t)0))) { goto IL_0536; } } { int32_t L_215 = __this->get_port_4(); if ((((int32_t)L_215) <= ((int32_t)((int32_t)65535)))) { goto IL_053c; } } IL_0536: { return _stringLiteral3048776310; } IL_053c: { int32_t L_216 = V_1; V_4 = L_216; goto IL_0561; } IL_0544: { int32_t L_217 = __this->get_port_4(); if ((!(((uint32_t)L_217) == ((uint32_t)(-1))))) { goto IL_0561; } } { String_t* L_218 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_219 = Uri_GetDefaultPort_m711645873(NULL /*static, unused*/, L_218, /*hidden argument*/NULL); __this->set_port_4(L_219); } IL_0561: { goto IL_0583; } IL_0566: { int32_t L_220 = __this->get_port_4(); if ((!(((uint32_t)L_220) == ((uint32_t)(-1))))) { goto IL_0583; } } { String_t* L_221 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_222 = Uri_GetDefaultPort_m711645873(NULL /*static, unused*/, L_221, /*hidden argument*/NULL); __this->set_port_4(L_222); } IL_0583: { String_t* L_223 = ___uriString1; int32_t L_224 = V_3; int32_t L_225 = V_4; int32_t L_226 = V_3; NullCheck(L_223); String_t* L_227 = String_Substring_m675079568(L_223, L_224, ((int32_t)((int32_t)L_225-(int32_t)L_226)), /*hidden argument*/NULL); ___uriString1 = L_227; String_t* L_228 = ___uriString1; __this->set_host_3(L_228); bool L_229 = V_6; if (!L_229) { goto IL_05c7; } } { uint16_t L_230 = ((uint16_t)((int32_t)47)); Il2CppObject * L_231 = Box(Char_t2778706699_il2cpp_TypeInfo_var, &L_230); String_t* L_232 = ___uriString1; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_233 = String_Concat_m389863537(NULL /*static, unused*/, L_231, L_232, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_234 = Uri_Reduce_m1169795993(NULL /*static, unused*/, L_233, (bool)1, /*hidden argument*/NULL); __this->set_path_5(L_234); String_t* L_235 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_235); goto IL_071c; } IL_05c7: { String_t* L_236 = __this->get_host_3(); NullCheck(L_236); int32_t L_237 = String_get_Length_m2979997331(L_236, /*hidden argument*/NULL); if ((!(((uint32_t)L_237) == ((uint32_t)2)))) { goto IL_0612; } } { String_t* L_238 = __this->get_host_3(); NullCheck(L_238); uint16_t L_239 = String_get_Chars_m3015341861(L_238, 1, /*hidden argument*/NULL); if ((!(((uint32_t)L_239) == ((uint32_t)((int32_t)58))))) { goto IL_0612; } } { String_t* L_240 = __this->get_host_3(); String_t* L_241 = __this->get_path_5(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_242 = String_Concat_m138640077(NULL /*static, unused*/, L_240, L_241, /*hidden argument*/NULL); __this->set_path_5(L_242); String_t* L_243 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_243); goto IL_071c; } IL_0612: { bool L_244 = __this->get_isUnixFilePath_0(); if (!L_244) { goto IL_063a; } } { String_t* L_245 = ___uriString1; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_246 = String_Concat_m138640077(NULL /*static, unused*/, _stringLiteral1504, L_245, /*hidden argument*/NULL); ___uriString1 = L_246; String_t* L_247 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_247); goto IL_071c; } IL_063a: { String_t* L_248 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_249 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_250 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_248, L_249, /*hidden argument*/NULL); if (!L_250) { goto IL_065b; } } { __this->set_isUnc_9((bool)1); goto IL_071c; } IL_065b: { String_t* L_251 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_252 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_253 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_251, L_252, /*hidden argument*/NULL); if (!L_253) { goto IL_069d; } } { String_t* L_254 = __this->get_host_3(); NullCheck(L_254); int32_t L_255 = String_get_Length_m2979997331(L_254, /*hidden argument*/NULL); if ((((int32_t)L_255) <= ((int32_t)0))) { goto IL_0698; } } { String_t* L_256 = __this->get_host_3(); __this->set_path_5(L_256); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_257 = ((String_t_StaticFields*)String_t_il2cpp_TypeInfo_var->static_fields)->get_Empty_2(); __this->set_host_3(L_257); } IL_0698: { goto IL_071c; } IL_069d: { String_t* L_258 = __this->get_host_3(); NullCheck(L_258); int32_t L_259 = String_get_Length_m2979997331(L_258, /*hidden argument*/NULL); if (L_259) { goto IL_071c; } } { String_t* L_260 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_261 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeHttp_21(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_262 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_260, L_261, /*hidden argument*/NULL); if (L_262) { goto IL_0716; } } { String_t* L_263 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_264 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeGopher_20(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_265 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_263, L_264, /*hidden argument*/NULL); if (L_265) { goto IL_0716; } } { String_t* L_266 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_267 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNntp_25(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_268 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_266, L_267, /*hidden argument*/NULL); if (L_268) { goto IL_0716; } } { String_t* L_269 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_270 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeHttps_22(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_271 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_269, L_270, /*hidden argument*/NULL); if (L_271) { goto IL_0716; } } { String_t* L_272 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_273 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFtp_19(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_274 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_272, L_273, /*hidden argument*/NULL); if (!L_274) { goto IL_071c; } } IL_0716: { return _stringLiteral1843308621; } IL_071c: { String_t* L_275 = __this->get_host_3(); NullCheck(L_275); int32_t L_276 = String_get_Length_m2979997331(L_275, /*hidden argument*/NULL); if ((((int32_t)L_276) <= ((int32_t)0))) { goto IL_073d; } } { String_t* L_277 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_278 = Uri_CheckHostName_m294200959(NULL /*static, unused*/, L_277, /*hidden argument*/NULL); G_B139_0 = ((((int32_t)L_278) == ((int32_t)0))? 1 : 0); goto IL_073e; } IL_073d: { G_B139_0 = 0; } IL_073e: { V_11 = (bool)G_B139_0; bool L_279 = V_11; if (L_279) { goto IL_07c1; } } { String_t* L_280 = __this->get_host_3(); NullCheck(L_280); int32_t L_281 = String_get_Length_m2979997331(L_280, /*hidden argument*/NULL); if ((((int32_t)L_281) <= ((int32_t)1))) { goto IL_07c1; } } { String_t* L_282 = __this->get_host_3(); NullCheck(L_282); uint16_t L_283 = String_get_Chars_m3015341861(L_282, 0, /*hidden argument*/NULL); if ((!(((uint32_t)L_283) == ((uint32_t)((int32_t)91))))) { goto IL_07c1; } } { String_t* L_284 = __this->get_host_3(); String_t* L_285 = __this->get_host_3(); NullCheck(L_285); int32_t L_286 = String_get_Length_m2979997331(L_285, /*hidden argument*/NULL); NullCheck(L_284); uint16_t L_287 = String_get_Chars_m3015341861(L_284, ((int32_t)((int32_t)L_286-(int32_t)1)), /*hidden argument*/NULL); if ((!(((uint32_t)L_287) == ((uint32_t)((int32_t)93))))) { goto IL_07c1; } } { String_t* L_288 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(IPv6Address_t256391031_il2cpp_TypeInfo_var); bool L_289 = IPv6Address_TryParse_m711194034(NULL /*static, unused*/, L_288, (&V_12), /*hidden argument*/NULL); if (!L_289) { goto IL_07be; } } { IPv6Address_t256391031 * L_290 = V_12; NullCheck(L_290); String_t* L_291 = IPv6Address_ToString_m2548793323(L_290, (bool)1, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_292 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral91, L_291, _stringLiteral93, /*hidden argument*/NULL); __this->set_host_3(L_292); goto IL_07c1; } IL_07be: { V_11 = (bool)1; } IL_07c1: { bool L_293 = V_11; if (!L_293) { goto IL_07fe; } } { UriParser_t1660745760 * L_294 = Uri_get_Parser_m533607664(__this, /*hidden argument*/NULL); if (((DefaultUriParser_t625205023 *)IsInstClass(L_294, DefaultUriParser_t625205023_il2cpp_TypeInfo_var))) { goto IL_07e3; } } { UriParser_t1660745760 * L_295 = Uri_get_Parser_m533607664(__this, /*hidden argument*/NULL); if (L_295) { goto IL_07fe; } } IL_07e3: { String_t* L_296 = __this->get_host_3(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); String_t* L_297 = String_Concat_m1825781833(NULL /*static, unused*/, _stringLiteral2850294089, L_296, _stringLiteral41, /*hidden argument*/NULL); String_t* L_298 = Locale_GetText_m3269873186(NULL /*static, unused*/, L_297, /*hidden argument*/NULL); return L_298; } IL_07fe: { V_13 = (UriFormatException_t1145000641 *)NULL; UriParser_t1660745760 * L_299 = Uri_get_Parser_m533607664(__this, /*hidden argument*/NULL); if (!L_299) { goto IL_081a; } } { UriParser_t1660745760 * L_300 = Uri_get_Parser_m533607664(__this, /*hidden argument*/NULL); NullCheck(L_300); VirtActionInvoker2< Uri_t2776692961 *, UriFormatException_t1145000641 ** >::Invoke(4 /* System.Void System.UriParser::InitializeAndValidate(System.Uri,System.UriFormatException&) */, L_300, __this, (&V_13)); } IL_081a: { UriFormatException_t1145000641 * L_301 = V_13; if (!L_301) { goto IL_0829; } } { UriFormatException_t1145000641 * L_302 = V_13; NullCheck(L_302); String_t* L_303 = VirtFuncInvoker0< String_t* >::Invoke(6 /* System.String System.Exception::get_Message() */, L_302); return L_303; } IL_0829: { String_t* L_304 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_305 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_306 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_304, L_305, /*hidden argument*/NULL); if (!L_306) { goto IL_0884; } } { String_t* L_307 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_308 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_309 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_307, L_308, /*hidden argument*/NULL); if (!L_309) { goto IL_0884; } } { String_t* L_310 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_311 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_312 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_310, L_311, /*hidden argument*/NULL); if (!L_312) { goto IL_0884; } } { String_t* L_313 = __this->get_path_5(); String_t* L_314 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_315 = Uri_CompactEscaped_m2021013591(NULL /*static, unused*/, L_314, /*hidden argument*/NULL); String_t* L_316 = Uri_Reduce_m1169795993(NULL /*static, unused*/, L_313, L_315, /*hidden argument*/NULL); __this->set_path_5(L_316); } IL_0884: { return (String_t*)NULL; } } // System.Boolean System.Uri::CompactEscaped(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* Dictionary_2_t190145395_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m1958628151_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral3143036; extern Il2CppCodeGenString* _stringLiteral3213448; extern Il2CppCodeGenString* _stringLiteral99617003; extern Il2CppCodeGenString* _stringLiteral1246071647; extern Il2CppCodeGenString* _stringLiteral1841314832; extern const uint32_t Uri_CompactEscaped_m2021013591_MetadataUsageId; extern "C" bool Uri_CompactEscaped_m2021013591 (Il2CppObject * __this /* static, unused */, String_t* ___scheme0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_CompactEscaped_m2021013591_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* V_0 = NULL; Dictionary_2_t190145395 * V_1 = NULL; int32_t V_2 = 0; { String_t* L_0 = ___scheme0; V_0 = L_0; String_t* L_1 = V_0; if (!L_1) { goto IL_007a; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); Dictionary_2_t190145395 * L_2 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map15_31(); if (L_2) { goto IL_005b; } } { Dictionary_2_t190145395 * L_3 = (Dictionary_2_t190145395 *)il2cpp_codegen_object_new(Dictionary_2_t190145395_il2cpp_TypeInfo_var); Dictionary_2__ctor_m1958628151(L_3, 5, /*hidden argument*/Dictionary_2__ctor_m1958628151_MethodInfo_var); V_1 = L_3; Dictionary_2_t190145395 * L_4 = V_1; NullCheck(L_4); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_4, _stringLiteral3143036, 0); Dictionary_2_t190145395 * L_5 = V_1; NullCheck(L_5); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_5, _stringLiteral3213448, 0); Dictionary_2_t190145395 * L_6 = V_1; NullCheck(L_6); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_6, _stringLiteral99617003, 0); Dictionary_2_t190145395 * L_7 = V_1; NullCheck(L_7); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_7, _stringLiteral1246071647, 0); Dictionary_2_t190145395 * L_8 = V_1; NullCheck(L_8); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_8, _stringLiteral1841314832, 0); Dictionary_2_t190145395 * L_9 = V_1; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_U3CU3Ef__switchU24map15_31(L_9); } IL_005b: { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); Dictionary_2_t190145395 * L_10 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map15_31(); String_t* L_11 = V_0; NullCheck(L_10); bool L_12 = VirtFuncInvoker2< bool, String_t*, int32_t* >::Invoke(30 /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Int32>::TryGetValue(!0,!1&) */, L_10, L_11, (&V_2)); if (!L_12) { goto IL_007a; } } { int32_t L_13 = V_2; if (!L_13) { goto IL_0078; } } { goto IL_007a; } IL_0078: { return (bool)1; } IL_007a: { return (bool)0; } } // System.String System.Uri::Reduce(System.String,System.Boolean) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* StringBuilder_t3822575854_il2cpp_TypeInfo_var; extern Il2CppClass* Char_t2778706699_il2cpp_TypeInfo_var; extern Il2CppClass* ArrayList_t2121638921_il2cpp_TypeInfo_var; extern Il2CppClass* IEnumerator_t287207039_il2cpp_TypeInfo_var; extern Il2CppClass* IDisposable_t1628921374_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral47; extern Il2CppCodeGenString* _stringLiteral46; extern Il2CppCodeGenString* _stringLiteral1472; extern const uint32_t Uri_Reduce_m1169795993_MetadataUsageId; extern "C" String_t* Uri_Reduce_m1169795993 (Il2CppObject * __this /* static, unused */, String_t* ___path0, bool ___compact_escaped1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_Reduce_m1169795993_MetadataUsageId); s_Il2CppMethodIntialized = true; } StringBuilder_t3822575854 * V_0 = NULL; int32_t V_1 = 0; uint16_t V_2 = 0x0; uint16_t V_3 = 0x0; uint16_t V_4 = 0x0; ArrayList_t2121638921 * V_5 = NULL; int32_t V_6 = 0; int32_t V_7 = 0; String_t* V_8 = NULL; int32_t V_9 = 0; bool V_10 = false; String_t* V_11 = NULL; Il2CppObject * V_12 = NULL; uint16_t V_13 = 0x0; Il2CppObject * V_14 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { String_t* L_0 = ___path0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_1 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_0, _stringLiteral47, /*hidden argument*/NULL); if (!L_1) { goto IL_0012; } } { String_t* L_2 = ___path0; return L_2; } IL_0012: { StringBuilder_t3822575854 * L_3 = (StringBuilder_t3822575854 *)il2cpp_codegen_object_new(StringBuilder_t3822575854_il2cpp_TypeInfo_var); StringBuilder__ctor_m135953004(L_3, /*hidden argument*/NULL); V_0 = L_3; bool L_4 = ___compact_escaped1; if (!L_4) { goto IL_00f5; } } { V_1 = 0; goto IL_00dc; } IL_0025: { String_t* L_5 = ___path0; int32_t L_6 = V_1; NullCheck(L_5); uint16_t L_7 = String_get_Chars_m3015341861(L_5, L_6, /*hidden argument*/NULL); V_2 = L_7; uint16_t L_8 = V_2; V_13 = L_8; uint16_t L_9 = V_13; if ((((int32_t)L_9) == ((int32_t)((int32_t)37)))) { goto IL_0055; } } { uint16_t L_10 = V_13; if ((((int32_t)L_10) == ((int32_t)((int32_t)92)))) { goto IL_0047; } } { goto IL_00cb; } IL_0047: { StringBuilder_t3822575854 * L_11 = V_0; NullCheck(L_11); StringBuilder_Append_m2143093878(L_11, ((int32_t)47), /*hidden argument*/NULL); goto IL_00d8; } IL_0055: { int32_t L_12 = V_1; String_t* L_13 = ___path0; NullCheck(L_13); int32_t L_14 = String_get_Length_m2979997331(L_13, /*hidden argument*/NULL); if ((((int32_t)L_12) >= ((int32_t)((int32_t)((int32_t)L_14-(int32_t)2))))) { goto IL_00be; } } { String_t* L_15 = ___path0; int32_t L_16 = V_1; NullCheck(L_15); uint16_t L_17 = String_get_Chars_m3015341861(L_15, ((int32_t)((int32_t)L_16+(int32_t)1)), /*hidden argument*/NULL); V_3 = L_17; String_t* L_18 = ___path0; int32_t L_19 = V_1; NullCheck(L_18); uint16_t L_20 = String_get_Chars_m3015341861(L_18, ((int32_t)((int32_t)L_19+(int32_t)2)), /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Char_t2778706699_il2cpp_TypeInfo_var); uint16_t L_21 = Char_ToUpper_m3343442427(NULL /*static, unused*/, L_20, /*hidden argument*/NULL); V_4 = L_21; uint16_t L_22 = V_3; if ((!(((uint32_t)L_22) == ((uint32_t)((int32_t)50))))) { goto IL_008e; } } { uint16_t L_23 = V_4; if ((((int32_t)L_23) == ((int32_t)((int32_t)70)))) { goto IL_009f; } } IL_008e: { uint16_t L_24 = V_3; if ((!(((uint32_t)L_24) == ((uint32_t)((int32_t)53))))) { goto IL_00b1; } } { uint16_t L_25 = V_4; if ((!(((uint32_t)L_25) == ((uint32_t)((int32_t)67))))) { goto IL_00b1; } } IL_009f: { StringBuilder_t3822575854 * L_26 = V_0; NullCheck(L_26); StringBuilder_Append_m2143093878(L_26, ((int32_t)47), /*hidden argument*/NULL); int32_t L_27 = V_1; V_1 = ((int32_t)((int32_t)L_27+(int32_t)2)); goto IL_00b9; } IL_00b1: { StringBuilder_t3822575854 * L_28 = V_0; uint16_t L_29 = V_2; NullCheck(L_28); StringBuilder_Append_m2143093878(L_28, L_29, /*hidden argument*/NULL); } IL_00b9: { goto IL_00c6; } IL_00be: { StringBuilder_t3822575854 * L_30 = V_0; uint16_t L_31 = V_2; NullCheck(L_30); StringBuilder_Append_m2143093878(L_30, L_31, /*hidden argument*/NULL); } IL_00c6: { goto IL_00d8; } IL_00cb: { StringBuilder_t3822575854 * L_32 = V_0; uint16_t L_33 = V_2; NullCheck(L_32); StringBuilder_Append_m2143093878(L_32, L_33, /*hidden argument*/NULL); goto IL_00d8; } IL_00d8: { int32_t L_34 = V_1; V_1 = ((int32_t)((int32_t)L_34+(int32_t)1)); } IL_00dc: { int32_t L_35 = V_1; String_t* L_36 = ___path0; NullCheck(L_36); int32_t L_37 = String_get_Length_m2979997331(L_36, /*hidden argument*/NULL); if ((((int32_t)L_35) < ((int32_t)L_37))) { goto IL_0025; } } { StringBuilder_t3822575854 * L_38 = V_0; NullCheck(L_38); String_t* L_39 = StringBuilder_ToString_m350379841(L_38, /*hidden argument*/NULL); ___path0 = L_39; goto IL_0101; } IL_00f5: { String_t* L_40 = ___path0; NullCheck(L_40); String_t* L_41 = String_Replace_m3369701083(L_40, ((int32_t)92), ((int32_t)47), /*hidden argument*/NULL); ___path0 = L_41; } IL_0101: { ArrayList_t2121638921 * L_42 = (ArrayList_t2121638921 *)il2cpp_codegen_object_new(ArrayList_t2121638921_il2cpp_TypeInfo_var); ArrayList__ctor_m1878432947(L_42, /*hidden argument*/NULL); V_5 = L_42; V_6 = 0; goto IL_01a3; } IL_0110: { String_t* L_43 = ___path0; int32_t L_44 = V_6; NullCheck(L_43); int32_t L_45 = String_IndexOf_m204546721(L_43, ((int32_t)47), L_44, /*hidden argument*/NULL); V_7 = L_45; int32_t L_46 = V_7; if ((!(((uint32_t)L_46) == ((uint32_t)(-1))))) { goto IL_012c; } } { String_t* L_47 = ___path0; NullCheck(L_47); int32_t L_48 = String_get_Length_m2979997331(L_47, /*hidden argument*/NULL); V_7 = L_48; } IL_012c: { String_t* L_49 = ___path0; int32_t L_50 = V_6; int32_t L_51 = V_7; int32_t L_52 = V_6; NullCheck(L_49); String_t* L_53 = String_Substring_m675079568(L_49, L_50, ((int32_t)((int32_t)L_51-(int32_t)L_52)), /*hidden argument*/NULL); V_8 = L_53; int32_t L_54 = V_7; V_6 = ((int32_t)((int32_t)L_54+(int32_t)1)); String_t* L_55 = V_8; NullCheck(L_55); int32_t L_56 = String_get_Length_m2979997331(L_55, /*hidden argument*/NULL); if (!L_56) { goto IL_015e; } } { String_t* L_57 = V_8; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_58 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_57, _stringLiteral46, /*hidden argument*/NULL); if (!L_58) { goto IL_0163; } } IL_015e: { goto IL_01a3; } IL_0163: { String_t* L_59 = V_8; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_60 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_59, _stringLiteral1472, /*hidden argument*/NULL); if (!L_60) { goto IL_0199; } } { ArrayList_t2121638921 * L_61 = V_5; NullCheck(L_61); int32_t L_62 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_61); V_9 = L_62; int32_t L_63 = V_9; if (L_63) { goto IL_0189; } } { goto IL_01a3; } IL_0189: { ArrayList_t2121638921 * L_64 = V_5; int32_t L_65 = V_9; NullCheck(L_64); VirtActionInvoker1< int32_t >::Invoke(35 /* System.Void System.Collections.ArrayList::RemoveAt(System.Int32) */, L_64, ((int32_t)((int32_t)L_65-(int32_t)1))); goto IL_01a3; } IL_0199: { ArrayList_t2121638921 * L_66 = V_5; String_t* L_67 = V_8; NullCheck(L_66); VirtFuncInvoker1< int32_t, Il2CppObject * >::Invoke(26 /* System.Int32 System.Collections.ArrayList::Add(System.Object) */, L_66, L_67); } IL_01a3: { int32_t L_68 = V_6; String_t* L_69 = ___path0; NullCheck(L_69); int32_t L_70 = String_get_Length_m2979997331(L_69, /*hidden argument*/NULL); if ((((int32_t)L_68) < ((int32_t)L_70))) { goto IL_0110; } } { ArrayList_t2121638921 * L_71 = V_5; NullCheck(L_71); int32_t L_72 = VirtFuncInvoker0< int32_t >::Invoke(20 /* System.Int32 System.Collections.ArrayList::get_Count() */, L_71); if (L_72) { goto IL_01c2; } } { return _stringLiteral47; } IL_01c2: { StringBuilder_t3822575854 * L_73 = V_0; NullCheck(L_73); StringBuilder_set_Length_m1952332172(L_73, 0, /*hidden argument*/NULL); String_t* L_74 = ___path0; NullCheck(L_74); uint16_t L_75 = String_get_Chars_m3015341861(L_74, 0, /*hidden argument*/NULL); if ((!(((uint32_t)L_75) == ((uint32_t)((int32_t)47))))) { goto IL_01e0; } } { StringBuilder_t3822575854 * L_76 = V_0; NullCheck(L_76); StringBuilder_Append_m2143093878(L_76, ((int32_t)47), /*hidden argument*/NULL); } IL_01e0: { V_10 = (bool)1; ArrayList_t2121638921 * L_77 = V_5; NullCheck(L_77); Il2CppObject * L_78 = VirtFuncInvoker0< Il2CppObject * >::Invoke(39 /* System.Collections.IEnumerator System.Collections.ArrayList::GetEnumerator() */, L_77); V_12 = L_78; } IL_01ec: try { // begin try (depth: 1) { goto IL_0220; } IL_01f1: { Il2CppObject * L_79 = V_12; NullCheck(L_79); Il2CppObject * L_80 = InterfaceFuncInvoker0< Il2CppObject * >::Invoke(0 /* System.Object System.Collections.IEnumerator::get_Current() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_79); V_11 = ((String_t*)CastclassSealed(L_80, String_t_il2cpp_TypeInfo_var)); bool L_81 = V_10; if (!L_81) { goto IL_020e; } } IL_0206: { V_10 = (bool)0; goto IL_0217; } IL_020e: { StringBuilder_t3822575854 * L_82 = V_0; NullCheck(L_82); StringBuilder_Append_m2143093878(L_82, ((int32_t)47), /*hidden argument*/NULL); } IL_0217: { StringBuilder_t3822575854 * L_83 = V_0; String_t* L_84 = V_11; NullCheck(L_83); StringBuilder_Append_m3898090075(L_83, L_84, /*hidden argument*/NULL); } IL_0220: { Il2CppObject * L_85 = V_12; NullCheck(L_85); bool L_86 = InterfaceFuncInvoker0< bool >::Invoke(1 /* System.Boolean System.Collections.IEnumerator::MoveNext() */, IEnumerator_t287207039_il2cpp_TypeInfo_var, L_85); if (L_86) { goto IL_01f1; } } IL_022c: { IL2CPP_LEAVE(0x247, FINALLY_0231); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_0231; } FINALLY_0231: { // begin finally (depth: 1) { Il2CppObject * L_87 = V_12; V_14 = ((Il2CppObject *)IsInst(L_87, IDisposable_t1628921374_il2cpp_TypeInfo_var)); Il2CppObject * L_88 = V_14; if (L_88) { goto IL_023f; } } IL_023e: { IL2CPP_END_FINALLY(561) } IL_023f: { Il2CppObject * L_89 = V_14; NullCheck(L_89); InterfaceActionInvoker0::Invoke(0 /* System.Void System.IDisposable::Dispose() */, IDisposable_t1628921374_il2cpp_TypeInfo_var, L_89); IL2CPP_END_FINALLY(561) } } // end finally (depth: 1) IL2CPP_CLEANUP(561) { IL2CPP_JUMP_TBL(0x247, IL_0247) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0247: { String_t* L_90 = ___path0; NullCheck(L_90); bool L_91 = String_EndsWith_m2265568550(L_90, _stringLiteral47, /*hidden argument*/NULL); if (!L_91) { goto IL_0260; } } { StringBuilder_t3822575854 * L_92 = V_0; NullCheck(L_92); StringBuilder_Append_m2143093878(L_92, ((int32_t)47), /*hidden argument*/NULL); } IL_0260: { StringBuilder_t3822575854 * L_93 = V_0; NullCheck(L_93); String_t* L_94 = StringBuilder_ToString_m350379841(L_93, /*hidden argument*/NULL); return L_94; } } // System.Char System.Uri::HexUnescapeMultiByte(System.String,System.Int32&,System.Char&) extern Il2CppClass* ArgumentException_t124305799_il2cpp_TypeInfo_var; extern Il2CppClass* ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* ByteU5BU5D_t58506160_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3503877008; extern Il2CppCodeGenString* _stringLiteral100346066; extern const uint32_t Uri_HexUnescapeMultiByte_m3269245053_MetadataUsageId; extern "C" uint16_t Uri_HexUnescapeMultiByte_m3269245053 (Il2CppObject * __this /* static, unused */, String_t* ___pattern0, int32_t* ___index1, uint16_t* ___surrogate2, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_HexUnescapeMultiByte_m3269245053_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; int32_t V_1 = 0; int32_t V_2 = 0; int32_t V_3 = 0; int32_t V_4 = 0; ByteU5BU5D_t58506160* V_5 = NULL; bool V_6 = false; int32_t V_7 = 0; int32_t V_8 = 0; int32_t V_9 = 0; uint8_t V_10 = 0x0; int32_t V_11 = 0; int32_t V_12 = 0; int32_t V_13 = 0; { uint16_t* L_0 = ___surrogate2; *((int16_t*)(L_0)) = (int16_t)0; String_t* L_1 = ___pattern0; if (L_1) { goto IL_0014; } } { ArgumentException_t124305799 * L_2 = (ArgumentException_t124305799 *)il2cpp_codegen_object_new(ArgumentException_t124305799_il2cpp_TypeInfo_var); ArgumentException__ctor_m3544856547(L_2, _stringLiteral3503877008, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_2); } IL_0014: { int32_t* L_3 = ___index1; if ((((int32_t)(*((int32_t*)L_3))) < ((int32_t)0))) { goto IL_0029; } } { int32_t* L_4 = ___index1; String_t* L_5 = ___pattern0; NullCheck(L_5); int32_t L_6 = String_get_Length_m2979997331(L_5, /*hidden argument*/NULL); if ((((int32_t)(*((int32_t*)L_4))) < ((int32_t)L_6))) { goto IL_0034; } } IL_0029: { ArgumentOutOfRangeException_t3479058991 * L_7 = (ArgumentOutOfRangeException_t3479058991 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t3479058991_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m2026296331(L_7, _stringLiteral100346066, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_7); } IL_0034: { String_t* L_8 = ___pattern0; int32_t* L_9 = ___index1; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_10 = Uri_IsHexEncoding_m3196775920(NULL /*static, unused*/, L_8, (*((int32_t*)L_9)), /*hidden argument*/NULL); if (L_10) { goto IL_0053; } } { String_t* L_11 = ___pattern0; int32_t* L_12 = ___index1; int32_t* L_13 = ___index1; int32_t L_14 = (*((int32_t*)L_13)); V_13 = L_14; *((int32_t*)(L_12)) = (int32_t)((int32_t)((int32_t)L_14+(int32_t)1)); int32_t L_15 = V_13; NullCheck(L_11); uint16_t L_16 = String_get_Chars_m3015341861(L_11, L_15, /*hidden argument*/NULL); return L_16; } IL_0053: { int32_t* L_17 = ___index1; int32_t* L_18 = ___index1; int32_t L_19 = (*((int32_t*)L_18)); V_13 = L_19; *((int32_t*)(L_17)) = (int32_t)((int32_t)((int32_t)L_19+(int32_t)1)); int32_t L_20 = V_13; V_0 = L_20; String_t* L_21 = ___pattern0; int32_t* L_22 = ___index1; int32_t* L_23 = ___index1; int32_t L_24 = (*((int32_t*)L_23)); V_13 = L_24; *((int32_t*)(L_22)) = (int32_t)((int32_t)((int32_t)L_24+(int32_t)1)); int32_t L_25 = V_13; NullCheck(L_21); uint16_t L_26 = String_get_Chars_m3015341861(L_21, L_25, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_27 = Uri_FromHex_m2865381007(NULL /*static, unused*/, L_26, /*hidden argument*/NULL); V_1 = L_27; String_t* L_28 = ___pattern0; int32_t* L_29 = ___index1; int32_t* L_30 = ___index1; int32_t L_31 = (*((int32_t*)L_30)); V_13 = L_31; *((int32_t*)(L_29)) = (int32_t)((int32_t)((int32_t)L_31+(int32_t)1)); int32_t L_32 = V_13; NullCheck(L_28); uint16_t L_33 = String_get_Chars_m3015341861(L_28, L_32, /*hidden argument*/NULL); int32_t L_34 = Uri_FromHex_m2865381007(NULL /*static, unused*/, L_33, /*hidden argument*/NULL); V_2 = L_34; int32_t L_35 = V_1; V_3 = L_35; V_4 = 0; goto IL_00a1; } IL_0097: { int32_t L_36 = V_4; V_4 = ((int32_t)((int32_t)L_36+(int32_t)1)); int32_t L_37 = V_3; V_3 = ((int32_t)((int32_t)L_37<<(int32_t)1)); } IL_00a1: { int32_t L_38 = V_3; if ((((int32_t)((int32_t)((int32_t)L_38&(int32_t)8))) == ((int32_t)8))) { goto IL_0097; } } { int32_t L_39 = V_4; if ((((int32_t)L_39) > ((int32_t)1))) { goto IL_00b9; } } { int32_t L_40 = V_1; int32_t L_41 = V_2; return (((int32_t)((uint16_t)((int32_t)((int32_t)((int32_t)((int32_t)L_40<<(int32_t)4))|(int32_t)L_41))))); } IL_00b9: { int32_t L_42 = V_4; V_5 = ((ByteU5BU5D_t58506160*)SZArrayNew(ByteU5BU5D_t58506160_il2cpp_TypeInfo_var, (uint32_t)L_42)); V_6 = (bool)0; ByteU5BU5D_t58506160* L_43 = V_5; int32_t L_44 = V_1; int32_t L_45 = V_2; NullCheck(L_43); IL2CPP_ARRAY_BOUNDS_CHECK(L_43, 0); (L_43)->SetAt(static_cast<il2cpp_array_size_t>(0), (uint8_t)(((int32_t)((uint8_t)((int32_t)((int32_t)((int32_t)((int32_t)L_44<<(int32_t)4))|(int32_t)L_45)))))); V_7 = 1; goto IL_014b; } IL_00d7: { String_t* L_46 = ___pattern0; int32_t* L_47 = ___index1; int32_t* L_48 = ___index1; int32_t L_49 = (*((int32_t*)L_48)); V_13 = L_49; *((int32_t*)(L_47)) = (int32_t)((int32_t)((int32_t)L_49+(int32_t)1)); int32_t L_50 = V_13; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); bool L_51 = Uri_IsHexEncoding_m3196775920(NULL /*static, unused*/, L_46, L_50, /*hidden argument*/NULL); if (L_51) { goto IL_00f5; } } { V_6 = (bool)1; goto IL_0154; } IL_00f5: { String_t* L_52 = ___pattern0; int32_t* L_53 = ___index1; int32_t* L_54 = ___index1; int32_t L_55 = (*((int32_t*)L_54)); V_13 = L_55; *((int32_t*)(L_53)) = (int32_t)((int32_t)((int32_t)L_55+(int32_t)1)); int32_t L_56 = V_13; NullCheck(L_52); uint16_t L_57 = String_get_Chars_m3015341861(L_52, L_56, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_58 = Uri_FromHex_m2865381007(NULL /*static, unused*/, L_57, /*hidden argument*/NULL); V_8 = L_58; int32_t L_59 = V_8; if ((((int32_t)((int32_t)((int32_t)L_59&(int32_t)((int32_t)12)))) == ((int32_t)8))) { goto IL_0120; } } { V_6 = (bool)1; goto IL_0154; } IL_0120: { String_t* L_60 = ___pattern0; int32_t* L_61 = ___index1; int32_t* L_62 = ___index1; int32_t L_63 = (*((int32_t*)L_62)); V_13 = L_63; *((int32_t*)(L_61)) = (int32_t)((int32_t)((int32_t)L_63+(int32_t)1)); int32_t L_64 = V_13; NullCheck(L_60); uint16_t L_65 = String_get_Chars_m3015341861(L_60, L_64, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); int32_t L_66 = Uri_FromHex_m2865381007(NULL /*static, unused*/, L_65, /*hidden argument*/NULL); V_9 = L_66; ByteU5BU5D_t58506160* L_67 = V_5; int32_t L_68 = V_7; int32_t L_69 = V_8; int32_t L_70 = V_9; NullCheck(L_67); IL2CPP_ARRAY_BOUNDS_CHECK(L_67, L_68); (L_67)->SetAt(static_cast<il2cpp_array_size_t>(L_68), (uint8_t)(((int32_t)((uint8_t)((int32_t)((int32_t)((int32_t)((int32_t)L_69<<(int32_t)4))|(int32_t)L_70)))))); int32_t L_71 = V_7; V_7 = ((int32_t)((int32_t)L_71+(int32_t)1)); } IL_014b: { int32_t L_72 = V_7; int32_t L_73 = V_4; if ((((int32_t)L_72) < ((int32_t)L_73))) { goto IL_00d7; } } IL_0154: { bool L_74 = V_6; if (!L_74) { goto IL_0166; } } { int32_t* L_75 = ___index1; int32_t L_76 = V_0; *((int32_t*)(L_75)) = (int32_t)((int32_t)((int32_t)L_76+(int32_t)3)); ByteU5BU5D_t58506160* L_77 = V_5; NullCheck(L_77); IL2CPP_ARRAY_BOUNDS_CHECK(L_77, 0); int32_t L_78 = 0; return (((int32_t)((uint16_t)((L_77)->GetAt(static_cast<il2cpp_array_size_t>(L_78)))))); } IL_0166: { V_10 = ((int32_t)255); uint8_t L_79 = V_10; int32_t L_80 = V_4; V_10 = (((int32_t)((uint8_t)((int32_t)((int32_t)L_79>>(int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_80+(int32_t)1))&(int32_t)((int32_t)31)))))))); ByteU5BU5D_t58506160* L_81 = V_5; NullCheck(L_81); IL2CPP_ARRAY_BOUNDS_CHECK(L_81, 0); int32_t L_82 = 0; uint8_t L_83 = V_10; V_11 = ((int32_t)((int32_t)((L_81)->GetAt(static_cast<il2cpp_array_size_t>(L_82)))&(int32_t)L_83)); V_12 = 1; goto IL_01a4; } IL_018b: { int32_t L_84 = V_11; V_11 = ((int32_t)((int32_t)L_84<<(int32_t)6)); int32_t L_85 = V_11; ByteU5BU5D_t58506160* L_86 = V_5; int32_t L_87 = V_12; NullCheck(L_86); IL2CPP_ARRAY_BOUNDS_CHECK(L_86, L_87); int32_t L_88 = L_87; V_11 = ((int32_t)((int32_t)L_85|(int32_t)((int32_t)((int32_t)((L_86)->GetAt(static_cast<il2cpp_array_size_t>(L_88)))&(int32_t)((int32_t)63))))); int32_t L_89 = V_12; V_12 = ((int32_t)((int32_t)L_89+(int32_t)1)); } IL_01a4: { int32_t L_90 = V_12; int32_t L_91 = V_4; if ((((int32_t)L_90) < ((int32_t)L_91))) { goto IL_018b; } } { int32_t L_92 = V_11; if ((((int32_t)L_92) > ((int32_t)((int32_t)65535)))) { goto IL_01bd; } } { int32_t L_93 = V_11; return (((int32_t)((uint16_t)L_93))); } IL_01bd: { int32_t L_94 = V_11; V_11 = ((int32_t)((int32_t)L_94-(int32_t)((int32_t)65536))); uint16_t* L_95 = ___surrogate2; int32_t L_96 = V_11; *((int16_t*)(L_95)) = (int16_t)(((int32_t)((uint16_t)((int32_t)((int32_t)((int32_t)((int32_t)L_96&(int32_t)((int32_t)1023)))|(int32_t)((int32_t)56320)))))); int32_t L_97 = V_11; return (((int32_t)((uint16_t)((int32_t)((int32_t)((int32_t)((int32_t)L_97>>(int32_t)((int32_t)10)))|(int32_t)((int32_t)55296)))))); } } // System.String System.Uri::GetSchemeDelimiter(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern const uint32_t Uri_GetSchemeDelimiter_m1914409694_MetadataUsageId; extern "C" String_t* Uri_GetSchemeDelimiter_m1914409694 (Il2CppObject * __this /* static, unused */, String_t* ___scheme0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_GetSchemeDelimiter_m1914409694_MetadataUsageId); s_Il2CppMethodIntialized = true; } int32_t V_0 = 0; { V_0 = 0; goto IL_0037; } IL_0007: { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); UriSchemeU5BU5D_t1246605964* L_0 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_schemes_28(); int32_t L_1 = V_0; NullCheck(L_0); IL2CPP_ARRAY_BOUNDS_CHECK(L_0, L_1); String_t* L_2 = ((L_0)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_1)))->get_scheme_0(); String_t* L_3 = ___scheme0; IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_4 = String_op_Equality_m1260523650(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); if (!L_4) { goto IL_0033; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); UriSchemeU5BU5D_t1246605964* L_5 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_schemes_28(); int32_t L_6 = V_0; NullCheck(L_5); IL2CPP_ARRAY_BOUNDS_CHECK(L_5, L_6); String_t* L_7 = ((L_5)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_6)))->get_delimiter_1(); return L_7; } IL_0033: { int32_t L_8 = V_0; V_0 = ((int32_t)((int32_t)L_8+(int32_t)1)); } IL_0037: { int32_t L_9 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); UriSchemeU5BU5D_t1246605964* L_10 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_schemes_28(); NullCheck(L_10); if ((((int32_t)L_9) < ((int32_t)(((int32_t)((int32_t)(((Il2CppArray *)L_10)->max_length))))))) { goto IL_0007; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_11 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_SchemeDelimiter_17(); return L_11; } } // System.Int32 System.Uri::GetDefaultPort(System.String) extern Il2CppClass* UriParser_t1660745760_il2cpp_TypeInfo_var; extern const uint32_t Uri_GetDefaultPort_m711645873_MetadataUsageId; extern "C" int32_t Uri_GetDefaultPort_m711645873 (Il2CppObject * __this /* static, unused */, String_t* ___scheme0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_GetDefaultPort_m711645873_MetadataUsageId); s_Il2CppMethodIntialized = true; } UriParser_t1660745760 * V_0 = NULL; { String_t* L_0 = ___scheme0; IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); UriParser_t1660745760 * L_1 = UriParser_GetParser_m635613298(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); V_0 = L_1; UriParser_t1660745760 * L_2 = V_0; if (L_2) { goto IL_000f; } } { return (-1); } IL_000f: { UriParser_t1660745760 * L_3 = V_0; NullCheck(L_3); int32_t L_4 = UriParser_get_DefaultPort_m3728184791(L_3, /*hidden argument*/NULL); return L_4; } } // System.String System.Uri::GetOpaqueWiseSchemeDelimiter() extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral58; extern const uint32_t Uri_GetOpaqueWiseSchemeDelimiter_m3781205887_MetadataUsageId; extern "C" String_t* Uri_GetOpaqueWiseSchemeDelimiter_m3781205887 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_GetOpaqueWiseSchemeDelimiter_m3781205887_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = __this->get_isOpaquePart_10(); if (!L_0) { goto IL_0011; } } { return _stringLiteral58; } IL_0011: { String_t* L_1 = __this->get_scheme_2(); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_2 = Uri_GetSchemeDelimiter_m1914409694(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); return L_2; } } // System.Boolean System.Uri::IsPredefinedScheme(System.String) extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppClass* Dictionary_2_t190145395_il2cpp_TypeInfo_var; extern const MethodInfo* Dictionary_2__ctor_m1958628151_MethodInfo_var; extern Il2CppCodeGenString* _stringLiteral3213448; extern Il2CppCodeGenString* _stringLiteral99617003; extern Il2CppCodeGenString* _stringLiteral3143036; extern Il2CppCodeGenString* _stringLiteral101730; extern Il2CppCodeGenString* _stringLiteral3386428; extern Il2CppCodeGenString* _stringLiteral3054753165; extern Il2CppCodeGenString* _stringLiteral3213394546; extern Il2CppCodeGenString* _stringLiteral3377875; extern Il2CppCodeGenString* _stringLiteral1246071647; extern Il2CppCodeGenString* _stringLiteral1841314832; extern const uint32_t Uri_IsPredefinedScheme_m2987522946_MetadataUsageId; extern "C" bool Uri_IsPredefinedScheme_m2987522946 (Il2CppObject * __this /* static, unused */, String_t* ___scheme0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_IsPredefinedScheme_m2987522946_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* V_0 = NULL; Dictionary_2_t190145395 * V_1 = NULL; int32_t V_2 = 0; { String_t* L_0 = ___scheme0; V_0 = L_0; String_t* L_1 = V_0; if (!L_1) { goto IL_00b7; } } { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); Dictionary_2_t190145395 * L_2 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map16_32(); if (L_2) { goto IL_0098; } } { Dictionary_2_t190145395 * L_3 = (Dictionary_2_t190145395 *)il2cpp_codegen_object_new(Dictionary_2_t190145395_il2cpp_TypeInfo_var); Dictionary_2__ctor_m1958628151(L_3, ((int32_t)10), /*hidden argument*/Dictionary_2__ctor_m1958628151_MethodInfo_var); V_1 = L_3; Dictionary_2_t190145395 * L_4 = V_1; NullCheck(L_4); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_4, _stringLiteral3213448, 0); Dictionary_2_t190145395 * L_5 = V_1; NullCheck(L_5); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_5, _stringLiteral99617003, 0); Dictionary_2_t190145395 * L_6 = V_1; NullCheck(L_6); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_6, _stringLiteral3143036, 0); Dictionary_2_t190145395 * L_7 = V_1; NullCheck(L_7); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_7, _stringLiteral101730, 0); Dictionary_2_t190145395 * L_8 = V_1; NullCheck(L_8); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_8, _stringLiteral3386428, 0); Dictionary_2_t190145395 * L_9 = V_1; NullCheck(L_9); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_9, _stringLiteral3054753165, 0); Dictionary_2_t190145395 * L_10 = V_1; NullCheck(L_10); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_10, _stringLiteral3213394546, 0); Dictionary_2_t190145395 * L_11 = V_1; NullCheck(L_11); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_11, _stringLiteral3377875, 0); Dictionary_2_t190145395 * L_12 = V_1; NullCheck(L_12); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_12, _stringLiteral1246071647, 0); Dictionary_2_t190145395 * L_13 = V_1; NullCheck(L_13); VirtActionInvoker2< String_t*, int32_t >::Invoke(25 /* System.Void System.Collections.Generic.Dictionary`2<System.String,System.Int32>::Add(!0,!1) */, L_13, _stringLiteral1841314832, 0); Dictionary_2_t190145395 * L_14 = V_1; IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->set_U3CU3Ef__switchU24map16_32(L_14); } IL_0098: { IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); Dictionary_2_t190145395 * L_15 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_U3CU3Ef__switchU24map16_32(); String_t* L_16 = V_0; NullCheck(L_15); bool L_17 = VirtFuncInvoker2< bool, String_t*, int32_t* >::Invoke(30 /* System.Boolean System.Collections.Generic.Dictionary`2<System.String,System.Int32>::TryGetValue(!0,!1&) */, L_15, L_16, (&V_2)); if (!L_17) { goto IL_00b7; } } { int32_t L_18 = V_2; if (!L_18) { goto IL_00b5; } } { goto IL_00b7; } IL_00b5: { return (bool)1; } IL_00b7: { return (bool)0; } } // System.UriParser System.Uri::get_Parser() extern Il2CppClass* UriParser_t1660745760_il2cpp_TypeInfo_var; extern Il2CppClass* DefaultUriParser_t625205023_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral42; extern const uint32_t Uri_get_Parser_m533607664_MetadataUsageId; extern "C" UriParser_t1660745760 * Uri_get_Parser_m533607664 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_get_Parser_m533607664_MetadataUsageId); s_Il2CppMethodIntialized = true; } { UriParser_t1660745760 * L_0 = __this->get_parser_29(); if (L_0) { goto IL_0037; } } { String_t* L_1 = Uri_get_Scheme_m2606456870(__this, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); UriParser_t1660745760 * L_2 = UriParser_GetParser_m635613298(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); __this->set_parser_29(L_2); UriParser_t1660745760 * L_3 = __this->get_parser_29(); if (L_3) { goto IL_0037; } } { DefaultUriParser_t625205023 * L_4 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m2197038465(L_4, _stringLiteral42, /*hidden argument*/NULL); __this->set_parser_29(L_4); } IL_0037: { UriParser_t1660745760 * L_5 = __this->get_parser_29(); return L_5; } } // System.Void System.Uri::EnsureAbsoluteUri() extern Il2CppClass* InvalidOperationException_t2420574324_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral1730173606; extern const uint32_t Uri_EnsureAbsoluteUri_m3407571844_MetadataUsageId; extern "C" void Uri_EnsureAbsoluteUri_m3407571844 (Uri_t2776692961 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (Uri_EnsureAbsoluteUri_m3407571844_MetadataUsageId); s_Il2CppMethodIntialized = true; } { bool L_0 = Uri_get_IsAbsoluteUri_m145672153(__this, /*hidden argument*/NULL); if (L_0) { goto IL_0016; } } { InvalidOperationException_t2420574324 * L_1 = (InvalidOperationException_t2420574324 *)il2cpp_codegen_object_new(InvalidOperationException_t2420574324_il2cpp_TypeInfo_var); InvalidOperationException__ctor_m1485483280(L_1, _stringLiteral1730173606, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1); } IL_0016: { return; } } // System.Boolean System.Uri::op_Equality(System.Uri,System.Uri) extern "C" bool Uri_op_Equality_m877019543 (Il2CppObject * __this /* static, unused */, Uri_t2776692961 * ___u10, Uri_t2776692961 * ___u21, const MethodInfo* method) { { Uri_t2776692961 * L_0 = ___u10; Uri_t2776692961 * L_1 = ___u21; bool L_2 = Object_Equals_m3175838359(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); return L_2; } } // System.Void System.Uri/UriScheme::.ctor(System.String,System.String,System.Int32) extern "C" void UriScheme__ctor_m535258662 (UriScheme_t3266528785 * __this, String_t* ___s0, String_t* ___d1, int32_t ___p2, const MethodInfo* method) { { String_t* L_0 = ___s0; __this->set_scheme_0(L_0); String_t* L_1 = ___d1; __this->set_delimiter_1(L_1); int32_t L_2 = ___p2; __this->set_defaultPort_2(L_2); return; } } // Conversion methods for marshalling of: System.Uri/UriScheme extern "C" void UriScheme_t3266528785_marshal_pinvoke(const UriScheme_t3266528785& unmarshaled, UriScheme_t3266528785_marshaled_pinvoke& marshaled) { marshaled.___scheme_0 = il2cpp_codegen_marshal_string(unmarshaled.get_scheme_0()); marshaled.___delimiter_1 = il2cpp_codegen_marshal_string(unmarshaled.get_delimiter_1()); marshaled.___defaultPort_2 = unmarshaled.get_defaultPort_2(); } extern "C" void UriScheme_t3266528785_marshal_pinvoke_back(const UriScheme_t3266528785_marshaled_pinvoke& marshaled, UriScheme_t3266528785& unmarshaled) { unmarshaled.set_scheme_0(il2cpp_codegen_marshal_string_result(marshaled.___scheme_0)); unmarshaled.set_delimiter_1(il2cpp_codegen_marshal_string_result(marshaled.___delimiter_1)); int32_t unmarshaled_defaultPort_temp = 0; unmarshaled_defaultPort_temp = marshaled.___defaultPort_2; unmarshaled.set_defaultPort_2(unmarshaled_defaultPort_temp); } // Conversion method for clean up from marshalling of: System.Uri/UriScheme extern "C" void UriScheme_t3266528785_marshal_pinvoke_cleanup(UriScheme_t3266528785_marshaled_pinvoke& marshaled) { il2cpp_codegen_marshal_free(marshaled.___scheme_0); marshaled.___scheme_0 = NULL; il2cpp_codegen_marshal_free(marshaled.___delimiter_1); marshaled.___delimiter_1 = NULL; } // Conversion methods for marshalling of: System.Uri/UriScheme extern "C" void UriScheme_t3266528785_marshal_com(const UriScheme_t3266528785& unmarshaled, UriScheme_t3266528785_marshaled_com& marshaled) { marshaled.___scheme_0 = il2cpp_codegen_marshal_bstring(unmarshaled.get_scheme_0()); marshaled.___delimiter_1 = il2cpp_codegen_marshal_bstring(unmarshaled.get_delimiter_1()); marshaled.___defaultPort_2 = unmarshaled.get_defaultPort_2(); } extern "C" void UriScheme_t3266528785_marshal_com_back(const UriScheme_t3266528785_marshaled_com& marshaled, UriScheme_t3266528785& unmarshaled) { unmarshaled.set_scheme_0(il2cpp_codegen_marshal_bstring_result(marshaled.___scheme_0)); unmarshaled.set_delimiter_1(il2cpp_codegen_marshal_bstring_result(marshaled.___delimiter_1)); int32_t unmarshaled_defaultPort_temp = 0; unmarshaled_defaultPort_temp = marshaled.___defaultPort_2; unmarshaled.set_defaultPort_2(unmarshaled_defaultPort_temp); } // Conversion method for clean up from marshalling of: System.Uri/UriScheme extern "C" void UriScheme_t3266528785_marshal_com_cleanup(UriScheme_t3266528785_marshaled_com& marshaled) { il2cpp_codegen_marshal_free_bstring(marshaled.___scheme_0); marshaled.___scheme_0 = NULL; il2cpp_codegen_marshal_free_bstring(marshaled.___delimiter_1); marshaled.___delimiter_1 = NULL; } // System.Void System.UriFormatException::.ctor() extern Il2CppCodeGenString* _stringLiteral32201524; extern const uint32_t UriFormatException__ctor_m2977644479_MetadataUsageId; extern "C" void UriFormatException__ctor_m2977644479 (UriFormatException_t1145000641 * __this, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (UriFormatException__ctor_m2977644479_MetadataUsageId); s_Il2CppMethodIntialized = true; } { String_t* L_0 = Locale_GetText_m3269873186(NULL /*static, unused*/, _stringLiteral32201524, /*hidden argument*/NULL); FormatException__ctor_m27151337(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void System.UriFormatException::.ctor(System.String) extern "C" void UriFormatException__ctor_m3185454499 (UriFormatException_t1145000641 * __this, String_t* ___message0, const MethodInfo* method) { { String_t* L_0 = ___message0; FormatException__ctor_m27151337(__this, L_0, /*hidden argument*/NULL); return; } } // System.Void System.UriFormatException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UriFormatException__ctor_m262177920 (UriFormatException_t1145000641 * __this, SerializationInfo_t2995724695 * ___info0, StreamingContext_t986364934 ___context1, const MethodInfo* method) { { SerializationInfo_t2995724695 * L_0 = ___info0; StreamingContext_t986364934 L_1 = ___context1; FormatException__ctor_m173965690(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void System.UriFormatException::System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UriFormatException_System_Runtime_Serialization_ISerializable_GetObjectData_m2011642604 (UriFormatException_t1145000641 * __this, SerializationInfo_t2995724695 * ___info0, StreamingContext_t986364934 ___context1, const MethodInfo* method) { { SerializationInfo_t2995724695 * L_0 = ___info0; StreamingContext_t986364934 L_1 = ___context1; Exception_GetObjectData_m1945031808(__this, L_0, L_1, /*hidden argument*/NULL); return; } } // System.Void System.UriParser::.ctor() extern "C" void UriParser__ctor_m3933763184 (UriParser_t1660745760 * __this, const MethodInfo* method) { { Object__ctor_m1772956182(__this, /*hidden argument*/NULL); return; } } // System.Void System.UriParser::.cctor() extern Il2CppClass* Il2CppObject_il2cpp_TypeInfo_var; extern Il2CppClass* UriParser_t1660745760_il2cpp_TypeInfo_var; extern Il2CppClass* Regex_t3802381858_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3057722339; extern Il2CppCodeGenString* _stringLiteral3989333014; extern const uint32_t UriParser__cctor_m1205478205_MetadataUsageId; extern "C" void UriParser__cctor_m1205478205 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (UriParser__cctor_m1205478205_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Il2CppObject * L_0 = (Il2CppObject *)il2cpp_codegen_object_new(Il2CppObject_il2cpp_TypeInfo_var); Object__ctor_m1772956182(L_0, /*hidden argument*/NULL); ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->set_lock_object_0(L_0); Regex_t3802381858 * L_1 = (Regex_t3802381858 *)il2cpp_codegen_object_new(Regex_t3802381858_il2cpp_TypeInfo_var); Regex__ctor_m2980635200(L_1, _stringLiteral3057722339, /*hidden argument*/NULL); ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->set_uri_regex_4(L_1); Regex_t3802381858 * L_2 = (Regex_t3802381858 *)il2cpp_codegen_object_new(Regex_t3802381858_il2cpp_TypeInfo_var); Regex__ctor_m2980635200(L_2, _stringLiteral3989333014, /*hidden argument*/NULL); ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->set_auth_regex_5(L_2); return; } } // System.Void System.UriParser::InitializeAndValidate(System.Uri,System.UriFormatException&) extern Il2CppClass* String_t_il2cpp_TypeInfo_var; extern Il2CppClass* UriFormatException_t1145000641_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral42; extern Il2CppCodeGenString* _stringLiteral4198658576; extern const uint32_t UriParser_InitializeAndValidate_m3968058349_MetadataUsageId; extern "C" void UriParser_InitializeAndValidate_m3968058349 (UriParser_t1660745760 * __this, Uri_t2776692961 * ___uri0, UriFormatException_t1145000641 ** ___parsingError1, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (UriParser_InitializeAndValidate_m3968058349_MetadataUsageId); s_Il2CppMethodIntialized = true; } { Uri_t2776692961 * L_0 = ___uri0; NullCheck(L_0); String_t* L_1 = Uri_get_Scheme_m2606456870(L_0, /*hidden argument*/NULL); String_t* L_2 = __this->get_scheme_name_2(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_3 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_1, L_2, /*hidden argument*/NULL); if (!L_3) { goto IL_003c; } } { String_t* L_4 = __this->get_scheme_name_2(); IL2CPP_RUNTIME_CLASS_INIT(String_t_il2cpp_TypeInfo_var); bool L_5 = String_op_Inequality_m2125462205(NULL /*static, unused*/, L_4, _stringLiteral42, /*hidden argument*/NULL); if (!L_5) { goto IL_003c; } } { UriFormatException_t1145000641 ** L_6 = ___parsingError1; UriFormatException_t1145000641 * L_7 = (UriFormatException_t1145000641 *)il2cpp_codegen_object_new(UriFormatException_t1145000641_il2cpp_TypeInfo_var); UriFormatException__ctor_m3185454499(L_7, _stringLiteral4198658576, /*hidden argument*/NULL); *((Il2CppObject **)(L_6)) = (Il2CppObject *)L_7; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_6), (Il2CppObject *)L_7); goto IL_003f; } IL_003c: { UriFormatException_t1145000641 ** L_8 = ___parsingError1; *((Il2CppObject **)(L_8)) = (Il2CppObject *)NULL; Il2CppCodeGenWriteBarrier((Il2CppObject **)(L_8), (Il2CppObject *)NULL); } IL_003f: { return; } } // System.Void System.UriParser::OnRegister(System.String,System.Int32) extern "C" void UriParser_OnRegister_m3986311499 (UriParser_t1660745760 * __this, String_t* ___schemeName0, int32_t ___defaultPort1, const MethodInfo* method) { { return; } } // System.Void System.UriParser::set_SchemeName(System.String) extern "C" void UriParser_set_SchemeName_m706252033 (UriParser_t1660745760 * __this, String_t* ___value0, const MethodInfo* method) { { String_t* L_0 = ___value0; __this->set_scheme_name_2(L_0); return; } } // System.Int32 System.UriParser::get_DefaultPort() extern "C" int32_t UriParser_get_DefaultPort_m3728184791 (UriParser_t1660745760 * __this, const MethodInfo* method) { { int32_t L_0 = __this->get_default_port_3(); return L_0; } } // System.Void System.UriParser::set_DefaultPort(System.Int32) extern "C" void UriParser_set_DefaultPort_m1019606244 (UriParser_t1660745760 * __this, int32_t ___value0, const MethodInfo* method) { { int32_t L_0 = ___value0; __this->set_default_port_3(L_0); return; } } // System.Void System.UriParser::CreateDefaults() extern Il2CppClass* UriParser_t1660745760_il2cpp_TypeInfo_var; extern Il2CppClass* Hashtable_t3875263730_il2cpp_TypeInfo_var; extern Il2CppClass* DefaultUriParser_t625205023_il2cpp_TypeInfo_var; extern Il2CppClass* Uri_t2776692961_il2cpp_TypeInfo_var; extern Il2CppCodeGenString* _stringLiteral3316647; extern const uint32_t UriParser_CreateDefaults_m2648397058_MetadataUsageId; extern "C" void UriParser_CreateDefaults_m2648397058 (Il2CppObject * __this /* static, unused */, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (UriParser_CreateDefaults_m2648397058_MetadataUsageId); s_Il2CppMethodIntialized = true; } Hashtable_t3875263730 * V_0 = NULL; Il2CppObject * V_1 = NULL; Exception_t1967233988 * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t1967233988 * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); Hashtable_t3875263730 * L_0 = ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->get_table_1(); if (!L_0) { goto IL_000b; } } { return; } IL_000b: { Hashtable_t3875263730 * L_1 = (Hashtable_t3875263730 *)il2cpp_codegen_object_new(Hashtable_t3875263730_il2cpp_TypeInfo_var); Hashtable__ctor_m1514037738(L_1, /*hidden argument*/NULL); V_0 = L_1; Hashtable_t3875263730 * L_2 = V_0; DefaultUriParser_t625205023 * L_3 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_3, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Uri_t2776692961_il2cpp_TypeInfo_var); String_t* L_4 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFile_18(); IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_2, L_3, L_4, (-1), /*hidden argument*/NULL); Hashtable_t3875263730 * L_5 = V_0; DefaultUriParser_t625205023 * L_6 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_6, /*hidden argument*/NULL); String_t* L_7 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeFtp_19(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_5, L_6, L_7, ((int32_t)21), /*hidden argument*/NULL); Hashtable_t3875263730 * L_8 = V_0; DefaultUriParser_t625205023 * L_9 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_9, /*hidden argument*/NULL); String_t* L_10 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeGopher_20(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_8, L_9, L_10, ((int32_t)70), /*hidden argument*/NULL); Hashtable_t3875263730 * L_11 = V_0; DefaultUriParser_t625205023 * L_12 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_12, /*hidden argument*/NULL); String_t* L_13 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeHttp_21(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_11, L_12, L_13, ((int32_t)80), /*hidden argument*/NULL); Hashtable_t3875263730 * L_14 = V_0; DefaultUriParser_t625205023 * L_15 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_15, /*hidden argument*/NULL); String_t* L_16 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeHttps_22(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_14, L_15, L_16, ((int32_t)443), /*hidden argument*/NULL); Hashtable_t3875263730 * L_17 = V_0; DefaultUriParser_t625205023 * L_18 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_18, /*hidden argument*/NULL); String_t* L_19 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeMailto_23(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_17, L_18, L_19, ((int32_t)25), /*hidden argument*/NULL); Hashtable_t3875263730 * L_20 = V_0; DefaultUriParser_t625205023 * L_21 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_21, /*hidden argument*/NULL); String_t* L_22 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNetPipe_26(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_20, L_21, L_22, (-1), /*hidden argument*/NULL); Hashtable_t3875263730 * L_23 = V_0; DefaultUriParser_t625205023 * L_24 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_24, /*hidden argument*/NULL); String_t* L_25 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNetTcp_27(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_23, L_24, L_25, (-1), /*hidden argument*/NULL); Hashtable_t3875263730 * L_26 = V_0; DefaultUriParser_t625205023 * L_27 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_27, /*hidden argument*/NULL); String_t* L_28 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNews_24(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_26, L_27, L_28, ((int32_t)119), /*hidden argument*/NULL); Hashtable_t3875263730 * L_29 = V_0; DefaultUriParser_t625205023 * L_30 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_30, /*hidden argument*/NULL); String_t* L_31 = ((Uri_t2776692961_StaticFields*)Uri_t2776692961_il2cpp_TypeInfo_var->static_fields)->get_UriSchemeNntp_25(); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_29, L_30, L_31, ((int32_t)119), /*hidden argument*/NULL); Hashtable_t3875263730 * L_32 = V_0; DefaultUriParser_t625205023 * L_33 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_33, /*hidden argument*/NULL); UriParser_InternalRegister_m1447570189(NULL /*static, unused*/, L_32, L_33, _stringLiteral3316647, ((int32_t)389), /*hidden argument*/NULL); Il2CppObject * L_34 = ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->get_lock_object_0(); V_1 = L_34; Il2CppObject * L_35 = V_1; Monitor_Enter_m476686225(NULL /*static, unused*/, L_35, /*hidden argument*/NULL); } IL_00e6: try { // begin try (depth: 1) { IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); Hashtable_t3875263730 * L_36 = ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->get_table_1(); if (L_36) { goto IL_00fb; } } IL_00f0: { Hashtable_t3875263730 * L_37 = V_0; IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->set_table_1(L_37); goto IL_00fd; } IL_00fb: { V_0 = (Hashtable_t3875263730 *)NULL; } IL_00fd: { IL2CPP_LEAVE(0x109, FINALLY_0102); } } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t1967233988 *)e.ex; goto FINALLY_0102; } FINALLY_0102: { // begin finally (depth: 1) Il2CppObject * L_38 = V_1; Monitor_Exit_m2088237919(NULL /*static, unused*/, L_38, /*hidden argument*/NULL); IL2CPP_END_FINALLY(258) } // end finally (depth: 1) IL2CPP_CLEANUP(258) { IL2CPP_JUMP_TBL(0x109, IL_0109) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t1967233988 *) } IL_0109: { return; } } // System.Void System.UriParser::InternalRegister(System.Collections.Hashtable,System.UriParser,System.String,System.Int32) extern Il2CppClass* GenericUriParser_t2219856969_il2cpp_TypeInfo_var; extern Il2CppClass* DefaultUriParser_t625205023_il2cpp_TypeInfo_var; extern const uint32_t UriParser_InternalRegister_m1447570189_MetadataUsageId; extern "C" void UriParser_InternalRegister_m1447570189 (Il2CppObject * __this /* static, unused */, Hashtable_t3875263730 * ___table0, UriParser_t1660745760 * ___uriParser1, String_t* ___schemeName2, int32_t ___defaultPort3, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (UriParser_InternalRegister_m1447570189_MetadataUsageId); s_Il2CppMethodIntialized = true; } DefaultUriParser_t625205023 * V_0 = NULL; { UriParser_t1660745760 * L_0 = ___uriParser1; String_t* L_1 = ___schemeName2; NullCheck(L_0); UriParser_set_SchemeName_m706252033(L_0, L_1, /*hidden argument*/NULL); UriParser_t1660745760 * L_2 = ___uriParser1; int32_t L_3 = ___defaultPort3; NullCheck(L_2); UriParser_set_DefaultPort_m1019606244(L_2, L_3, /*hidden argument*/NULL); UriParser_t1660745760 * L_4 = ___uriParser1; if (!((GenericUriParser_t2219856969 *)IsInstClass(L_4, GenericUriParser_t2219856969_il2cpp_TypeInfo_var))) { goto IL_0026; } } { Hashtable_t3875263730 * L_5 = ___table0; String_t* L_6 = ___schemeName2; UriParser_t1660745760 * L_7 = ___uriParser1; NullCheck(L_5); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_5, L_6, L_7); goto IL_0042; } IL_0026: { DefaultUriParser_t625205023 * L_8 = (DefaultUriParser_t625205023 *)il2cpp_codegen_object_new(DefaultUriParser_t625205023_il2cpp_TypeInfo_var); DefaultUriParser__ctor_m1912198945(L_8, /*hidden argument*/NULL); V_0 = L_8; DefaultUriParser_t625205023 * L_9 = V_0; String_t* L_10 = ___schemeName2; NullCheck(L_9); UriParser_set_SchemeName_m706252033(L_9, L_10, /*hidden argument*/NULL); DefaultUriParser_t625205023 * L_11 = V_0; int32_t L_12 = ___defaultPort3; NullCheck(L_11); UriParser_set_DefaultPort_m1019606244(L_11, L_12, /*hidden argument*/NULL); Hashtable_t3875263730 * L_13 = ___table0; String_t* L_14 = ___schemeName2; DefaultUriParser_t625205023 * L_15 = V_0; NullCheck(L_13); VirtActionInvoker2< Il2CppObject *, Il2CppObject * >::Invoke(23 /* System.Void System.Collections.Hashtable::Add(System.Object,System.Object) */, L_13, L_14, L_15); } IL_0042: { UriParser_t1660745760 * L_16 = ___uriParser1; String_t* L_17 = ___schemeName2; int32_t L_18 = ___defaultPort3; NullCheck(L_16); VirtActionInvoker2< String_t*, int32_t >::Invoke(5 /* System.Void System.UriParser::OnRegister(System.String,System.Int32) */, L_16, L_17, L_18); return; } } // System.UriParser System.UriParser::GetParser(System.String) extern Il2CppClass* UriParser_t1660745760_il2cpp_TypeInfo_var; extern Il2CppClass* CultureInfo_t3603717042_il2cpp_TypeInfo_var; extern const uint32_t UriParser_GetParser_m635613298_MetadataUsageId; extern "C" UriParser_t1660745760 * UriParser_GetParser_m635613298 (Il2CppObject * __this /* static, unused */, String_t* ___schemeName0, const MethodInfo* method) { static bool s_Il2CppMethodIntialized; if (!s_Il2CppMethodIntialized) { il2cpp_codegen_initialize_method (UriParser_GetParser_m635613298_MetadataUsageId); s_Il2CppMethodIntialized = true; } String_t* V_0 = NULL; { String_t* L_0 = ___schemeName0; if (L_0) { goto IL_0008; } } { return (UriParser_t1660745760 *)NULL; } IL_0008: { IL2CPP_RUNTIME_CLASS_INIT(UriParser_t1660745760_il2cpp_TypeInfo_var); UriParser_CreateDefaults_m2648397058(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_1 = ___schemeName0; IL2CPP_RUNTIME_CLASS_INIT(CultureInfo_t3603717042_il2cpp_TypeInfo_var); CultureInfo_t3603717042 * L_2 = CultureInfo_get_InvariantCulture_m764001524(NULL /*static, unused*/, /*hidden argument*/NULL); NullCheck(L_1); String_t* L_3 = String_ToLower_m2140020155(L_1, L_2, /*hidden argument*/NULL); V_0 = L_3; Hashtable_t3875263730 * L_4 = ((UriParser_t1660745760_StaticFields*)UriParser_t1660745760_il2cpp_TypeInfo_var->static_fields)->get_table_1(); String_t* L_5 = V_0; NullCheck(L_4); Il2CppObject * L_6 = VirtFuncInvoker1< Il2CppObject *, Il2CppObject * >::Invoke(20 /* System.Object System.Collections.Hashtable::get_Item(System.Object) */, L_4, L_5); return ((UriParser_t1660745760 *)CastclassClass(L_6, UriParser_t1660745760_il2cpp_TypeInfo_var)); } } #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "erayzesen@gmail.com" ]
erayzesen@gmail.com
52b83ba36d50283ec99cf195347566a27c3e378e
b8789855e216b1361de2194442e67a6d1bedf5da
/src/DeDelinquent/GameExplanation.cpp
2112f7636de1c601b03c59b3be990ec26a898759
[]
no_license
koenieee/TheDelinquent
2bd0ced4f78d59842dbfe6627e85d02da0b86382
ba609a626fabaaf6c169ed73bacb7d911670554b
refs/heads/master
2021-06-01T08:02:45.066739
2016-04-18T15:10:58
2016-04-18T15:10:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,992
cpp
#include "GameExplanation.hpp" #include "GlobalValues.hpp" #include "DiskController.hpp" #include "StateController.hpp" #include <iostream> GameExplanation::GameExplanation(){ rapidjson::Document * thed = DiskController::readFileIntoJson(MainMenuFilename); std::map<std::string, std::string *> * buttons = DiskController::returnJsonObjects(*thed, buttonKeyNames); float ySize = (float)(GlobalValues::WINDOW_SIZE_Y) / buttonKeyNames.size() - 120; //solution for window.getSize().y?? float i = 250; for (std::string bText : buttonKeyNames){ std::pair<sf::Text *, sf::RectangleShape *> * butt = combineButtonAndText(buttons->at(bText)->c_str(), sf::Vector2f{ 5, i }, GlobalValues::WINDOW_SIZE_X - 10); //window.getSize().x i += ySize; valuesByKeys.insert(std::pair<std::string, std::string>(buttons->at(bText)->c_str(), bText)); rectusShape.insert(std::pair<sf::Text *, sf::RectangleShape *>(butt->first, butt->second)); } } std::vector<KeyMap::function> GameExplanation::getKeyMap(){ return GameExplanation::allTheKeys; } void GameExplanation::keyPressed(KeyMap::function func){ switch (func) { case KeyMap::exit: StateController::setActiveState(StateController::MAIN_MENU); return; case KeyMap::select: for (std::pair<sf::Text *, sf::RectangleShape *> thePair : rectusShape){ if (thePair.second->getGlobalBounds().contains(sf::Vector2f{ (float)InputController::getInstance().getMousePos().x, (float)InputController::getInstance().getMousePos().y })){ if (valuesByKeys.at((std::string)thePair.first->getString()) == "KEYBOARD_SETTINGS"){ StateController::setActiveState(StateController::CONTROLS_INFO_SCREEN); return; } else if (valuesByKeys.at((std::string)thePair.first->getString()) == "LEVEL_EXPLANATION"){ StateController::setActiveState(StateController::GAME_ELEMENTS_INFO_SCREEN); return; } else if (valuesByKeys.at((std::string)thePair.first->getString()) == "BACK_TO_MAIN"){ StateController::setActiveState(StateController::MAIN_MENU); return; } } else{ thePair.first->setStyle(sf::Text::Regular); thePair.first->setColor(sf::Color{ 64, 220, 225 }); } } } } void GameExplanation::mouseHover(sf::Vector2i position){ for (std::pair<sf::Text *, sf::RectangleShape *> thePair : rectusShape){ if (thePair.second->getGlobalBounds().contains(sf::Vector2f{ (float)position.x, (float)position.y })){ thePair.first->setColor(sf::Color::White); thePair.first->setStyle(sf::Text::Bold); } else{ thePair.first->setStyle(sf::Text::Regular); thePair.first->setColor(sf::Color{ 64, 220, 225 }); } } } void GameExplanation::drawScrollable(sf::RenderWindow & window) {} void GameExplanation::drawFixed(sf::RenderWindow & window){ State::drawBackground(window); for (std::pair<sf::Text *, sf::RectangleShape *> butt : rectusShape){ window.draw(*titleText); window.draw(*butt.second); window.draw(*butt.first); } } void GameExplanation::update(){}
[ "koenvdkruk@gmail.com" ]
koenvdkruk@gmail.com
3ad9f3e34d9319f85120642b340a62744feff331
fb83b677ab01bead365e06f5fdbfee5f2f4c5b4c
/sqlite_orm.h
7ab97738e492b2e19720ac94882f0b3b8cfb9855
[]
no_license
sergiosvieira/sqlite_console
a5ea5c20e56dc0da60740c5906c97aa1a70f5dba
52b280a44954d230cc198206f944c697baa87a3d
refs/heads/master
2020-04-12T12:09:53.803955
2018-12-19T19:44:36
2018-12-19T19:44:36
162,483,358
0
0
null
null
null
null
UTF-8
C++
false
false
324,081
h
#pragma once #if defined(_MSC_VER) # if defined(min) __pragma(push_macro("min")) # undef min # define __RESTORE_MIN__ # endif # if defined(max) __pragma(push_macro("max")) # undef max # define __RESTORE_MAX__ # endif #endif // defined(_MSC_VER) #pragma once #include <system_error> // std::error_code, std::system_error #include <string> // std::string #include <sqlite3.h> #include <stdexcept> namespace sqlite_orm { enum class orm_error_code { not_found = 1, type_is_not_mapped_to_storage, trying_to_dereference_null_iterator, too_many_tables_specified, incorrect_set_fields_specified, column_not_found, table_has_no_primary_key_column, cannot_start_a_transaction_within_a_transaction, no_active_transaction, }; } namespace sqlite_orm { class orm_error_category : public std::error_category { public: const char *name() const noexcept override final { return "ORM error"; } std::string message(int c) const override final { switch (static_cast<orm_error_code>(c)) { case orm_error_code::not_found: return "Not found"; case orm_error_code::type_is_not_mapped_to_storage: return "Type is not mapped to storage"; case orm_error_code::trying_to_dereference_null_iterator: return "Trying to dereference null iterator"; case orm_error_code::too_many_tables_specified: return "Too many tables specified"; case orm_error_code::incorrect_set_fields_specified: return "Incorrect set fields specified"; case orm_error_code::column_not_found: return "Column not found"; case orm_error_code::table_has_no_primary_key_column: return "Table has no primary key column"; case orm_error_code::cannot_start_a_transaction_within_a_transaction: return "Cannot start a transaction within a transaction"; case orm_error_code::no_active_transaction: return "No active transaction"; default: return "unknown error"; } } }; class sqlite_error_category : public std::error_category { public: const char *name() const noexcept override final { return "SQLite error"; } std::string message(int c) const override final { return sqlite3_errstr(c); } }; inline const orm_error_category& get_orm_error_category() { static orm_error_category res; return res; } inline const sqlite_error_category& get_sqlite_error_category() { static sqlite_error_category res; return res; } } namespace std { template <> struct is_error_code_enum<sqlite_orm::orm_error_code> : std::true_type{}; inline std::error_code make_error_code(sqlite_orm::orm_error_code errorCode) { return std::error_code(static_cast<int>(errorCode), sqlite_orm::get_orm_error_category()); } } #pragma once #include <map> // std::map #include <string> // std::string #include <regex> // std::regex, std::regex_match #include <memory> // std::make_shared, std::shared_ptr #include <vector> // std::vector namespace sqlite_orm { using int64 = sqlite_int64; using uint64 = sqlite_uint64; // numeric and real are the same for c++ enum class sqlite_type { INTEGER, TEXT, BLOB, REAL, }; /** * @param str case doesn't matter - it is uppercased before comparing. */ inline std::shared_ptr<sqlite_type> to_sqlite_type(const std::string &str) { auto asciiStringToUpper = [](std::string &s){ std::transform(s.begin(), s.end(), s.begin(), [](char c){ return toupper(c); }); }; auto upperStr = str; asciiStringToUpper(upperStr); static std::map<sqlite_type, std::vector<std::regex>> typeMap = { { sqlite_type::INTEGER, { std::regex("INT"), std::regex("INT.*"), std::regex("TINYINT"), std::regex("SMALLINT"), std::regex("MEDIUMINT"), std::regex("BIGINT"), std::regex("UNSIGNED BIG INT"), std::regex("INT2"), std::regex("INT8"), } }, { sqlite_type::TEXT, { std::regex("CHARACTER\\([[:digit:]]+\\)"), std::regex("VARCHAR\\([[:digit:]]+\\)"), std::regex("VARYING CHARACTER\\([[:digit:]]+\\)"), std::regex("NCHAR\\([[:digit:]]+\\)"), std::regex("NATIVE CHARACTER\\([[:digit:]]+\\)"), std::regex("NVARCHAR\\([[:digit:]]+\\)"), std::regex("CLOB"), std::regex("TEXT"), } }, { sqlite_type::BLOB, { std::regex("BLOB"), } }, { sqlite_type::REAL, { std::regex("REAL"), std::regex("DOUBLE"), std::regex("DOUBLE PRECISION"), std::regex("FLOAT"), std::regex("NUMERIC"), std::regex("DECIMAL\\([[:digit:]]+,[[:digit:]]+\\)"), std::regex("BOOLEAN"), std::regex("DATE"), std::regex("DATETIME"), } }, }; for(auto &p : typeMap) { for(auto &r : p.second) { if(std::regex_match(upperStr, r)){ return std::make_shared<sqlite_type>(p.first); } } } return {}; } } #pragma once #include <tuple> // std::tuple #include <type_traits> // std::false_type, std::true_type #include <utility> // std::index_sequence, std::index_sequence_for namespace sqlite_orm { // got from here http://stackoverflow.com/questions/25958259/how-do-i-find-out-if-a-tuple-contains-a-type namespace tuple_helper { template <typename T, typename Tuple> struct has_type; template <typename T> struct has_type<T, std::tuple<>> : std::false_type {}; template <typename T, typename U, typename... Ts> struct has_type<T, std::tuple<U, Ts...>> : has_type<T, std::tuple<Ts...>> {}; template <typename T, typename... Ts> struct has_type<T, std::tuple<T, Ts...>> : std::true_type {}; template <typename T, typename Tuple> using tuple_contains_type = typename has_type<T, Tuple>::type; template<size_t N, class ...Args> struct iterator { template<class L> void operator()(const std::tuple<Args...> &t, L l, bool reverse = true) { if(reverse){ l(std::get<N>(t)); iterator<N - 1, Args...>()(t, l, reverse); }else{ iterator<N - 1, Args...>()(t, l, reverse); l(std::get<N>(t)); } } }; template<class ...Args> struct iterator<0, Args...>{ template<class L> void operator()(const std::tuple<Args...> &t, L l, bool /*reverse*/ = true) { l(std::get<0>(t)); } }; template<size_t N> struct iterator<N> { template<class L> void operator()(const std::tuple<> &, L, bool /*reverse*/ = true) { //.. } }; template <class F, typename T, std::size_t... I> void tuple_for_each_impl(F&& f, const T& t, std::index_sequence<I...>){ int _[] = { (f(std::get<I>(t)), int{}) ... }; (void)_; } template <typename F, typename ...Args> void tuple_for_each(const std::tuple<Args...>& t, F&& f){ tuple_for_each_impl(std::forward<F>(f), t, std::index_sequence_for<Args...>{}); } } } #pragma once #include <type_traits> // std::false_type, std::true_type, std::integral_constant namespace sqlite_orm { // got from here https://stackoverflow.com/questions/37617677/implementing-a-compile-time-static-if-logic-for-different-string-types-in-a-co namespace static_magic { template <typename T, typename F> auto static_if(std::true_type, T t, F f) { return t; } template <typename T, typename F> auto static_if(std::false_type, T t, F f) { return f; } template <bool B, typename T, typename F> auto static_if(T t, F f) { return static_if(std::integral_constant<bool, B>{}, t, f); } template <bool B, typename T> auto static_if(T t) { return static_if(std::integral_constant<bool, B>{}, t, [](auto&&...){}); } } } #pragma once #include <string> // std::string #include <memory> // std::shared_ptr, std::unique_ptr #include <vector> // std::vector namespace sqlite_orm { /** * This class accepts c++ type and transfers it to sqlite name (int -> INTEGER, std::string -> TEXT) */ template<class T> struct type_printer; struct integer_printer { inline const std::string& print() { static const std::string res = "INTEGER"; return res; } }; struct text_printer { inline const std::string& print() { static const std::string res = "TEXT"; return res; } }; struct real_printer { inline const std::string& print() { static const std::string res = "REAL"; return res; } }; struct blob_printer { inline const std::string& print() { static const std::string res = "BLOB"; return res; } }; //Note unsigned/signed char and simple char used for storing integer values, not char values. template<> struct type_printer<unsigned char> : public integer_printer {}; template<> struct type_printer<signed char> : public integer_printer {}; template<> struct type_printer<char> : public integer_printer {}; template<> struct type_printer<unsigned short int> : public integer_printer {}; template<> struct type_printer<short> : public integer_printer {}; template<> struct type_printer<unsigned int> : public integer_printer {}; template<> struct type_printer<int> : public integer_printer {}; template<> struct type_printer<unsigned long> : public integer_printer {}; template<> struct type_printer<long> : public integer_printer {}; template<> struct type_printer<unsigned long long> : public integer_printer {}; template<> struct type_printer<long long> : public integer_printer {}; template<> struct type_printer<bool> : public integer_printer {}; template<> struct type_printer<std::string> : public text_printer {}; template<> struct type_printer<std::wstring> : public text_printer {}; template<> struct type_printer<const char*> : public text_printer {}; template<> struct type_printer<double> : public real_printer {}; template<class T> struct type_printer<std::shared_ptr<T>> : public type_printer<T> {}; template<class T> struct type_printer<std::unique_ptr<T>> : public type_printer<T> {}; template<> struct type_printer<std::vector<char>> : public blob_printer {}; } #pragma once namespace sqlite_orm { namespace internal { enum class collate_argument { binary, nocase, rtrim, }; } } #pragma once #include <string> // std::string #include <tuple> // std::tuple #include <sstream> // std::stringstream #include <type_traits> // std::is_base_of, std::false_type, std::true_type namespace sqlite_orm { namespace constraints { /** * AUTOINCREMENT constraint class. */ struct autoincrement_t { operator std::string() const { return "AUTOINCREMENT"; } }; /** * PRIMARY KEY constraint class. * Cs is parameter pack which contains columns (member pointer and/or function pointers). Can be empty when used withen `make_column` function. */ template<class ...Cs> struct primary_key_t { std::tuple<Cs...> columns; enum class order_by { unspecified, ascending, descending, }; order_by asc_option = order_by::unspecified; primary_key_t(decltype(columns) c):columns(std::move(c)){} using field_type = void; // for column iteration. Better be deleted using constraints_type = std::tuple<>; operator std::string() const { std::string res = "PRIMARY KEY"; switch(this->asc_option){ case order_by::ascending: res += " ASC"; break; case order_by::descending: res += " DESC"; break; default: break; } return res; } primary_key_t<Cs...> asc() const { auto res = *this; res.asc_option = order_by::ascending; return res; } primary_key_t<Cs...> desc() const { auto res = *this; res.asc_option = order_by::descending; return res; } }; /** * UNIQUE constraint class. */ struct unique_t { operator std::string() const { return "UNIQUE"; } }; /** * DEFAULT constraint class. * T is a value type. */ template<class T> struct default_t { typedef T value_type; value_type value; operator std::string() const { std::stringstream ss; ss << "DEFAULT "; auto needQuotes = std::is_base_of<text_printer, type_printer<T>>::value; if(needQuotes){ ss << "'"; } ss << this->value; if(needQuotes){ ss << "'"; } return ss.str(); } }; #if SQLITE_VERSION_NUMBER >= 3006019 /** * FOREIGN KEY constraint class. * C is column which has foreign key * R is column which C references to * Available in SQLite 3.6.19 or higher */ template<class C, class R> struct foreign_key_t { C m = nullptr; R r = nullptr; foreign_key_t(C m_, R r_): m(m_), r(r_) {} using field_type = void; // for column iteration. Better be deleted using constraints_type = std::tuple<>; template<class L> void for_each_column(L) {} template<class ...Opts> constexpr bool has_every() const { return false; } }; /** * C can be a class member pointer, a getter function member pointer or setter * func member pointer * Available in SQLite 3.6.19 or higher */ template<class C> struct foreign_key_intermediate_t { C m = nullptr; foreign_key_intermediate_t(C m_): m(m_) {} template<class T> foreign_key_t<C, T> references(T t) { using ret_type = foreign_key_t<C, T>; return ret_type(this->m, t); } }; #endif struct collate_t { internal::collate_argument argument; collate_t(internal::collate_argument argument_): argument(argument_) {} operator std::string() const { std::string res = "COLLATE " + string_from_collate_argument(this->argument); return res; } static std::string string_from_collate_argument(internal::collate_argument argument){ switch(argument){ case decltype(argument)::binary: return "BINARY"; case decltype(argument)::nocase: return "NOCASE"; case decltype(argument)::rtrim: return "RTRIM"; } } }; template<class T> struct is_constraint : std::false_type {}; template<> struct is_constraint<autoincrement_t> : std::true_type {}; template<class ...Cs> struct is_constraint<primary_key_t<Cs...>> : std::true_type {}; template<> struct is_constraint<unique_t> : std::true_type {}; template<class T> struct is_constraint<default_t<T>> : std::true_type {}; template<class C, class R> struct is_constraint<foreign_key_t<C, R>> : std::true_type {}; template<> struct is_constraint<collate_t> : std::true_type {}; template<class ...Args> struct constraints_size; template<> struct constraints_size<> { static constexpr const int value = 0; }; template<class H, class ...Args> struct constraints_size<H, Args...> { static constexpr const int value = is_constraint<H>::value + constraints_size<Args...>::value; }; } #if SQLITE_VERSION_NUMBER >= 3006019 /** * FOREIGN KEY constraint construction function that takes member pointer as argument * Available in SQLite 3.6.19 or higher */ template<class O, class F> constraints::foreign_key_intermediate_t<F O::*> foreign_key(F O::*m) { return {m}; } /** * FOREIGN KEY constraint construction function that takes getter function pointer as argument * Available in SQLite 3.6.19 or higher */ template<class O, class F> constraints::foreign_key_intermediate_t<const F& (O::*)() const> foreign_key(const F& (O::*getter)() const) { using ret_type = constraints::foreign_key_intermediate_t<const F& (O::*)() const>; return ret_type(getter); } /** * FOREIGN KEY constraint construction function that takes setter function pointer as argument * Available in SQLite 3.6.19 or higher */ template<class O, class F> constraints::foreign_key_intermediate_t<void (O::*)(F)> foreign_key(void (O::*setter)(F)) { return {setter}; } #endif /** * UNIQUE constraint builder function. */ inline constraints::unique_t unique() { return {}; } inline constraints::autoincrement_t autoincrement() { return {}; } template<class ...Cs> inline constraints::primary_key_t<Cs...> primary_key(Cs ...cs) { using ret_type = constraints::primary_key_t<Cs...>; return ret_type(std::make_tuple(cs...)); } template<class T> constraints::default_t<T> default_value(T t) { return {t}; } inline constraints::collate_t collate_nocase() { return {internal::collate_argument::nocase}; } inline constraints::collate_t collate_binary() { return {internal::collate_argument::binary}; } inline constraints::collate_t collate_rtrim() { return {internal::collate_argument::rtrim}; } namespace internal { /** * FOREIGN KEY traits. Common case */ template<class T> struct is_foreign_key : std::false_type {}; /** * FOREIGN KEY traits. Specialized case */ template<class C, class R> struct is_foreign_key<constraints::foreign_key_t<C, R>> : std::true_type {}; /** * PRIMARY KEY traits. Common case */ template<class T> struct is_primary_key : public std::false_type {}; /** * PRIMARY KEY traits. Specialized case */ template<class ...Cs> struct is_primary_key<constraints::primary_key_t<Cs...>> : public std::true_type {}; } } #pragma once #include <type_traits> // std::false_type, std::true_type #include <memory> // std::shared_ptr, std::unique_ptr namespace sqlite_orm { /** * This is class that tells `sqlite_orm` that type is nullable. Nullable types * are mapped to sqlite database as `NULL` and not-nullable are mapped as `NOT NULL`. * Default nullability status for all types is `NOT NULL`. So if you want to map * custom type as `NULL` (for example: boost::optional) you have to create a specialiation * of type_is_nullable for your type and derive from `std::true_type`. */ template<class T> struct type_is_nullable : public std::false_type { bool operator()(const T &) const { return true; } }; /** * This is a specialization for std::shared_ptr. std::shared_ptr is nullable in sqlite_orm. */ template<class T> struct type_is_nullable<std::shared_ptr<T>> : public std::true_type { bool operator()(const std::shared_ptr<T> &t) const { return static_cast<bool>(t); } }; /** * This is a specialization for std::unique_ptr. std::unique_ptr is nullable too. */ template<class T> struct type_is_nullable<std::unique_ptr<T>> : public std::true_type { bool operator()(const std::unique_ptr<T> &t) const { return static_cast<bool>(t); } }; } #pragma once #include <memory> // std::shared_ptr #include <string> // std::string #include <sstream> // std::stringstream // #include "constraints.h" namespace sqlite_orm { namespace internal { /** * This class is used in tuple interation to know whether tuple constains `default_value_t` * constraint class and what it's value if it is */ struct default_value_extractor { template<class A> std::shared_ptr<std::string> operator() (const A &) { return {}; } template<class T> std::shared_ptr<std::string> operator() (const constraints::default_t<T> &t) { std::stringstream ss; ss << t.value; return std::make_shared<std::string>(ss.str()); } }; } } #pragma once #include <type_traits> // std::false_type, std::true_type namespace sqlite_orm { namespace internal { /** * Result of concatenation || operator */ template<class L, class R> struct conc_t { L l; R r; }; /** * Result of addition + operator */ template<class L, class R> struct add_t { L l; R r; }; /** * Result of subscribe - operator */ template<class L, class R> struct sub_t { L l; R r; }; /** * Result of multiply * operator */ template<class L, class R> struct mul_t { L l; R r; }; /** * Result of divide / operator */ template<class L, class R> struct div_t { L l; R r; }; /** * Result of mod % operator */ template<class L, class R> struct mod_t { L l; R r; }; /** * Result of assign = operator */ template<class L, class R> struct assign_t { L l; R r; assign_t(){} assign_t(L l_, R r_): l(l_), r(r_) {} }; /** * Assign operator traits. Common case */ template<class T> struct is_assign_t : public std::false_type {}; /** * Assign operator traits. Specialized case */ template<class L, class R> struct is_assign_t<assign_t<L, R>> : public std::true_type {}; /** * Is not an operator but a result of c(...) function. Has operator= overloaded which returns assign_t */ template<class T> struct expression_t { T t; expression_t(T t_): t(t_) {} template<class R> assign_t<T, R> operator=(R r) const { return {this->t, r}; } }; } /** * Public interface for syntax sugar for columns. Example: `where(c(&User::id) == 5)` or `storage.update(set(c(&User::name) = "Dua Lipa")); */ template<class T> internal::expression_t<T> c(T t) { using result_type = internal::expression_t<T>; return result_type(t); } /** * Public interface for || concatenation operator. Example: `select(conc(&User::name, "@gmail.com"));` => SELECT name + '@gmail.com' FROM users */ template<class L, class R> internal::conc_t<L, R> conc(L l, R r) { return {l, r}; } /** * Public interface for + operator. Example: `select(add(&User::age, 100));` => SELECT age + 100 FROM users */ template<class L, class R> internal::add_t<L, R> add(L l, R r) { return {l, r}; } /** * Public interface for - operator. Example: `select(add(&User::age, 1));` => SELECT age - 1 FROM users */ template<class L, class R> internal::sub_t<L, R> sub(L l, R r) { return {l, r}; } template<class L, class R> internal::mul_t<L, R> mul(L l, R r) { return {l, r}; } template<class L, class R> internal::div_t<L, R> div(L l, R r) { return {l, r}; } template<class L, class R> internal::mod_t<L, R> mod(L l, R r) { return {l, r}; } template<class L, class R> internal::assign_t<L, R> assign(L l, R r) { return {std::move(l), std::move(r)}; } } #pragma once #include <tuple> // std::tuple #include <string> // std::string #include <memory> // std::shared_ptr #include <type_traits> // std::true_type, std::false_type, std::is_same, std::enable_if // #include "type_is_nullable.h" // #include "tuple_helper.h" // #include "default_value_extractor.h" // #include "constraints.h" namespace sqlite_orm { namespace internal { /** * This class stores single column info. column_t is a pair of [column_name:member_pointer] mapped to a storage * O is a mapped class, e.g. User * T is a mapped class'es field type, e.g. &User::name * Op... is a constraints pack, e.g. primary_key_t, autoincrement_t etc */ template<class O, class T, class G/* = const T& (O::*)() const*/, class S/* = void (O::*)(T)*/, class ...Op> struct column_t { using object_type = O; using field_type = T; using constraints_type = std::tuple<Op...>; using member_pointer_t = field_type object_type::*; using getter_type = G; using setter_type = S; /** * Column name. Specified during construction in `make_column`. */ const std::string name; /** * Member pointer used to read/write member */ member_pointer_t member_pointer/* = nullptr*/; /** * Getter member function pointer to get a value. If member_pointer is null than * `getter` and `setter` must be not null */ getter_type getter/* = nullptr*/; /** * Setter member function */ setter_type setter/* = nullptr*/; /** * Constraints tuple */ constraints_type constraints; /** * Simplified interface for `NOT NULL` constraint */ bool not_null() const { return !type_is_nullable<field_type>::value; } template<class Opt> constexpr bool has() const { return tuple_helper::tuple_contains_type<Opt, constraints_type>::value; } template<class O1, class O2, class ...Opts> constexpr bool has_every() const { if(has<O1>() && has<O2>()) { return true; }else{ return has_every<Opts...>(); } } template<class O1> constexpr bool has_every() const { return has<O1>(); } /** * Simplified interface for `DEFAULT` constraint * @return string representation of default value if it exists otherwise nullptr */ std::shared_ptr<std::string> default_value() { std::shared_ptr<std::string> res; tuple_helper::iterator<std::tuple_size<constraints_type>::value - 1, Op...>()(constraints, [&res](auto &v){ auto dft = internal::default_value_extractor()(v); if(dft){ res = dft; } }); return res; } }; /** * Column traits. Common case. */ template<class T> struct is_column : public std::false_type {}; /** * Column traits. Specialized case case. */ template<class O, class T, class ...Op> struct is_column<column_t<O, T, Op...>> : public std::true_type {}; template<class O, class T> using getter_by_value_const = T (O::*)() const; template<class O, class T> using getter_by_value = T (O::*)(); template<class O, class T> using getter_by_ref_const = T& (O::*)() const; template<class O, class T> using getter_by_ref = T& (O::*)(); template<class O, class T> using getter_by_const_ref_const = const T& (O::*)() const; template<class O, class T> using getter_by_const_ref = const T& (O::*)(); template<class O, class T> using setter_by_value = void (O::*)(T); template<class O, class T> using setter_by_ref = void (O::*)(T&); template<class O, class T> using setter_by_const_ref = void (O::*)(const T&); template<class T> struct is_getter : std::false_type {}; template<class O, class T> struct is_getter<getter_by_value_const<O, T>> : std::true_type {}; template<class O, class T> struct is_getter<getter_by_value<O, T>> : std::true_type {}; template<class O, class T> struct is_getter<getter_by_ref_const<O, T>> : std::true_type {}; template<class O, class T> struct is_getter<getter_by_ref<O, T>> : std::true_type {}; template<class O, class T> struct is_getter<getter_by_const_ref_const<O, T>> : std::true_type {}; template<class O, class T> struct is_getter<getter_by_const_ref<O, T>> : std::true_type {}; template<class T> struct is_setter : std::false_type {}; template<class O, class T> struct is_setter<setter_by_value<O, T>> : std::true_type {}; template<class O, class T> struct is_setter<setter_by_ref<O, T>> : std::true_type {}; template<class O, class T> struct is_setter<setter_by_const_ref<O, T>> : std::true_type {}; template<class T> struct getter_traits; template<class O, class T> struct getter_traits<getter_by_value_const<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct getter_traits<getter_by_value<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct getter_traits<getter_by_ref_const<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct getter_traits<getter_by_ref<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct getter_traits<getter_by_const_ref_const<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct getter_traits<getter_by_const_ref<O, T>> { using object_type = O; using field_type = T; }; template<class T> struct setter_traits; template<class O, class T> struct setter_traits<setter_by_value<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct setter_traits<setter_by_ref<O, T>> { using object_type = O; using field_type = T; }; template<class O, class T> struct setter_traits<setter_by_const_ref<O, T>> { using object_type = O; using field_type = T; }; } /** * Column builder function. You should use it to create columns instead of constructor */ template<class O, class T, typename = typename std::enable_if<!std::is_member_function_pointer<T O::*>::value>::type, class ...Op> internal::column_t<O, T, const T& (O::*)() const, void (O::*)(T), Op...> make_column(const std::string &name, T O::*m, Op ...constraints){ static_assert(constraints::constraints_size<Op...>::value == std::tuple_size<std::tuple<Op...>>::value, "Incorrect constraints pack"); return {name, m, nullptr, nullptr, std::make_tuple(constraints...)}; } /** * Column builder function with setter and getter. You should use it to create columns instead of constructor */ template<class G, class S, typename = typename std::enable_if<internal::is_getter<G>::value>::type, typename = typename std::enable_if<internal::is_setter<S>::value>::type, class ...Op> internal::column_t< typename internal::setter_traits<S>::object_type, typename internal::setter_traits<S>::field_type, G, S, Op...> make_column(const std::string &name, S setter, G getter, Op ...constraints) { static_assert(std::is_same<typename internal::setter_traits<S>::field_type, typename internal::getter_traits<G>::field_type>::value, "Getter and setter must get and set same data type"); static_assert(constraints::constraints_size<Op...>::value == std::tuple_size<std::tuple<Op...>>::value, "Incorrect constraints pack"); return {name, nullptr, getter, setter, std::make_tuple(constraints...)}; } /** * Column builder function with getter and setter (reverse order). You should use it to create columns instead of constructor */ template<class G, class S, typename = typename std::enable_if<internal::is_getter<G>::value>::type, typename = typename std::enable_if<internal::is_setter<S>::value>::type, class ...Op> internal::column_t< typename internal::setter_traits<S>::object_type, typename internal::setter_traits<S>::field_type, G, S, Op...> make_column(const std::string &name, G getter, S setter, Op ...constraints) { static_assert(std::is_same<typename internal::setter_traits<S>::field_type, typename internal::getter_traits<G>::field_type>::value, "Getter and setter must get and set same data type"); static_assert(constraints::constraints_size<Op...>::value == std::tuple_size<std::tuple<Op...>>::value, "Incorrect constraints pack"); return {name, nullptr, getter, setter, std::make_tuple(constraints...)}; } } #pragma once #include <string> // std::string #include <sstream> // std::stringstream #include <vector> // std::vector #include <cstddef> // std::nullptr_t #include <memory> // std::shared_ptr, std::unique_ptr namespace sqlite_orm { /** * Is used to print members mapped to objects in storage_t::dump member function. * Other developers can create own specialization to map custom types */ template<class T> struct field_printer { std::string operator()(const T &t) const { std::stringstream stream; stream << t; return stream.str(); } }; /** * Upgrade to integer is required when using unsigned char(uint8_t) */ template<> struct field_printer<unsigned char> { std::string operator()(const unsigned char &t) const { std::stringstream stream; stream << +t; return stream.str(); } }; /** * Upgrade to integer is required when using signed char(int8_t) */ template<> struct field_printer<signed char> { std::string operator()(const signed char &t) const { std::stringstream stream; stream << +t; return stream.str(); } }; /** * char is neigher signer char nor unsigned char so it has its own specialization */ template<> struct field_printer<char> { std::string operator()(const char &t) const { std::stringstream stream; stream << +t; return stream.str(); } }; template<> struct field_printer<std::string> { std::string operator()(const std::string &t) const { return t; } }; template<> struct field_printer<std::vector<char>> { std::string operator()(const std::vector<char> &t) const { std::stringstream ss; ss << std::hex; for(auto c : t) { ss << c; } return ss.str(); } }; template<> struct field_printer<std::nullptr_t> { std::string operator()(const std::nullptr_t &) const { return "null"; } }; template<class T> struct field_printer<std::shared_ptr<T>> { std::string operator()(const std::shared_ptr<T> &t) const { if(t){ return field_printer<T>()(*t); }else{ return field_printer<std::nullptr_t>()(nullptr); } } }; template<class T> struct field_printer<std::unique_ptr<T>> { std::string operator()(const std::unique_ptr<T> &t) const { if(t){ return field_printer<T>()(*t); }else{ return field_printer<std::nullptr_t>()(nullptr); } } }; } #pragma once #include <string> // std::string // #include "collate_argument.h" // #include "constraints.h" namespace sqlite_orm { namespace conditions { /** * Stores LIMIT/OFFSET info */ struct limit_t { int lim = 0; bool has_offset = false; bool offset_is_implicit = false; int off = 0; limit_t(){} limit_t(decltype(lim) lim_): lim(lim_) {} limit_t(decltype(lim) lim_, decltype(has_offset) has_offset_, decltype(offset_is_implicit) offset_is_implicit_, decltype(off) off_): lim(lim_), has_offset(has_offset_), offset_is_implicit(offset_is_implicit_), off(off_){} operator std::string () const { return "LIMIT"; } }; /** * Stores OFFSET only info */ struct offset_t { int off; }; /** * Inherit from this class if target class can be chained with other conditions with '&&' and '||' operators */ struct condition_t {}; /** * Collated something */ template<class T> struct collate_t : public condition_t { T expr; internal::collate_argument argument; collate_t(T expr_, internal::collate_argument argument_): expr(expr_), argument(argument_) {} operator std::string () const { return constraints::collate_t{this->argument}; } }; /** * Collated something with custom collate function */ template<class T> struct named_collate { T expr; std::string name; named_collate() = default; named_collate(T expr_, std::string name_): expr(expr_), name(std::move(name_)) {} operator std::string () const { return "COLLATE " + this->name; } }; /** * Result of not operator */ template<class C> struct negated_condition_t : public condition_t { C c; negated_condition_t(){} negated_condition_t(C c_): c(c_) {} operator std::string () const { return "NOT"; } }; /** * Result of and operator */ template<class L, class R> struct and_condition_t : public condition_t { L l; R r; and_condition_t(){} and_condition_t(L l_, R r_): l(l_), r(r_) {} operator std::string () const { return "AND"; } }; /** * Result of or operator */ template<class L, class R> struct or_condition_t : public condition_t { L l; R r; or_condition_t(){} or_condition_t(L l_, R r_): l(l_), r(r_) {} operator std::string () const { return "OR"; } }; /** * Base class for binary conditions */ template<class L, class R> struct binary_condition : public condition_t { L l; R r; binary_condition(){} binary_condition(L l_, R r_): l(l_), r(r_) {} }; /** * = and == operators object */ template<class L, class R> struct is_equal_t : public binary_condition<L, R> { using self = is_equal_t<L, R>; using binary_condition<L, R>::binary_condition; operator std::string () const { return "="; } negated_condition_t<self> operator!() const { return {*this}; } collate_t<self> collate_binary() const { return {*this, internal::collate_argument::binary}; } collate_t<self> collate_nocase() const { return {*this, internal::collate_argument::nocase}; } collate_t<self> collate_rtrim() const { return {*this, internal::collate_argument::rtrim}; } named_collate<self> collate(std::string name) const { return {*this, std::move(name)}; } }; /** * != operator object */ template<class L, class R> struct is_not_equal_t : public binary_condition<L, R> { using self = is_not_equal_t<L, R>; using binary_condition<L, R>::binary_condition; operator std::string () const { return "!="; } negated_condition_t<self> operator!() const { return {*this}; } collate_t<self> collate_binary() const { return {*this, internal::collate_argument::binary}; } collate_t<self> collate_nocase() const { return {*this, internal::collate_argument::nocase}; } collate_t<self> collate_rtrim() const { return {*this, internal::collate_argument::rtrim}; } }; /** * > operator object. */ template<class L, class R> struct greater_than_t : public binary_condition<L, R> { using self = greater_than_t<L, R>; using binary_condition<L, R>::binary_condition; operator std::string () const { return ">"; } negated_condition_t<self> operator!() const { return {*this}; } collate_t<self> collate_binary() const { return {*this, internal::collate_argument::binary}; } collate_t<self> collate_nocase() const { return {*this, internal::collate_argument::nocase}; } collate_t<self> collate_rtrim() const { return {*this, internal::collate_argument::rtrim}; } }; /** * >= operator object. */ template<class L, class R> struct greater_or_equal_t : public binary_condition<L, R> { using self = greater_or_equal_t<L, R>; using binary_condition<L, R>::binary_condition; operator std::string () const { return ">="; } negated_condition_t<self> operator!() const { return {*this}; } collate_t<self> collate_binary() const { return {*this, internal::collate_argument::binary}; } collate_t<self> collate_nocase() const { return {*this, internal::collate_argument::nocase}; } collate_t<self> collate_rtrim() const { return {*this, internal::collate_argument::rtrim}; } }; /** * < operator object. */ template<class L, class R> struct lesser_than_t : public binary_condition<L, R> { using self = lesser_than_t<L, R>; using binary_condition<L, R>::binary_condition; operator std::string () const { return "<"; } negated_condition_t<self> operator!() const { return {*this}; } collate_t<self> collate_binary() const { return {*this, internal::collate_argument::binary}; } collate_t<self> collate_nocase() const { return {*this, internal::collate_argument::nocase}; } collate_t<self> collate_rtrim() const { return {*this, internal::collate_argument::rtrim}; } }; /** * <= operator object. */ template<class L, class R> struct lesser_or_equal_t : public binary_condition<L, R> { using self = lesser_or_equal_t<L, R>; using binary_condition<L, R>::binary_condition; operator std::string () const { return "<="; } negated_condition_t<lesser_or_equal_t<L, R>> operator!() const { return {*this}; } collate_t<self> collate_binary() const { return {*this, internal::collate_argument::binary}; } collate_t<self> collate_nocase() const { return {*this, internal::collate_argument::nocase}; } collate_t<self> collate_rtrim() const { return {*this, internal::collate_argument::rtrim}; } }; template<class L, class E> struct in_t : public condition_t { using self = in_t<L, E>; L l; // left expression.. std::vector<E> values; // values.. in_t(L l_, std::vector<E> values_): l(l_), values(std::move(values_)) {} negated_condition_t<self> operator!() const { return {*this}; } operator std::string () const { return "IN"; } }; template<class T> struct is_null_t { using self = is_null_t<T>; T t; negated_condition_t<self> operator!() const { return {*this}; } operator std::string () const { return "IS NULL"; } }; template<class T> struct is_not_null_t { using self = is_not_null_t<T>; T t; negated_condition_t<self> operator!() const { return {*this}; } operator std::string () const { return "IS NOT NULL"; } }; template<class C> struct where_t { C c; operator std::string () const { return "WHERE"; } }; template<class O> struct order_by_t { using self = order_by_t<O>; O o; int asc_desc = 0; // 1: asc, -1: desc std::string _collate_argument; order_by_t(): o() {} order_by_t(O o_): o(o_) {} operator std::string() const { return "ORDER BY"; } self asc() { auto res = *this; res.asc_desc = 1; return res; } self desc() { auto res = *this; res.asc_desc = -1; return res; } self collate_binary() const { auto res = *this; res._collate_argument = constraints::collate_t::string_from_collate_argument(internal::collate_argument::binary); return res; } self collate_nocase() const { auto res = *this; res._collate_argument = constraints::collate_t::string_from_collate_argument(internal::collate_argument::nocase); return res; } self collate_rtrim() const { auto res = *this; res._collate_argument = constraints::collate_t::string_from_collate_argument(internal::collate_argument::rtrim); return res; } self collate(std::string name) const { auto res = *this; res._collate_argument = std::move(name); return res; } }; template<class ...Args> struct multi_order_by_t { std::tuple<Args...> args; operator std::string() const { return static_cast<std::string>(order_by_t<void*>()); } }; template<class ...Args> struct group_by_t { std::tuple<Args...> args; operator std::string() const { return "GROUP BY"; } }; template<class A, class T> struct between_t : public condition_t { A expr; T b1; T b2; between_t(A expr_, T b1_, T b2_): expr(expr_), b1(b1_), b2(b2_) {} operator std::string() const { return "BETWEEN"; } }; template<class A, class T> struct like_t : public condition_t { A a; T t; like_t(){} like_t(A a_, T t_): a(a_), t(t_) {} operator std::string() const { return "LIKE"; } }; template<class T> struct cross_join_t { using type = T; operator std::string() const { return "CROSS JOIN"; } }; template<class T> struct natural_join_t { using type = T; operator std::string() const { return "NATURAL JOIN"; } }; template<class T, class O> struct left_join_t { using type = T; using on_type = O; on_type constraint; operator std::string() const { return "LEFT JOIN"; } }; template<class T, class O> struct join_t { using type = T; using on_type = O; on_type constraint; operator std::string() const { return "JOIN"; } }; template<class T, class O> struct left_outer_join_t { using type = T; using on_type = O; on_type constraint; operator std::string() const { return "LEFT OUTER JOIN"; } }; template<class T> struct on_t { T t; operator std::string() const { return "ON"; } }; template<class F, class O> struct using_t { F O::*column; operator std::string() const { return "USING"; } }; template<class T, class O> struct inner_join_t { using type = T; using on_type = O; on_type constraint; operator std::string() const { return "INNER JOIN"; } }; } /** * Cute operators for columns */ template<class T, class R> conditions::lesser_than_t<T, R> operator<(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> conditions::lesser_than_t<L, T> operator<(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class T, class R> conditions::lesser_or_equal_t<T, R> operator<=(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> conditions::lesser_or_equal_t<L, T> operator<=(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class T, class R> conditions::greater_than_t<T, R> operator>(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> conditions::greater_than_t<L, T> operator>(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class T, class R> conditions::greater_or_equal_t<T, R> operator>=(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> conditions::greater_or_equal_t<L, T> operator>=(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class T, class R> conditions::is_equal_t<T, R> operator==(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> conditions::is_equal_t<L, T> operator==(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class T, class R> conditions::is_not_equal_t<T, R> operator!=(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> conditions::is_not_equal_t<L, T> operator!=(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class T, class R> internal::conc_t<T, R> operator||(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> internal::conc_t<L, T> operator||(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class L, class R> internal::conc_t<L, R> operator||(internal::expression_t<L> l, internal::expression_t<R> r) { return {l.t, r.t}; } template<class T, class R> internal::add_t<T, R> operator+(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> internal::add_t<L, T> operator+(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class L, class R> internal::add_t<L, R> operator+(internal::expression_t<L> l, internal::expression_t<R> r) { return {l.t, r.t}; } template<class T, class R> internal::sub_t<T, R> operator-(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> internal::sub_t<L, T> operator-(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class L, class R> internal::sub_t<L, R> operator-(internal::expression_t<L> l, internal::expression_t<R> r) { return {l.t, r.t}; } template<class T, class R> internal::mul_t<T, R> operator*(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> internal::mul_t<L, T> operator*(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class L, class R> internal::mul_t<L, R> operator*(internal::expression_t<L> l, internal::expression_t<R> r) { return {l.t, r.t}; } template<class T, class R> internal::div_t<T, R> operator/(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> internal::div_t<L, T> operator/(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class L, class R> internal::div_t<L, R> operator/(internal::expression_t<L> l, internal::expression_t<R> r) { return {l.t, r.t}; } template<class T, class R> internal::mod_t<T, R> operator%(internal::expression_t<T> expr, R r) { return {expr.t, r}; } template<class L, class T> internal::mod_t<L, T> operator%(L l, internal::expression_t<T> expr) { return {l, expr.t}; } template<class L, class R> internal::mod_t<L, R> operator%(internal::expression_t<L> l, internal::expression_t<R> r) { return {l.t, r.t}; } template<class F, class O> conditions::using_t<F, O> using_(F O::*p) { return {p}; } template<class T> conditions::on_t<T> on(T t) { return {t}; } template<class T> conditions::cross_join_t<T> cross_join() { return {}; } template<class T> conditions::natural_join_t<T> natural_join() { return {}; } template<class T, class O> conditions::left_join_t<T, O> left_join(O o) { return {o}; } template<class T, class O> conditions::join_t<T, O> join(O o) { return {o}; } template<class T, class O> conditions::left_outer_join_t<T, O> left_outer_join(O o) { return {o}; } template<class T, class O> conditions::inner_join_t<T, O> inner_join(O o) { return {o}; } inline conditions::offset_t offset(int off) { return {off}; } inline conditions::limit_t limit(int lim) { return {lim}; } inline conditions::limit_t limit(int off, int lim) { return {lim, true, true, off}; } inline conditions::limit_t limit(int lim, conditions::offset_t offt) { return {lim, true, false, offt.off }; } template< class L, class R, typename = typename std::enable_if<std::is_base_of<conditions::condition_t, L>::value && std::is_base_of<conditions::condition_t, R>::value>::type > conditions::and_condition_t<L, R> operator &&(const L &l, const R &r) { return {l, r}; } template< class L, class R, typename = typename std::enable_if<std::is_base_of<conditions::condition_t, L>::value && std::is_base_of<conditions::condition_t, R>::value>::type > conditions::or_condition_t<L, R> operator ||(const L &l, const R &r) { return {l, r}; } template<class T> conditions::is_not_null_t<T> is_not_null(T t) { return {t}; } template<class T> conditions::is_null_t<T> is_null(T t) { return {t}; } template<class L, class E> conditions::in_t<L, E> in(L l, std::vector<E> values) { return {std::move(l), std::move(values)}; } template<class L, class E> conditions::in_t<L, E> in(L l, std::initializer_list<E> values) { return {std::move(l), std::move(values)}; } template<class L, class R> conditions::is_equal_t<L, R> is_equal(L l, R r) { return {l, r}; } template<class L, class R> conditions::is_equal_t<L, R> eq(L l, R r) { return {l, r}; } template<class L, class R> conditions::is_not_equal_t<L, R> is_not_equal(L l, R r) { return {l, r}; } template<class L, class R> conditions::is_not_equal_t<L, R> ne(L l, R r) { return {l, r}; } template<class L, class R> conditions::greater_than_t<L, R> greater_than(L l, R r) { return {l, r}; } template<class L, class R> conditions::greater_than_t<L, R> gt(L l, R r) { return {l, r}; } template<class L, class R> conditions::greater_or_equal_t<L, R> greater_or_equal(L l, R r) { return {l, r}; } template<class L, class R> conditions::greater_or_equal_t<L, R> ge(L l, R r) { return {l, r}; } template<class L, class R> conditions::lesser_than_t<L, R> lesser_than(L l, R r) { return {l, r}; } template<class L, class R> conditions::lesser_than_t<L, R> lt(L l, R r) { return {l, r}; } template<class L, class R> conditions::lesser_or_equal_t<L, R> lesser_or_equal(L l, R r) { return {l, r}; } template<class L, class R> conditions::lesser_or_equal_t<L, R> le(L l, R r) { return {l, r}; } template<class C> conditions::where_t<C> where(C c) { return {c}; } template<class O> conditions::order_by_t<O> order_by(O o) { return {o}; } template<class ...Args> conditions::multi_order_by_t<Args...> multi_order_by(Args&& ...args) { return {std::make_tuple(std::forward<Args>(args)...)}; } template<class ...Args> conditions::group_by_t<Args...> group_by(Args&& ...args) { return {std::make_tuple(std::forward<Args>(args)...)}; } template<class A, class T> conditions::between_t<A, T> between(A expr, T b1, T b2) { return {expr, b1, b2}; } template<class A, class T> conditions::like_t<A, T> like(A a, T t) { return {a, t}; } } #pragma once #include <type_traits> // std::enable_if, std::is_base_of #include <sstream> // std::stringstream namespace sqlite_orm { struct alias_tag {}; template<class T, char A> struct alias : alias_tag { using type = T; static char get() { return A; } }; namespace internal { template<class T, class C> struct alias_column_t { using alias_type = T; using column_type = C; column_type column; alias_column_t() {}; alias_column_t(column_type column_): column(column_) {} }; template<class T, class SFINAE = void> struct alias_exractor; template<class T> struct alias_exractor<T, typename std::enable_if<std::is_base_of<alias_tag, T>::value>::type> { static std::string get() { std::stringstream ss; ss << T::get(); return ss.str(); } }; template<class T> struct alias_exractor<T, typename std::enable_if<!std::is_base_of<alias_tag, T>::value>::type> { static std::string get() { return {}; } }; } template<class T, class C> internal::alias_column_t<T, C> alias_column(C c) { return {c}; } template<class T> using alias_a = alias<T, 'a'>; template<class T> using alias_b = alias<T, 'b'>; template<class T> using alias_c = alias<T, 'c'>; template<class T> using alias_d = alias<T, 'd'>; template<class T> using alias_e = alias<T, 'e'>; template<class T> using alias_f = alias<T, 'f'>; template<class T> using alias_g = alias<T, 'g'>; template<class T> using alias_h = alias<T, 'h'>; template<class T> using alias_i = alias<T, 'i'>; template<class T> using alias_j = alias<T, 'j'>; template<class T> using alias_k = alias<T, 'k'>; template<class T> using alias_l = alias<T, 'l'>; template<class T> using alias_m = alias<T, 'm'>; template<class T> using alias_n = alias<T, 'n'>; template<class T> using alias_o = alias<T, 'o'>; template<class T> using alias_p = alias<T, 'p'>; template<class T> using alias_q = alias<T, 'q'>; template<class T> using alias_r = alias<T, 'r'>; template<class T> using alias_s = alias<T, 's'>; template<class T> using alias_t = alias<T, 't'>; template<class T> using alias_u = alias<T, 'u'>; template<class T> using alias_v = alias<T, 'v'>; template<class T> using alias_w = alias<T, 'w'>; template<class T> using alias_x = alias<T, 'x'>; template<class T> using alias_y = alias<T, 'y'>; template<class T> using alias_z = alias<T, 'z'>; } #pragma once // #include "conditions.h" namespace sqlite_orm { namespace internal { template<class ...Args> struct join_iterator { template<class L> void operator()(L) { //.. } }; template<> struct join_iterator<> { template<class L> void operator()(L) { //.. } }; template<class H, class ...Tail> struct join_iterator<H, Tail...> : public join_iterator<Tail...>{ using super = join_iterator<Tail...>; H h; template<class L> void operator()(L l) { this->super::operator()(l); } }; template<class T, class ...Tail> struct join_iterator<conditions::cross_join_t<T>, Tail...> : public join_iterator<Tail...>{ using super = join_iterator<Tail...>; conditions::cross_join_t<T> h; template<class L> void operator()(L l) { l(h); this->super::operator()(l); } }; template<class T, class ...Tail> struct join_iterator<conditions::natural_join_t<T>, Tail...> : public join_iterator<Tail...>{ using super = join_iterator<Tail...>; conditions::natural_join_t<T> h; template<class L> void operator()(L l) { l(h); this->super::operator()(l); } }; template<class T, class O, class ...Tail> struct join_iterator<conditions::left_join_t<T, O>, Tail...> : public join_iterator<Tail...> { using super = join_iterator<Tail...>; conditions::left_join_t<T, O> h; template<class L> void operator()(L l) { l(h); this->super::operator()(l); } }; template<class T, class O, class ...Tail> struct join_iterator<conditions::join_t<T, O>, Tail...> : public join_iterator<Tail...> { using super = join_iterator<Tail...>; conditions::join_t<T, O> h; template<class L> void operator()(L l) { l(h); this->super::operator()(l); } }; template<class T, class O, class ...Tail> struct join_iterator<conditions::left_outer_join_t<T, O>, Tail...> : public join_iterator<Tail...> { using super = join_iterator<Tail...>; conditions::left_outer_join_t<T, O> h; template<class L> void operator()(L l) { l(h); this->super::operator()(l); } }; template<class T, class O, class ...Tail> struct join_iterator<conditions::inner_join_t<T, O>, Tail...> : public join_iterator<Tail...> { using super = join_iterator<Tail...>; conditions::inner_join_t<T, O> h; template<class L> void operator()(L l) { l(h); this->super::operator()(l); } }; } } #pragma once #include <string> // std::string #include <tuple> // std::make_tuple #include <type_traits> // std::forward, std::is_base_of, std::enable_if // #include "conditions.h" namespace sqlite_orm { namespace core_functions { /** * Base class for operator overloading */ struct core_function_t {}; /** * LENGTH(x) function https://sqlite.org/lang_corefunc.html#length */ template<class T> struct length_t : public core_function_t { T t; length_t() = default; length_t(T t_): t(t_) {} operator std::string() const { return "LENGTH"; } }; /** * ABS(x) function https://sqlite.org/lang_corefunc.html#abs */ template<class T> struct abs_t : public core_function_t { T t; abs_t() = default; abs_t(T t_): t(t_) {} operator std::string() const { return "ABS"; } }; /** * LOWER(x) function https://sqlite.org/lang_corefunc.html#lower */ template<class T> struct lower_t : public core_function_t { T t; lower_t() = default; lower_t(T t_): t(t_) {} operator std::string() const { return "LOWER"; } }; /** * UPPER(x) function https://sqlite.org/lang_corefunc.html#upper */ template<class T> struct upper_t : public core_function_t { T t; upper_t() = default; upper_t(T t_): t(t_) {} operator std::string() const { return "UPPER"; } }; /** * CHANGES() function https://sqlite.org/lang_corefunc.html#changes */ struct changes_t : public core_function_t { operator std::string() const { return "CHANGES"; } }; /** * TRIM(X) function https://sqlite.org/lang_corefunc.html#trim */ template<class X> struct trim_single_t : public core_function_t { X x; trim_single_t() = default; trim_single_t(X x_): x(x_) {} operator std::string() const { return "TRIM"; } }; /** * TRIM(X,Y) function https://sqlite.org/lang_corefunc.html#trim */ template<class X, class Y> struct trim_double_t : public core_function_t { X x; Y y; trim_double_t() = default; trim_double_t(X x_, Y y_): x(x_), y(y_) {} operator std::string() const { return static_cast<std::string>(trim_single_t<X>(0)); } }; /** * LTRIM(X) function https://sqlite.org/lang_corefunc.html#ltrim */ template<class X> struct ltrim_single_t : public core_function_t { X x; ltrim_single_t() = default; ltrim_single_t(X x_): x(x_) {} operator std::string() const { return "LTRIM"; } }; /** * LTRIM(X,Y) function https://sqlite.org/lang_corefunc.html#ltrim */ template<class X, class Y> struct ltrim_double_t : public core_function_t { X x; Y y; ltrim_double_t() = default; ltrim_double_t(X x_, Y y_): x(x_), y(y_) {} operator std::string() const { return static_cast<std::string>(ltrim_single_t<X>(0)); } }; /** * RTRIM(X) function https://sqlite.org/lang_corefunc.html#rtrim */ template<class X> struct rtrim_single_t : public core_function_t { X x; rtrim_single_t() = default; rtrim_single_t(X x_): x(x_) {} operator std::string() const { return "RTRIM"; } }; /** * RTRIM(X,Y) function https://sqlite.org/lang_corefunc.html#rtrim */ template<class X, class Y> struct rtrim_double_t : public core_function_t { X x; Y y; rtrim_double_t() = default; rtrim_double_t(X x_, Y y_): x(x_), y(y_) {} operator std::string() const { return static_cast<std::string>(rtrim_single_t<X>(0)); } }; #if SQLITE_VERSION_NUMBER >= 3007016 /** * CHAR(X1,X2,...,XN) function https://sqlite.org/lang_corefunc.html#char */ template<class ...Args> struct char_t_ : public core_function_t { using args_type = std::tuple<Args...>; args_type args; char_t_() = default; char_t_(args_type args_): args(args_) {} operator std::string() const { return "CHAR"; } }; struct random_t : public core_function_t { operator std::string() const { return "RANDOM"; } }; #endif template<class T, class ...Args> struct date_t : public core_function_t { using modifiers_type = std::tuple<Args...>; T timestring; modifiers_type modifiers; date_t() = default; date_t(T timestring_, modifiers_type modifiers_): timestring(timestring_), modifiers(modifiers_) {} operator std::string() const { return "DATE"; } }; template<class T, class ...Args> struct datetime_t : public core_function_t { using modifiers_type = std::tuple<Args...>; T timestring; modifiers_type modifiers; datetime_t() = default; datetime_t(T timestring_, modifiers_type modifiers_): timestring(timestring_), modifiers(modifiers_) {} operator std::string() const { return "DATETIME"; } }; } /** * Cute operators for core functions */ template< class F, class R, typename = typename std::enable_if<std::is_base_of<core_functions::core_function_t, F>::value>::type> conditions::lesser_than_t<F, R> operator<(F f, R r) { return {f, r}; } template< class F, class R, typename = typename std::enable_if<std::is_base_of<core_functions::core_function_t, F>::value>::type> conditions::lesser_or_equal_t<F, R> operator<=(F f, R r) { return {f, r}; } template< class F, class R, typename = typename std::enable_if<std::is_base_of<core_functions::core_function_t, F>::value>::type> conditions::greater_than_t<F, R> operator>(F f, R r) { return {f, r}; } template< class F, class R, typename = typename std::enable_if<std::is_base_of<core_functions::core_function_t, F>::value>::type> conditions::greater_or_equal_t<F, R> operator>=(F f, R r) { return {f, r}; } template< class F, class R, typename = typename std::enable_if<std::is_base_of<core_functions::core_function_t, F>::value>::type> conditions::is_equal_t<F, R> operator==(F f, R r) { return {f, r}; } template< class F, class R, typename = typename std::enable_if<std::is_base_of<core_functions::core_function_t, F>::value>::type> conditions::is_not_equal_t<F, R> operator!=(F f, R r) { return {f, r}; } inline core_functions::random_t random() { return {}; } template<class T, class ...Args, class Res = core_functions::date_t<T, Args...>> Res date(T timestring, Args ...modifiers) { return Res(timestring, std::make_tuple(modifiers...)); } template<class T, class ...Args, class Res = core_functions::datetime_t<T, Args...>> Res datetime(T timestring, Args ...modifiers) { return Res(timestring, std::make_tuple(modifiers...)); } #if SQLITE_VERSION_NUMBER >= 3007016 template<class ...Args> core_functions::char_t_<Args...> char_(Args&& ...args) { using result_type = core_functions::char_t_<Args...>; return result_type(std::make_tuple(std::forward<Args>(args)...)); } #endif template<class X, class Res = core_functions::trim_single_t<X>> Res trim(X x) { return Res(x); } template<class X, class Y, class Res = core_functions::trim_double_t<X, Y>> Res trim(X x, Y y) { return Res(x, y); } template<class X, class Res = core_functions::ltrim_single_t<X>> Res ltrim(X x) { return Res(x); } template<class X, class Y, class Res = core_functions::ltrim_double_t<X, Y>> Res ltrim(X x, Y y) { return Res(x, y); } template<class X, class Res = core_functions::rtrim_single_t<X>> Res rtrim(X x) { return Res(x); } template<class X, class Y, class Res = core_functions::rtrim_double_t<X, Y>> Res rtrim(X x, Y y) { return Res(x, y); } inline core_functions::changes_t changes() { return {}; } template<class T> core_functions::length_t<T> length(T t) { using result_type = core_functions::length_t<T>; return result_type(t); } template<class T> core_functions::abs_t<T> abs(T t) { using result_type = core_functions::abs_t<T>; return result_type(t); } template<class T, class Res = core_functions::lower_t<T>> Res lower(T t) { return Res(t); } template<class T, class Res = core_functions::upper_t<T>> Res upper(T t) { return Res(t); } } #pragma once namespace sqlite_orm { namespace aggregate_functions { template<class T> struct avg_t { T t; operator std::string() const { return "AVG"; } }; template<class T> struct count_t { T t; operator std::string() const { return "COUNT"; } }; struct count_asterisk_t { operator std::string() const { return "COUNT"; } }; template<class T> struct sum_t { T t; operator std::string() const { return "SUM"; } }; template<class T> struct total_t { T t; operator std::string() const { return "TOTAL"; } }; template<class T> struct max_t { T t; operator std::string() const { return "MAX"; } }; template<class T> struct min_t { T t; operator std::string() const { return "MIN"; } }; template<class T> struct group_concat_single_t { T t; operator std::string() const { return "GROUP_CONCAT"; } }; template<class T> struct group_concat_double_t { T t; std::string y; operator std::string() const { return "GROUP_CONCAT"; } }; } template<class T> aggregate_functions::avg_t<T> avg(T t) { return {t}; } template<class T> aggregate_functions::count_t<T> count(T t) { return {t}; } inline aggregate_functions::count_asterisk_t count() { return {}; } template<class T> aggregate_functions::sum_t<T> sum(T t) { return {t}; } template<class T> aggregate_functions::max_t<T> max(T t) { return {t}; } template<class T> aggregate_functions::min_t<T> min(T t) { return {t}; } template<class T> aggregate_functions::total_t<T> total(T t) { return {t}; } template<class T> aggregate_functions::group_concat_single_t<T> group_concat(T t) { return {t}; } template<class T, class Y> aggregate_functions::group_concat_double_t<T> group_concat(T t, Y y) { return {t, y}; } } #pragma once namespace sqlite_orm { namespace internal { /** * Cute class used to compare setters/getters and member pointers with each other. */ template<class L, class R> struct typed_comparator { bool operator()(const L &, const R &) const { return false; } }; template<class O> struct typed_comparator<O, O> { bool operator()(const O &lhs, const O &rhs) const { return lhs == rhs; } }; template<class L, class R> bool compare_any(const L &lhs, const R &rhs) { return typed_comparator<L, R>()(lhs, rhs); } } } #pragma once #include <string> // std::string namespace sqlite_orm { namespace internal { /** * DISCTINCT generic container. */ template<class T> struct distinct_t { T t; operator std::string() const { return "DISTINCT"; } }; /** * ALL generic container. */ template<class T> struct all_t { T t; operator std::string() const { return "ALL"; } }; template<class ...Args> struct columns_t { bool distinct = false; template<class L> void for_each(L) const { //.. } int count() const { return 0; } }; template<class T, class ...Args> struct columns_t<T, Args...> : public columns_t<Args...> { T m; columns_t(decltype(m) m_, Args&& ...args): super(std::forward<Args>(args)...), m(m_) {} template<class L> void for_each(L l) const { l(this->m); this->super::for_each(l); } int count() const { return 1 + this->super::count(); } private: using super = columns_t<Args...>; }; template<class ...Args> struct set_t { operator std::string() const { return "SET"; } template<class F> void for_each(F) { //.. } }; template<class L, class ...Args> struct set_t<L, Args...> : public set_t<Args...> { static_assert(is_assign_t<typename std::remove_reference<L>::type>::value, "set_t argument must be assign_t"); L l; using super = set_t<Args...>; using self = set_t<L, Args...>; set_t(L l_, Args&& ...args) : super(std::forward<Args>(args)...), l(std::forward<L>(l_)) {} template<class F> void for_each(F f) { f(l); this->super::for_each(f); } }; /** * This class is used to store explicit mapped type T and its column descriptor (member pointer/getter/setter). * Is useful when mapped type is derived from other type and base class has members mapped to a storage. */ template<class T, class F> struct column_pointer { using type = T; using field_type = F; field_type field; }; /** * Subselect object type. */ template<class T, class ...Args> struct select_t { using return_type = T; using conditions_type = std::tuple<Args...>; return_type col; conditions_type conditions; }; /** * Union object type. */ template<class L, class R> struct union_t { using left_type = L; using right_type = R; left_type left; right_type right; bool all = false; union_t(left_type l, right_type r, decltype(all) all_): left(std::move(l)), right(std::move(r)), all(all_) {} union_t(left_type l, right_type r): left(std::move(l)), right(std::move(r)) {} operator std::string() const { if(!this->all){ return "UNION"; }else{ return "UNION ALL"; } } }; /** * Generic way to get DISTINCT value from any type. */ template<class T> bool get_distinct(const T &t) { return false; } template<class ...Args> bool get_distinct(const columns_t<Args...> &cols) { return cols.distinct; } } template<class T> internal::distinct_t<T> distinct(T t) { return {t}; } template<class T> internal::all_t<T> all(T t) { return {t}; } template<class ...Args> internal::columns_t<Args...> distinct(internal::columns_t<Args...> cols) { cols.distinct = true; return cols; } /** * SET keyword used in UPDATE ... SET queries. * Args must have `assign_t` type. E.g. set(assign(&User::id, 5)) or set(c(&User::id) = 5) */ template<class ...Args> internal::set_t<Args...> set(Args&& ...args) { return {std::forward<Args>(args)...}; } template<class ...Args> internal::columns_t<Args...> columns(Args&& ...args) { return {std::forward<Args>(args)...}; } /** * Use it like this: * struct MyType : BaseType { ... }; * storage.select(column<MyType>(&BaseType::id)); */ template<class T, class F> internal::column_pointer<T, F> column(F f) { return {f}; } /** * Public function for subselect query. Is useful in UNION queries. */ template<class T, class ...Args> internal::select_t<T, Args...> select(T t, Args ...args) { return {std::move(t), std::make_tuple<Args...>(std::forward<Args>(args)...)}; } /** * Public function for UNION operator. * lhs and rhs are subselect objects. * Look through example in examples/union.cpp */ template<class L, class R> internal::union_t<L, R> union_(L lhs, R rhs) { return {std::move(lhs), std::move(rhs)}; } /** * Public function for UNION ALL operator. * lhs and rhs are subselect objects. * Look through example in examples/union.cpp */ template<class L, class R> internal::union_t<L, R> union_all(L lhs, R rhs) { return {std::move(lhs), std::move(rhs), true}; } } #pragma once #include <string> // std::string #include <sqlite3.h> #include <system_error> // std::error_code, std::system_error // #include "error_code.h" namespace sqlite_orm { namespace internal { struct database_connection { database_connection(const std::string &filename) { auto rc = sqlite3_open(filename.c_str(), &this->db); if(rc != SQLITE_OK){ throw std::system_error(std::error_code(sqlite3_errcode(this->db), get_sqlite_error_category())); } } ~database_connection() { sqlite3_close(this->db); } sqlite3* get_db() { return this->db; } protected: sqlite3 *db = nullptr; }; } } #pragma once #include <type_traits> // std::enable_if, std::is_member_pointer // #include "select_constraints.h" // #include "column.h" namespace sqlite_orm { namespace internal { /** * Trait class used to define table mapped type by setter/getter/member */ template<class T, class SFINAE = void> struct table_type; template<class O, class F> struct table_type<F O::*, typename std::enable_if<std::is_member_pointer<F O::*>::value && !std::is_member_function_pointer<F O::*>::value>::type> { using type = O; }; template<class T> struct table_type<T, typename std::enable_if<is_getter<T>::value>::type> { using type = typename getter_traits<T>::object_type; }; template<class T> struct table_type<T, typename std::enable_if<is_setter<T>::value>::type> { using type = typename setter_traits<T>::object_type; }; template<class T, class F> struct table_type<column_pointer<T, F>, void> { using type = T; }; } } #pragma once #include <string> // std::string namespace sqlite_orm { struct table_info { int cid; std::string name; std::string type; bool notnull; std::string dflt_value; int pk; }; } #pragma once #include <sqlite3.h> namespace sqlite_orm { /** * Guard class which finalizes `sqlite3_stmt` in dtor */ struct statement_finalizer { sqlite3_stmt *stmt = nullptr; statement_finalizer(decltype(stmt) stmt_): stmt(stmt_) {} inline ~statement_finalizer() { sqlite3_finalize(this->stmt); } }; } #pragma once namespace sqlite_orm { /** * Helper classes used by statement_binder and row_extractor. */ struct int_or_smaller_tag{}; struct bigint_tag{}; struct real_tag{}; template<class V> struct arithmetic_tag { using type = std::conditional_t< std::is_integral<V>::value, // Integer class std::conditional_t< sizeof(V) <= sizeof(int), int_or_smaller_tag, bigint_tag >, // Floating-point class real_tag >; }; template<class V> using arithmetic_tag_t = typename arithmetic_tag<V>::type; } #pragma once namespace sqlite_orm { /** * Specialization for optional type (std::shared_ptr / std::unique_ptr). */ template <typename T> struct is_std_ptr : std::false_type {}; template <typename T> struct is_std_ptr<std::shared_ptr<T>> : std::true_type { static std::shared_ptr<T> make(const T& v) { return std::make_shared<T>(v); } }; template <typename T> struct is_std_ptr<std::unique_ptr<T>> : std::true_type { static std::unique_ptr<T> make(const T& v) { return std::make_unique<T>(v); } }; } #pragma once #include <sqlite3.h> #include <type_traits> // std::enable_if_t, std::is_arithmetic, std::is_same #include <string> // std::string, std::wstring #include <codecvt> // std::wstring_convert, std::codecvt_utf8_utf16 #include <vector> // std::vector #include <cstddef> // std::nullptr_t // #include "is_std_ptr.h" namespace sqlite_orm { /** * Helper class used for binding fields to sqlite3 statements. */ template<class V, typename Enable = void> struct statement_binder { int bind(sqlite3_stmt *stmt, int index, const V &value); }; /** * Specialization for arithmetic types. */ template<class V> struct statement_binder< V, std::enable_if_t<std::is_arithmetic<V>::value> > { int bind(sqlite3_stmt *stmt, int index, const V &value) { return bind(stmt, index, value, tag()); } private: using tag = arithmetic_tag_t<V>; int bind(sqlite3_stmt *stmt, int index, const V &value, const int_or_smaller_tag&) { return sqlite3_bind_int(stmt, index, static_cast<int>(value)); } int bind(sqlite3_stmt *stmt, int index, const V &value, const bigint_tag&) { return sqlite3_bind_int64(stmt, index, static_cast<sqlite3_int64>(value)); } int bind(sqlite3_stmt *stmt, int index, const V &value, const real_tag&) { return sqlite3_bind_double(stmt, index, static_cast<double>(value)); } }; /** * Specialization for std::string and C-string. */ template<class V> struct statement_binder< V, std::enable_if_t< std::is_same<V, std::string>::value || std::is_same<V, const char*>::value > > { int bind(sqlite3_stmt *stmt, int index, const V &value) { return sqlite3_bind_text(stmt, index, string_data(value), -1, SQLITE_TRANSIENT); } private: const char* string_data(const std::string& s) const { return s.c_str(); } const char* string_data(const char* s) const{ return s; } }; /** * Specialization for std::wstring and C-wstring. */ template<class V> struct statement_binder< V, std::enable_if_t< std::is_same<V, std::wstring>::value || std::is_same<V, const wchar_t*>::value > > { int bind(sqlite3_stmt *stmt, int index, const V &value) { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; std::string utf8Str = converter.to_bytes(value); return statement_binder<decltype(utf8Str)>().bind(stmt, index, utf8Str); } }; /** * Specialization for std::nullptr_t. */ template<class V> struct statement_binder< V, std::enable_if_t<std::is_same<V, std::nullptr_t>::value> > { int bind(sqlite3_stmt *stmt, int index, const V &) { return sqlite3_bind_null(stmt, index); } }; template<class V> struct statement_binder< V, std::enable_if_t<is_std_ptr<V>::value> > { using value_type = typename V::element_type; int bind(sqlite3_stmt *stmt, int index, const V &value) { if(value){ return statement_binder<value_type>().bind(stmt, index, *value); }else{ return statement_binder<std::nullptr_t>().bind(stmt, index, nullptr); } } }; /** * Specialization for optional type (std::vector<char>). */ template<class V> struct statement_binder< V, std::enable_if_t<std::is_same<V, std::vector<char>>::value> > { int bind(sqlite3_stmt *stmt, int index, const V &value) { if (value.size()) { return sqlite3_bind_blob(stmt, index, (const void *)&value.front(), int(value.size()), SQLITE_TRANSIENT); }else{ return sqlite3_bind_blob(stmt, index, "", 0, SQLITE_TRANSIENT); } } }; } #pragma once #include <sqlite3.h> #include <type_traits> // std::enable_if_t, std::is_arithmetic, std::is_same, std::enable_if #include <cstdlib> // atof, atoi, atoll #include <string> // std::string, std::wstring #include <codecvt> // std::wstring_convert, std::codecvt_utf8_utf16 #include <vector> // std::vector #include <cstring> // strlen #include <algorithm> // std::copy #include <iterator> // std::back_inserter #include <tuple> // std::tuple, std::tuple_size, std::tuple_element // #include "arithmetic_tag.h" namespace sqlite_orm { /** * Helper class used to cast values from argv to V class * which depends from column type. * */ template<class V, typename Enable = void> struct row_extractor { // used in sqlite3_exec (select) V extract(const char *row_value); // used in sqlite_column (iteration, get_all) V extract(sqlite3_stmt *stmt, int columnIndex); }; /** * Specialization for arithmetic types. */ template<class V> struct row_extractor< V, std::enable_if_t<std::is_arithmetic<V>::value> > { V extract(const char *row_value) { return extract(row_value, tag()); } V extract(sqlite3_stmt *stmt, int columnIndex) { return extract(stmt, columnIndex, tag()); } private: using tag = arithmetic_tag_t<V>; V extract(const char *row_value, const int_or_smaller_tag&) { return static_cast<V>(atoi(row_value)); } V extract(sqlite3_stmt *stmt, int columnIndex, const int_or_smaller_tag&) { return static_cast<V>(sqlite3_column_int(stmt, columnIndex)); } V extract(const char *row_value, const bigint_tag&) { return static_cast<V>(atoll(row_value)); } V extract(sqlite3_stmt *stmt, int columnIndex, const bigint_tag&) { return static_cast<V>(sqlite3_column_int64(stmt, columnIndex)); } V extract(const char *row_value, const real_tag&) { return static_cast<V>(atof(row_value)); } V extract(sqlite3_stmt *stmt, int columnIndex, const real_tag&) { return static_cast<V>(sqlite3_column_double(stmt, columnIndex)); } }; /** * Specialization for std::string. */ template<class V> struct row_extractor< V, std::enable_if_t<std::is_same<V, std::string>::value> > { std::string extract(const char *row_value) { if(row_value){ return row_value; }else{ return {}; } } std::string extract(sqlite3_stmt *stmt, int columnIndex) { auto cStr = (const char*)sqlite3_column_text(stmt, columnIndex); if(cStr){ return cStr; }else{ return {}; } } }; /** * Specialization for std::wstring. */ template<class V> struct row_extractor< V, std::enable_if_t<std::is_same<V, std::wstring>::value> > { std::wstring extract(const char *row_value) { if(row_value){ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; return converter.from_bytes(row_value); }else{ return {}; } } std::wstring extract(sqlite3_stmt *stmt, int columnIndex) { auto cStr = (const char*)sqlite3_column_text(stmt, columnIndex); if(cStr){ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; return converter.from_bytes(cStr); }else{ return {}; } } }; /** * Specialization for std::vector<char>. */ template<class V> struct row_extractor< V, std::enable_if_t<std::is_same<V, std::vector<char>>::value> > { std::vector<char> extract(const char *row_value) { if(row_value){ auto len = ::strlen(row_value); return this->go(row_value, static_cast<int>(len)); }else{ return {}; } } std::vector<char> extract(sqlite3_stmt *stmt, int columnIndex) { auto bytes = static_cast<const char *>(sqlite3_column_blob(stmt, columnIndex)); auto len = sqlite3_column_bytes(stmt, columnIndex); return this->go(bytes, len); } protected: std::vector<char> go(const char *bytes, int len) { if(len){ std::vector<char> res; res.reserve(len); std::copy(bytes, bytes + len, std::back_inserter(res)); return res; }else{ return {}; } } }; template<class V> struct row_extractor< V, std::enable_if_t<is_std_ptr<V>::value> > { using value_type = typename V::element_type; V extract(const char *row_value) { if(row_value){ return is_std_ptr<V>::make(row_extractor<value_type>().extract(row_value)); }else{ return {}; } } V extract(sqlite3_stmt *stmt, int columnIndex) { auto type = sqlite3_column_type(stmt, columnIndex); if(type != SQLITE_NULL){ return is_std_ptr<V>::make(row_extractor<value_type>().extract(stmt, columnIndex)); }else{ return {}; } } }; /** * Specialization for std::vector<char>. */ template<> struct row_extractor<std::vector<char>> { std::vector<char> extract(const char *row_value) { if(row_value){ auto len = ::strlen(row_value); return this->go(row_value, static_cast<int>(len)); }else{ return {}; } } std::vector<char> extract(sqlite3_stmt *stmt, int columnIndex) { auto bytes = static_cast<const char *>(sqlite3_column_blob(stmt, columnIndex)); auto len = sqlite3_column_bytes(stmt, columnIndex); return this->go(bytes, len); } protected: std::vector<char> go(const char *bytes, int len) { if(len){ std::vector<char> res; res.reserve(len); std::copy(bytes, bytes + len, std::back_inserter(res)); return res; }else{ return {}; } } }; template<class ...Args> struct row_extractor<std::tuple<Args...>> { std::tuple<Args...> extract(char **argv) { std::tuple<Args...> res; this->extract<std::tuple_size<decltype(res)>::value>(res, argv); return res; } std::tuple<Args...> extract(sqlite3_stmt *stmt, int /*columnIndex*/) { std::tuple<Args...> res; this->extract<std::tuple_size<decltype(res)>::value>(res, stmt); return res; } protected: template<size_t I, typename std::enable_if<I != 0>::type * = nullptr> void extract(std::tuple<Args...> &t, sqlite3_stmt *stmt) { using tuple_type = typename std::tuple_element<I - 1, typename std::tuple<Args...>>::type; std::get<I - 1>(t) = row_extractor<tuple_type>().extract(stmt, I - 1); this->extract<I - 1>(t, stmt); } template<size_t I, typename std::enable_if<I == 0>::type * = nullptr> void extract(std::tuple<Args...> &, sqlite3_stmt *) { //.. } template<size_t I, typename std::enable_if<I != 0>::type * = nullptr> void extract(std::tuple<Args...> &t, char **argv) { using tuple_type = typename std::tuple_element<I - 1, typename std::tuple<Args...>>::type; std::get<I - 1>(t) = row_extractor<tuple_type>().extract(argv[I - 1]); this->extract<I - 1>(t, argv); } template<size_t I, typename std::enable_if<I == 0>::type * = nullptr> void extract(std::tuple<Args...> &, char **) { //.. } }; } #pragma once #include <ostream> namespace sqlite_orm { enum class sync_schema_result { /** * created new table, table with the same tablename did not exist */ new_table_created, /** * table schema is the same as storage, nothing to be done */ already_in_sync, /** * removed excess columns in table (than storage) without dropping a table */ old_columns_removed, /** * lacking columns in table (than storage) added without dropping a table */ new_columns_added, /** * both old_columns_removed and new_columns_added */ new_columns_added_and_old_columns_removed, /** * old table is dropped and new is recreated. Reasons : * 1. delete excess columns in the table than storage if preseve = false * 2. Lacking columns in the table cannot be added due to NULL and DEFAULT constraint * 3. Reasons 1 and 2 both together * 4. data_type mismatch between table and storage. */ dropped_and_recreated, }; inline std::ostream& operator<<(std::ostream &os, sync_schema_result value) { switch(value){ case sync_schema_result::new_table_created: return os << "new table created"; case sync_schema_result::already_in_sync: return os << "table and storage is already in sync."; case sync_schema_result::old_columns_removed: return os << "old excess columns removed"; case sync_schema_result::new_columns_added: return os << "new columns added"; case sync_schema_result::new_columns_added_and_old_columns_removed: return os << "old excess columns removed and new columns added"; case sync_schema_result::dropped_and_recreated: return os << "old table dropped and recreated"; } } } #pragma once #include <tuple> // std::tuple, std::make_tuple #include <string> // std::string namespace sqlite_orm { namespace internal { template<class ...Cols> struct index_t { using columns_type = std::tuple<Cols...>; using object_type = void; std::string name; bool unique; columns_type columns; template<class L> void for_each_column_with_constraints(L) {} }; } template<class ...Cols> internal::index_t<Cols...> make_index(const std::string &name, Cols ...cols) { return {name, false, std::make_tuple(cols...)}; } template<class ...Cols> internal::index_t<Cols...> make_unique_index(const std::string &name, Cols ...cols) { return {name, true, std::make_tuple(cols...)}; } } #pragma once // #include "alias.h" namespace sqlite_orm { namespace internal { /** * If T is alias than mapped_type_proxy<T>::type is alias::type * otherwise T is T. */ template<class T> struct mapped_type_proxy { using type = T; }; template<class T, char A> struct mapped_type_proxy<alias<T, A>> { using type = T; }; } } #pragma once #include <string> // std::string namespace sqlite_orm { namespace internal { struct rowid_t { operator std::string() const { return "rowid"; } }; struct oid_t { operator std::string() const { return "oid"; } }; struct _rowid_t { operator std::string() const { return "_rowid_"; } }; template<class T> struct table_rowid_t : public rowid_t { using type = T; }; template<class T> struct table_oid_t : public oid_t { using type = T; }; template<class T> struct table__rowid_t : public _rowid_t { using type = T; }; } inline internal::rowid_t rowid() { return {}; } inline internal::oid_t oid() { return {}; } inline internal::_rowid_t _rowid_() { return {}; } template<class T> internal::table_rowid_t<T> rowid() { return {}; } template<class T> internal::table_oid_t<T> oid() { return {}; } template<class T> internal::table__rowid_t<T> _rowid_() { return {}; } } #pragma once #include <type_traits> // std::enable_if, std::is_same #include <tuple> // std::tuple // #include "core_functions.h" // #include "aggregate_functions.h" // #include "select_constraints.h" // #include "operators.h" // #include "rowid.h" // #include "alias.h" // #include "column.h" namespace sqlite_orm { namespace internal { /** * This is a proxy class used to define what type must have result type depending on select * arguments (member pointer, aggregate functions, etc). Below you can see specializations * for different types. E.g. specialization for core_functions::length_t has `type` int cause * LENGTH returns INTEGER in sqlite. Every column_result_t must have `type` type that equals * c++ SELECT return type for T * T - C++ type * Ts - tables pack from storage. Rarely used. Required in asterisk to define columns mapped for a type */ template<class T, class SFINAE = void> struct column_result_t; template<class O, class F> struct column_result_t<F O::*, typename std::enable_if<std::is_member_pointer<F O::*>::value && !std::is_member_function_pointer<F O::*>::value>::type> { using type = F; }; /** * Common case for all getter types. Getter types are defined in column.h file */ template<class T> struct column_result_t<T, typename std::enable_if<is_getter<T>::value>::type> { using type = typename getter_traits<T>::field_type; }; /** * Common case for all setter types. Setter types are defined in column.h file */ template<class T> struct column_result_t<T, typename std::enable_if<is_setter<T>::value>::type> { using type = typename setter_traits<T>::field_type; }; template<class T> struct column_result_t<core_functions::length_t<T>, void> { using type = int; }; #if SQLITE_VERSION_NUMBER >= 3007016 template<class ...Args> struct column_result_t<core_functions::char_t_<Args...>, void> { using type = std::string; }; #endif template<> struct column_result_t<core_functions::random_t, void> { using type = int; }; template<> struct column_result_t<core_functions::changes_t, void> { using type = int; }; template<class T> struct column_result_t<core_functions::abs_t<T>, void> { using type = std::shared_ptr<double>; }; template<class T> struct column_result_t<core_functions::lower_t<T>, void> { using type = std::string; }; template<class T> struct column_result_t<core_functions::upper_t<T>, void> { using type = std::string; }; template<class X> struct column_result_t<core_functions::trim_single_t<X>, void> { using type = std::string; }; template<class X, class Y> struct column_result_t<core_functions::trim_double_t<X, Y>, void> { using type = std::string; }; template<class X> struct column_result_t<core_functions::ltrim_single_t<X>, void> { using type = std::string; }; template<class X, class Y> struct column_result_t<core_functions::ltrim_double_t<X, Y>, void> { using type = std::string; }; template<class X> struct column_result_t<core_functions::rtrim_single_t<X>, void> { using type = std::string; }; template<class X, class Y> struct column_result_t<core_functions::rtrim_double_t<X, Y>, void> { using type = std::string; }; template<class T, class ...Args> struct column_result_t<core_functions::date_t<T, Args...>, void> { using type = std::string; }; template<class T, class ...Args> struct column_result_t<core_functions::datetime_t<T, Args...>, void> { using type = std::string; }; template<class T> struct column_result_t<aggregate_functions::avg_t<T>, void> { using type = double; }; template<class T> struct column_result_t<aggregate_functions::count_t<T>, void> { using type = int; }; template<> struct column_result_t<aggregate_functions::count_asterisk_t, void> { using type = int; }; template<class T> struct column_result_t<aggregate_functions::sum_t<T>, void> { using type = std::shared_ptr<double>; }; template<class T> struct column_result_t<aggregate_functions::total_t<T>, void> { using type = double; }; template<class T> struct column_result_t<aggregate_functions::group_concat_single_t<T>, void> { using type = std::string; }; template<class T> struct column_result_t<aggregate_functions::group_concat_double_t<T>, void> { using type = std::string; }; template<class T> struct column_result_t<aggregate_functions::max_t<T>, void> { using type = std::shared_ptr<typename column_result_t<T>::type>; }; template<class T> struct column_result_t<aggregate_functions::min_t<T>, void> { using type = std::shared_ptr<typename column_result_t<T>::type>; }; template<class T> struct column_result_t<distinct_t<T>, void> { using type = typename column_result_t<T>::type; }; template<class T> struct column_result_t<all_t<T>, void> { using type = typename column_result_t<T>::type; }; template<class L, class R> struct column_result_t<conc_t<L, R>, void> { using type = std::string; }; template<class L, class R> struct column_result_t<add_t<L, R>, void> { using type = double; }; template<class L, class R> struct column_result_t<sub_t<L, R>, void> { using type = double; }; template<class L, class R> struct column_result_t<mul_t<L, R>, void> { using type = double; }; template<class L, class R> struct column_result_t<div_t<L, R>, void> { using type = double; }; template<class L, class R> struct column_result_t<mod_t<L, R>, void> { using type = double; }; template<> struct column_result_t<rowid_t, void> { using type = int64; }; template<> struct column_result_t<oid_t, void> { using type = int64; }; template<> struct column_result_t<_rowid_t, void> { using type = int64; }; template<class T> struct column_result_t<table_rowid_t<T>, void> { using type = int64; }; template<class T> struct column_result_t<table_oid_t<T>, void> { using type = int64; }; template<class T> struct column_result_t<table__rowid_t<T>, void> { using type = int64; }; template<class T, class C> struct column_result_t<alias_column_t<T, C>, void> { using type = typename column_result_t<C>::type; }; template<class T, class F> struct column_result_t<column_pointer<T, F>> : column_result_t<F, void> {}; template<class ...Args> struct column_result_t<columns_t<Args...>, void> { using type = std::tuple<typename column_result_t<Args>::type...>; }; template<class T, class ...Args> struct column_result_t<select_t<T, Args...>> : column_result_t<T, void> {}; template<class L, class R> struct column_result_t<union_t<L, R>, void> { using left_type = typename column_result_t<L>::type; using right_type = typename column_result_t<R>::type; static_assert(std::is_same<left_type, right_type>::value, "Union subselect queries must return same types"); using type = left_type; }; } } #pragma once #include <vector> // std::vector #include <string> // std::string #include <tuple> // std::tuple #include <type_traits> // std::is_same, std::integral_constant, std::true_type, std::false_type // #include "column.h" // #include "tuple_helper.h" // #include "constraints.h" namespace sqlite_orm { namespace internal { /** * Common case for table_impl class. */ template<typename... Args> struct table_impl { std::vector<std::string> column_names() { return {}; } template<class ...Op> std::vector<std::string> column_names_exept() { return {}; } template<class ...Op> std::vector<std::string> column_names_with() { return {}; } template<class L> void for_each_column(L) {} template<class L> void for_each_column_with_constraints(L) {} template<class F, class L> void for_each_column_with_field_type(L) {} template<class Op, class L> void for_each_column_exept(L) {} template<class Op, class L> void for_each_column_with(L) {} template<class L> void for_each_primary_key(L) {} int columns_count() const { return 0; } }; template<typename H, typename... T> struct table_impl<H, T...> : private table_impl<T...> { using column_type = H; using tail_types = std::tuple<T...>; table_impl(H h, T ...t) : super(t...), col(h) {} column_type col; int columns_count() const { return 1 + this->super::columns_count(); } /** * column_names_with implementation. Notice that result will be reversed. * It is reversed back in `table` class. * @return vector of column names that have specified Op... conditions. */ template<class ...Op> std::vector<std::string> column_names_with() { auto res = this->super::template column_names_with<Op...>(); if(this->col.template has_every<Op...>()) { res.emplace_back(this->col.name); } return res; } /** * For each implementation. Calls templated lambda with its column * and passed call to superclass. */ template<class L> void for_each_column(L l){ this->apply_to_col_if(l, internal::is_column<column_type>{}); this->super::for_each_column(l); } /** * For each implementation. Calls templated lambda with its column * and passed call to superclass. */ template<class L> void for_each_column_with_constraints(L l){ l(this->col); this->super::for_each_column_with_constraints(l); } template<class F, class L> void for_each_column_with_field_type(L l) { this->apply_to_col_if(l, std::is_same<F, typename column_type::field_type>{}); this->super::template for_each_column_with_field_type<F, L>(l); } /** * Working version of `for_each_column_exept`. Calls lambda if column has no option and fire super's function. */ template<class Op, class L> void for_each_column_exept(L l) { using has_opt = tuple_helper::tuple_contains_type<Op, typename column_type::constraints_type>; this->apply_to_col_if(l, std::integral_constant<bool, !has_opt::value>{}); this->super::template for_each_column_exept<Op, L>(l); } /** * Working version of `for_each_column_with`. Calls lambda if column has option and fire super's function. */ template<class Op, class L> void for_each_column_with(L l) { this->apply_to_col_if(l, tuple_helper::tuple_contains_type<Op, typename column_type::constraints_type>{}); this->super::template for_each_column_with<Op, L>(l); } /** * Calls l(this->col) if H is primary_key_t */ template<class L> void for_each_primary_key(L l) { this->apply_to_col_if(l, internal::is_primary_key<H>{}); this->super::for_each_primary_key(l); } template<class L> void apply_to_col_if(L& l, std::true_type) { l(this->col); } template<class L> void apply_to_col_if(L&, std::false_type) {} private: using super = table_impl<T...>; }; } } #pragma once #include <string> // std::string #include <type_traits> // std::remove_reference, std::is_same, std::is_base_of #include <vector> // std::vector #include <tuple> // std::tuple_size, std::tuple_element #include <algorithm> // std::reverse, std::find_if // #include "table_impl.h" // #include "column_result.h" // #include "static_magic.h" // #include "typed_comparator.h" // #include "constraints.h" // #include "tuple_helper.h" // #include "table_info.h" // #include "type_printer.h" // #include "column.h" namespace sqlite_orm { namespace internal { /** * Table interface class. Implementation is hidden in `table_impl` class. */ template<class T, class ...Cs> struct table_t { using impl_type = table_impl<Cs...>; using object_type = T; /** * Table name. */ const std::string name; /** * Implementation that stores columns information. */ impl_type impl; table_t(decltype(name) name_, decltype(impl) impl_): name(std::move(name_)), impl(std::move(impl_)) {} bool _without_rowid = false; table_t<T, Cs...> without_rowid() const { auto res = *this; res._without_rowid = true; return res; } /** * Function used to get field value from object by mapped member pointer/setter/getter */ template<class F, class C> const F* get_object_field_pointer(const object_type &obj, C c) { const F *res = nullptr; using field_type = typename internal::column_result_t<C>::type; this->for_each_column_with_field_type<field_type>([&res, &c, &obj, this](auto &col){ using namespace static_magic; using column_type = typename std::remove_reference<decltype(col)>::type; using member_pointer_t = typename column_type::member_pointer_t; using getter_type = typename column_type::getter_type; using setter_type = typename column_type::setter_type; if(!res){ static_if<std::is_same<C, member_pointer_t>{}>([&res, &obj, &col, &c]{ if(compare_any(col.member_pointer, c)){ res = &(obj.*col.member_pointer); } })(); } if(!res){ static_if<std::is_same<C, getter_type>{}>([&res, &obj, &col, &c]{ if(compare_any(col.getter, c)){ res = &((obj).*(col.getter))(); } })(); } if(!res){ static_if<std::is_same<C, setter_type>{}>([&res, &obj, &col, &c]{ if(compare_any(col.setter, c)){ res = &((obj).*(col.getter))(); } })(); } }); return res; } /** * @return vector of column names of table. */ std::vector<std::string> column_names() { std::vector<std::string> res; this->impl.for_each_column([&res](auto &c){ res.push_back(c.name); }); return res; } std::vector<std::string> composite_key_columns_names() { std::vector<std::string> res; this->impl.for_each_primary_key([this, &res](auto c){ res = this->composite_key_columns_names(c); }); return res; } std::vector<std::string> primary_key_column_names() { std::vector<std::string> res; this->impl.template for_each_column_with<constraints::primary_key_t<>>([&res](auto &c){ res.push_back(c.name); }); if(!res.size()){ res = this->composite_key_columns_names(); } return res; } template<class ...Args> std::vector<std::string> composite_key_columns_names(constraints::primary_key_t<Args...> pk) { std::vector<std::string> res; using pk_columns_tuple = decltype(pk.columns); res.reserve(std::tuple_size<pk_columns_tuple>::value); tuple_helper::iterator<std::tuple_size<pk_columns_tuple>::value - 1, Args...>()(pk.columns, [this, &res](auto &v){ res.push_back(this->find_column_name(v)); }); return res; } int columns_count() const { return this->impl.columns_count(); } /** * Searches column name by class member pointer passed as first argument. * @return column name or empty string if nothing found. */ template< class F, class O, typename = typename std::enable_if<std::is_member_pointer<F O::*>::value && !std::is_member_function_pointer<F O::*>::value>::type> std::string find_column_name(F O::*m) { std::string res; this->template for_each_column_with_field_type<F>([&res, m](auto c) { if(c.member_pointer == m) { res = c.name; } }); return res; } /** * Searches column name by class getter function member pointer passed as first argument. * @return column name or empty string if nothing found. */ template<class G> std::string find_column_name(G getter, typename std::enable_if<is_getter<G>::value>::type * = nullptr) { std::string res; using field_type = typename getter_traits<G>::field_type; this->template for_each_column_with_field_type<field_type>([&res, getter](auto c) { if(c.getter == getter) { res = c.name; } }); return res; } /** * Searches column name by class setter function member pointer passed as first argument. * @return column name or empty string if nothing found. */ template<class S> std::string find_column_name(S setter, typename std::enable_if<is_setter<S>::value>::type * = nullptr) { std::string res; using field_type = typename setter_traits<S>::field_type; this->template for_each_column_with_field_type<field_type>([&res, setter](auto c) { if(c.setter == setter) { res = c.name; } }); return res; } /** * @return vector of column names that have constraints provided as template arguments (not_null, autoincrement). */ template<class ...Op> std::vector<std::string> column_names_with() { auto res = this->impl.template column_names_with<Op...>(); std::reverse(res.begin(), res.end()); return res; } /** * Iterates all columns and fires passed lambda. Lambda must have one and only templated argument Otherwise code will * not compile. Excludes table constraints (e.g. foreign_key_t) at the end of the columns list. To iterate columns with * table constraints use for_each_column_with_constraints instead. * L is lambda type. Do not specify it explicitly. * @param l Lambda to be called per column itself. Must have signature like this [] (auto col) -> void {} */ template<class L> void for_each_column(L l) { this->impl.for_each_column(l); } template<class L> void for_each_column_with_constraints(L l) { this->impl.for_each_column_with_constraints(l); } template<class F, class L> void for_each_column_with_field_type(L l) { this->impl.template for_each_column_with_field_type<F, L>(l); } /** * Iterates all columns exept ones that have specified constraints and fires passed lambda. * Lambda must have one and only templated argument Otherwise code will not compile. * L is lambda type. Do not specify it explicitly. * @param l Lambda to be called per column itself. Must have signature like this [] (auto col) -> void {} */ template<class Op, class L> void for_each_column_exept(L l) { this->impl.template for_each_column_exept<Op>(l); } /** * Iterates all columns that have specified constraints and fires passed lambda. * Lambda must have one and only templated argument Otherwise code will not compile. * L is lambda type. Do not specify it explicitly. * @param l Lambda to be called per column itself. Must have signature like this [] (auto col) -> void {} */ template<class Op, class L> void for_each_column_with(L l) { this->impl.template for_each_column_with<Op>(l); } std::vector<table_info> get_table_info() { std::vector<table_info> res; res.reserve(size_t(this->columns_count())); this->for_each_column([&res](auto &col){ std::string dft; using field_type = typename std::remove_reference<decltype(col)>::type::field_type; if(auto d = col.default_value()) { auto needQuotes = std::is_base_of<text_printer, type_printer<field_type>>::value; if(needQuotes){ dft = "'" + *d + "'"; }else{ dft = *d; } } table_info i{ -1, col.name, type_printer<field_type>().print(), col.not_null(), dft, col.template has<constraints::primary_key_t<>>(), }; res.emplace_back(i); }); std::vector<std::string> compositeKeyColumnNames; this->impl.for_each_primary_key([this, &compositeKeyColumnNames](auto c){ compositeKeyColumnNames = this->composite_key_columns_names(c); }); for(size_t i = 0; i < compositeKeyColumnNames.size(); ++i) { auto &columnName = compositeKeyColumnNames[i]; auto it = std::find_if(res.begin(), res.end(), [&columnName](const table_info &ti) { return ti.name == columnName; }); if(it != res.end()){ it->pk = static_cast<int>(i + 1); } } return res; } }; } /** * Function used for table creation. Do not use table constructor - use this function * cause table class is templated and its constructing too (just like std::make_shared or std::make_pair). */ template<class ...Cs, class T = typename std::tuple_element<0, std::tuple<Cs...>>::type::object_type> internal::table_t<T, Cs...> make_table(const std::string &name, Cs&& ...args) { return {name, internal::table_impl<Cs...>(std::forward<Cs>(args)...)}; } template<class T, class ...Cs> internal::table_t<T, Cs...> make_table(const std::string &name, Cs&& ...args) { return {name, internal::table_impl<Cs...>(std::forward<Cs>(args)...)}; } } #pragma once #include <string> // std::string #include <sqlite3.h> #include <cstddef> // std::nullptr_t #include <system_error> // std::system_error, std::error_code #include <sstream> // std::stringstream #include <cstdlib> // std::atoi #include <type_traits> // std::forward, std::enable_if, std::is_same, std::remove_reference #include <utility> // std::pair, std::make_pair #include <vector> // std::vector #include <algorithm> // std::find_if // #include "error_code.h" // #include "statement_finalizer.h" // #include "row_extractor.h" // #include "constraints.h" // #include "select_constraints.h" // #include "field_printer.h" // #include "table_info.h" // #include "sync_schema_result.h" // #include "sqlite_type.h" namespace sqlite_orm { namespace internal { /** * This is a generic implementation. Used as a tail in storage_impl inheritance chain */ template<class ...Ts> struct storage_impl { template<class L> void for_each(L) {} int foreign_keys_count() { return 0; } template<class O> std::string dump(const O &, sqlite3 *, std::nullptr_t) { throw std::system_error(std::make_error_code(orm_error_code::type_is_not_mapped_to_storage)); } bool table_exists(const std::string &tableName, sqlite3 *db) { auto res = false; std::stringstream ss; ss << "SELECT COUNT(*) FROM sqlite_master WHERE type = '" << "table" << "' AND name = '" << tableName << "'"; auto query = ss.str(); auto rc = sqlite3_exec(db, query.c_str(), [](void *data, int argc, char **argv,char ** /*azColName*/) -> int { auto &res = *(bool*)data; if(argc){ res = !!std::atoi(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } return res; } void begin_transaction(sqlite3 *db) { std::stringstream ss; ss << "BEGIN TRANSACTION"; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } void commit(sqlite3 *db) { std::stringstream ss; ss << "COMMIT"; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } void rollback(sqlite3 *db) { std::stringstream ss; ss << "ROLLBACK"; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } void rename_table(sqlite3 *db, const std::string &oldName, const std::string &newName) { std::stringstream ss; ss << "ALTER TABLE " << oldName << " RENAME TO " << newName; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } std::string current_timestamp(sqlite3 *db) { std::string res; std::stringstream ss; ss << "SELECT CURRENT_TIMESTAMP"; auto query = ss.str(); auto rc = sqlite3_exec(db, query.c_str(), [](void *data, int argc, char **argv, char **) -> int { auto &res = *(std::string*)data; if(argc){ if(argv[0]){ res = row_extractor<std::string>().extract(argv[0]); } } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } return res; } }; template<class H, class ...Ts> struct storage_impl<H, Ts...> : public storage_impl<Ts...> { using table_type = H; storage_impl(H h, Ts ...ts) : super(std::forward<Ts>(ts)...), table(std::move(h)) {} table_type table; template<class L> void for_each(L l) { this->super::for_each(l); l(this); } #if SQLITE_VERSION_NUMBER >= 3006019 /** * Returns foreign keys count in table definition */ int foreign_keys_count() { auto res = 0; this->table.for_each_column_with_constraints([&res](auto c){ if(internal::is_foreign_key<decltype(c)>::value) { ++res; } }); return res; } #endif /** * Is used to get column name by member pointer to a base class. * Main difference between `column_name` and `column_name_simple` is that * `column_name` has SFINAE check for type equality but `column_name_simple` has not. */ template<class O, class F> std::string column_name_simple(F O::*m) { return this->table.find_column_name(m); } /** * Same thing as above for getter. */ template<class T, typename std::enable_if<is_getter<T>::value>::type> std::string column_name_simple(T g) { return this->table.find_column_name(g); } /** * Same thing as above for setter. */ template<class T, typename std::enable_if<is_setter<T>::value>::type> std::string column_name_simple(T s) { return this->table.find_column_name(s); } /** * Cute function used to find column name by its type and member pointer. Uses SFINAE to * skip inequal type O. */ template<class O, class F, class HH = typename H::object_type> std::string column_name(F O::*m, typename std::enable_if<std::is_same<O, HH>::value>::type * = nullptr) { return this->table.find_column_name(m); } /** * Opposite version of function defined above. Just calls same function in superclass. */ template<class O, class F, class HH = typename H::object_type> std::string column_name(F O::*m, typename std::enable_if<!std::is_same<O, HH>::value>::type * = nullptr) { return this->super::column_name(m); } /** * Cute function used to find column name by its type and getter pointer. Uses SFINAE to * skip inequal type O. */ template<class O, class F, class HH = typename H::object_type> std::string column_name(const F& (O::*g)() const, typename std::enable_if<std::is_same<O, HH>::value>::type * = nullptr) { return this->table.find_column_name(g); } /** * Opposite version of function defined above. Just calls same function in superclass. */ template<class O, class F, class HH = typename H::object_type> std::string column_name(const F& (O::*g)() const, typename std::enable_if<!std::is_same<O, HH>::value>::type * = nullptr) { return this->super::column_name(g); } /** * Cute function used to find column name by its type and setter pointer. Uses SFINAE to * skip inequal type O. */ template<class O, class F, class HH = typename H::object_type> std::string column_name(void (O::*s)(F), typename std::enable_if<std::is_same<O, HH>::value>::type * = nullptr) { return this->table.find_column_name(s); } /** * Opposite version of function defined above. Just calls same function in superclass. */ template<class O, class F, class HH = typename H::object_type> std::string column_name(void (O::*s)(F), typename std::enable_if<!std::is_same<O, HH>::value>::type * = nullptr) { return this->super::column_name(s); } template<class T, class F, class HH = typename H::object_type> std::string column_name(const column_pointer<T, F> &c, typename std::enable_if<std::is_same<T, HH>::value>::type * = nullptr) { return this->column_name_simple(c.field); } template<class T, class F, class HH = typename H::object_type> std::string column_name(const column_pointer<T, F> &c, typename std::enable_if<!std::is_same<T, HH>::value>::type * = nullptr) { return this->super::column_name(c); } template<class O, class HH = typename H::object_type> auto& get_impl(typename std::enable_if<std::is_same<O, HH>::value>::type * = nullptr) { return *this; } template<class O, class HH = typename H::object_type> auto& get_impl(typename std::enable_if<!std::is_same<O, HH>::value>::type * = nullptr) { return this->super::template get_impl<O>(); } template<class O, class HH = typename H::object_type> std::string find_table_name(typename std::enable_if<std::is_same<O, HH>::value>::type * = nullptr) { return this->table.name; } template<class O, class HH = typename H::object_type> std::string find_table_name(typename std::enable_if<!std::is_same<O, HH>::value>::type * = nullptr) { return this->super::template find_table_name<O>(); } template<class O, class HH = typename H::object_type> std::string dump(const O &o, typename std::enable_if<!std::is_same<O, HH>::value>::type * = nullptr) { return this->super::dump(o, nullptr); } template<class O, class HH = typename H::object_type> std::string dump(const O &o, typename std::enable_if<std::is_same<O, HH>::value>::type * = nullptr) { std::stringstream ss; ss << "{ "; std::vector<std::pair<std::string, std::string>> pairs; this->table.for_each_column([&pairs, &o] (auto &c) { using field_type = typename std::remove_reference<decltype(c)>::type::field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } pairs.push_back(std::make_pair(c.name, field_printer<field_type>()(*value))); }); for(size_t i = 0; i < pairs.size(); ++i) { auto &p = pairs[i]; ss << p.first << " : '" << p.second << "'"; if(i < pairs.size() - 1) { ss << ", "; }else{ ss << " }"; } } return ss.str(); } std::vector<table_info> get_table_info(const std::string &tableName, sqlite3 *db) { std::vector<table_info> res; auto query = "PRAGMA table_info('" + tableName + "')"; auto rc = sqlite3_exec(db, query.c_str(), [](void *data, int argc, char **argv,char **) -> int { auto &res = *(std::vector<table_info>*)data; if(argc){ auto index = 0; auto cid = std::atoi(argv[index++]); std::string name = argv[index++]; std::string type = argv[index++]; bool notnull = !!std::atoi(argv[index++]); std::string dflt_value = argv[index] ? argv[index] : ""; index++; auto pk = std::atoi(argv[index++]); res.push_back(table_info{cid, name, type, notnull, dflt_value, pk}); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } return res; } void add_column(const table_info &ti, sqlite3 *db) { std::stringstream ss; ss << "ALTER TABLE " << this->table.name << " ADD COLUMN " << ti.name << " "; ss << ti.type << " "; if(ti.pk){ ss << "PRIMARY KEY "; } if(ti.notnull){ ss << "NOT NULL "; } if(ti.dflt_value.length()) { ss << "DEFAULT " << ti.dflt_value << " "; } auto query = ss.str(); sqlite3_stmt *stmt; auto prepareResult = sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr); if (prepareResult == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { //.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } /** * Copies current table to another table with a given **name**. * Performs CREATE TABLE %name% AS SELECT %this->table.columns_names()% FROM &this->table.name%; */ void copy_table(sqlite3 *db, const std::string &name) { std::stringstream ss; std::vector<std::string> columnNames; this->table.for_each_column([&columnNames] (auto c) { columnNames.emplace_back(c.name); }); auto columnNamesCount = columnNames.size(); ss << "INSERT INTO " << name << " ("; for(size_t i = 0; i < columnNamesCount; ++i) { ss << columnNames[i]; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << " "; } } ss << ") "; ss << "SELECT "; for(size_t i = 0; i < columnNamesCount; ++i) { ss << columnNames[i]; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << " "; } } ss << " FROM '" << this->table.name << "' "; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { //.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } sync_schema_result schema_status(sqlite3 *db, bool preserve) { auto res = sync_schema_result::already_in_sync; // first let's see if table with such name exists.. auto gottaCreateTable = !this->table_exists(this->table.name, db); if(!gottaCreateTable){ // get table info provided in `make_table` call.. auto storageTableInfo = this->table.get_table_info(); // now get current table info from db using `PRAGMA table_info` query.. auto dbTableInfo = get_table_info(this->table.name, db); // this vector will contain pointers to columns that gotta be added.. std::vector<table_info*> columnsToAdd; if(get_remove_add_columns(columnsToAdd, storageTableInfo, dbTableInfo)) { gottaCreateTable = true; } if(!gottaCreateTable){ // if all storage columns are equal to actual db columns but there are excess columns at the db.. if(dbTableInfo.size() > 0){ //extra table columns than storage columns if(!preserve){ gottaCreateTable = true; }else{ res = decltype(res)::old_columns_removed; } } } if(gottaCreateTable){ res = decltype(res)::dropped_and_recreated; }else{ if(columnsToAdd.size()){ //extra storage columns than table columns for(auto columnPointer : columnsToAdd) { if(columnPointer->notnull && columnPointer->dflt_value.empty()){ gottaCreateTable = true; break; } } if(!gottaCreateTable){ if(res == decltype(res)::old_columns_removed) { res = decltype(res)::new_columns_added_and_old_columns_removed; }else{ res = decltype(res)::new_columns_added; } }else{ res = decltype(res)::dropped_and_recreated; } }else{ if(res != decltype(res)::old_columns_removed){ res = decltype(res)::already_in_sync; } } } }else{ res = decltype(res)::new_table_created; } return res; } static bool get_remove_add_columns(std::vector<table_info*>& columnsToAdd, std::vector<table_info>& storageTableInfo, std::vector<table_info>& dbTableInfo) { bool notEqual = false; // iterate through storage columns for(size_t storageColumnInfoIndex = 0; storageColumnInfoIndex < storageTableInfo.size(); ++storageColumnInfoIndex) { // get storage's column info auto &storageColumnInfo = storageTableInfo[storageColumnInfoIndex]; auto &columnName = storageColumnInfo.name; // search for a column in db eith the same name auto dbColumnInfoIt = std::find_if(dbTableInfo.begin(), dbTableInfo.end(), [&columnName](auto &ti){ return ti.name == columnName; }); if(dbColumnInfoIt != dbTableInfo.end()){ auto &dbColumnInfo = *dbColumnInfoIt; auto dbColumnInfoType = to_sqlite_type(dbColumnInfo.type); auto storageColumnInfoType = to_sqlite_type(storageColumnInfo.type); if(dbColumnInfoType && storageColumnInfoType) { auto columnsAreEqual = dbColumnInfo.name == storageColumnInfo.name && *dbColumnInfoType == *storageColumnInfoType && dbColumnInfo.notnull == storageColumnInfo.notnull && bool(dbColumnInfo.dflt_value.length()) == bool(storageColumnInfo.dflt_value.length()) && dbColumnInfo.pk == storageColumnInfo.pk; if(!columnsAreEqual){ notEqual = true; break; } dbTableInfo.erase(dbColumnInfoIt); storageTableInfo.erase(storageTableInfo.begin() + storageColumnInfoIndex); --storageColumnInfoIndex; }else{ // undefined type/types notEqual = true; break; } }else{ columnsToAdd.push_back(&storageColumnInfo); } } return notEqual; } private: using super = storage_impl<Ts...>; using self = storage_impl<H, Ts...>; }; } } #pragma once #include <memory> // std::shared_ptr, std::make_shared #include <string> // std::string #include <sqlite3.h> #include <type_traits> // std::remove_reference, std::is_base_of, std::decay #include <cstddef> // std::ptrdiff_t #include <iterator> // std::input_iterator_tag, std::iterator_traits, std::distance #include <system_error> // std::system_error #include <functional> // std::function #include <sstream> // std::stringstream #include <map> // std::map #include <vector> // std::vector #include <tuple> // std::tuple_size, std::tuple #include <utility> // std::forward #include <set> // std::set #include <algorithm> // std::find // #include "alias.h" // #include "database_connection.h" // #include "row_extractor.h" // #include "statement_finalizer.h" // #include "error_code.h" // #include "type_printer.h" // #include "tuple_helper.h" // #include "constraints.h" // #include "table_type.h" // #include "type_is_nullable.h" // #include "field_printer.h" // #include "rowid.h" // #include "aggregate_functions.h" // #include "operators.h" // #include "select_constraints.h" // #include "core_functions.h" // #include "conditions.h" // #include "statement_binder.h" // #include "column_result.h" // #include "mapped_type_proxy.h" // #include "sync_schema_result.h" // #include "table_info.h" // #include "storage_impl.h" // #include "transaction_guard.h" namespace sqlite_orm { namespace internal { /** * Class used as a guard for a transaction. Calls `ROLLBACK` in destructor. * Has explicit `commit()` and `rollback()` functions. After explicit function is fired * guard won't do anything in d-tor. Also you can set `commit_on_destroy` to true to * make it call `COMMIT` on destroy. * S - storage type */ template<class S> struct transaction_guard_t { using storage_type = S; /** * This is a public lever to tell a guard what it must do in its destructor * if `gotta_fire` is true */ bool commit_on_destroy = false; transaction_guard_t(storage_type &s): storage(s) {} ~transaction_guard_t() { if(this->gotta_fire){ if(!this->commit_on_destroy){ this->storage.rollback(); }else{ this->storage.commit(); } } } /** * Call `COMMIT` explicitly. After this call * guard will not call `COMMIT` or `ROLLBACK` * in its destructor. */ void commit() { this->storage.commit(); this->gotta_fire = false; } /** * Call `ROLLBACK` explicitly. After this call * guard will not call `COMMIT` or `ROLLBACK` * in its destructor. */ void rollback() { this->storage.rollback(); this->gotta_fire = false; } protected: storage_type &storage; bool gotta_fire = true; }; } } namespace sqlite_orm { namespace internal { /** * Storage class itself. Create an instanse to use it as an interfacto to sqlite db by calling `make_storage` function. */ template<class ...Ts> struct storage_t { using storage_type = storage_t<Ts...>; using impl_type = storage_impl<Ts...>; template<class T, class ...Args> struct view_t { using mapped_type = T; storage_t &storage; std::shared_ptr<internal::database_connection> connection; const std::string query; view_t(storage_t &stor, decltype(connection) conn, Args&& ...args): storage(stor), connection(conn), query([&args..., &stor]{ std::string q; stor.template generate_select_asterisk<T>(&q, args...); return q; }()){} struct iterator_t { protected: std::shared_ptr<sqlite3_stmt *> stmt; view_t<T, Args...> &view; std::shared_ptr<T> temp; void extract_value(decltype(temp) &temp) { temp = std::make_shared<T>(); auto &storage = this->view.storage; auto &impl = storage.template get_impl<T>(); auto index = 0; impl.table.for_each_column([&index, &temp, this] (auto &c) { using field_type = typename std::remove_reference<decltype(c)>::type::field_type; auto value = row_extractor<field_type>().extract(*this->stmt, index++); if(c.member_pointer){ auto member_pointer = c.member_pointer; (*temp).*member_pointer = value; }else{ ((*temp).*(c.setter))(std::move(value)); } }); } public: using value_type = T; using difference_type = std::ptrdiff_t; using pointer = value_type *; using reference = value_type &; using iterator_category = std::input_iterator_tag; iterator_t(sqlite3_stmt * stmt_, view_t<T, Args...> &view_): stmt(std::make_shared<sqlite3_stmt *>(stmt_)), view(view_) { this->operator++(); } ~iterator_t() { if(this->stmt){ statement_finalizer f{*this->stmt}; } } T& operator*() { if(!this->stmt) { throw std::system_error(std::make_error_code(orm_error_code::trying_to_dereference_null_iterator)); } if(!this->temp){ this->extract_value(this->temp); } return *this->temp; } T* operator->() { if(!this->stmt) { throw std::system_error(std::make_error_code(orm_error_code::trying_to_dereference_null_iterator)); } if(!this->temp){ this->extract_value(this->temp); } return &*this->temp; } void operator++() { if(this->stmt && *this->stmt){ auto ret = sqlite3_step(*this->stmt); switch(ret){ case SQLITE_ROW: this->temp = nullptr; break; case SQLITE_DONE:{ statement_finalizer f{*this->stmt}; *this->stmt = nullptr; }break; default:{ throw std::system_error(std::error_code(sqlite3_errcode(this->view.connection->get_db()), get_sqlite_error_category())); } } } } void operator++(int) { this->operator++(); } bool operator==(const iterator_t &other) const { if(this->stmt && other.stmt){ return *this->stmt == *other.stmt; }else{ if(!this->stmt && !other.stmt){ return true; }else{ return false; } } } bool operator!=(const iterator_t &other) const { return !(*this == other); } }; size_t size() { return this->storage.template count<T>(); } bool empty() { return !this->size(); } iterator_t end() { return {nullptr, *this}; } iterator_t begin() { sqlite3_stmt *stmt = nullptr; auto db = this->connection->get_db(); auto ret = sqlite3_prepare_v2(db, this->query.c_str(), -1, &stmt, nullptr); if(ret == SQLITE_OK){ return {stmt, *this}; }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } }; std::function<void(sqlite3*)> on_open; transaction_guard_t<storage_type> transaction_guard() { this->begin_transaction(); return {*this}; } struct pragma_t { pragma_t(storage_type &storage_): storage(storage_) {} int synchronous() { return this->get_pragma<int>("synchronous"); } void synchronous(int value) { this->_synchronous = -1; this->set_pragma("synchronous", value); this->_synchronous = value; } int user_version() { return this->get_pragma<int>("user_version"); } void user_version(int value) { this->set_pragma("user_version", value); } int auto_vacuum() { return this->get_pragma<int>("auto_vacuum"); } void auto_vacuum(int value) { this->set_pragma("auto_vacuum", value); } friend struct storage_t<Ts...>; protected: storage_type &storage; int _synchronous = -1; template<class T> T get_pragma(const std::string &name) { auto connection = this->storage.get_or_create_connection(); std::string query = "PRAGMA " + name; int res = -1; auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv, char **) -> int { auto &res = *(T*)data; if(argc){ res = row_extractor<T>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } return res; } template<class T> void set_pragma(const std::string &name, const T &value) { auto connection = this->storage.get_or_create_connection(); std::stringstream ss; ss << "PRAGMA " << name << " = " << this->storage.string_from_expression(value); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), nullptr, nullptr, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } }; struct limit_accesor { int length() { return this->get(SQLITE_LIMIT_LENGTH); } void length(int newValue) { this->set(SQLITE_LIMIT_LENGTH, newValue); } int sql_length() { return this->get(SQLITE_LIMIT_SQL_LENGTH); } void sql_length(int newValue) { this->set(SQLITE_LIMIT_SQL_LENGTH, newValue); } int column() { return this->get(SQLITE_LIMIT_COLUMN); } void column(int newValue) { this->set(SQLITE_LIMIT_COLUMN, newValue); } int expr_depth() { return this->get(SQLITE_LIMIT_EXPR_DEPTH); } void expr_depth(int newValue) { this->set(SQLITE_LIMIT_EXPR_DEPTH, newValue); } int compound_select() { return this->get(SQLITE_LIMIT_COMPOUND_SELECT); } void compound_select(int newValue) { this->set(SQLITE_LIMIT_COMPOUND_SELECT, newValue); } int vdbe_op() { return this->get(SQLITE_LIMIT_VDBE_OP); } void vdbe_op(int newValue) { this->set(SQLITE_LIMIT_VDBE_OP, newValue); } int function_arg() { return this->get(SQLITE_LIMIT_FUNCTION_ARG); } void function_arg(int newValue) { this->set(SQLITE_LIMIT_FUNCTION_ARG, newValue); } int attached() { return this->get(SQLITE_LIMIT_ATTACHED); } void attached(int newValue) { this->set(SQLITE_LIMIT_ATTACHED, newValue); } int like_pattern_length() { return this->get(SQLITE_LIMIT_LIKE_PATTERN_LENGTH); } void like_pattern_length(int newValue) { this->set(SQLITE_LIMIT_LIKE_PATTERN_LENGTH, newValue); } int variable_number() { return this->get(SQLITE_LIMIT_VARIABLE_NUMBER); } void variable_number(int newValue) { this->set(SQLITE_LIMIT_VARIABLE_NUMBER, newValue); } int trigger_depth() { return this->get(SQLITE_LIMIT_TRIGGER_DEPTH); } void trigger_depth(int newValue) { this->set(SQLITE_LIMIT_TRIGGER_DEPTH, newValue); } int worker_threads() { return this->get(SQLITE_LIMIT_WORKER_THREADS); } void worker_threads(int newValue) { this->set(SQLITE_LIMIT_WORKER_THREADS, newValue); } protected: storage_type &storage; /** * Stores limit set between connections. */ std::map<int, int> limits; friend struct storage_t<Ts...>; limit_accesor(decltype(storage) storage_): storage(storage_) {} int get(int id) { auto connection = this->storage.get_or_create_connection(); return sqlite3_limit(connection->get_db(), id, -1); } void set(int id, int newValue) { this->limits[id] = newValue; auto connection = this->storage.get_or_create_connection(); sqlite3_limit(connection->get_db(), id, newValue); } }; /** * @param filename_ database filename. */ storage_t(const std::string &filename_, impl_type impl_): filename(filename_), impl(impl_), inMemory(filename_.empty() || filename_ == ":memory:"), pragma(*this), limit(*this){ if(inMemory){ this->currentTransaction = std::make_shared<internal::database_connection>(this->filename); this->on_open_internal(this->currentTransaction->get_db()); } } storage_t(const storage_t &other): filename(other.filename), impl(other.impl), inMemory(other.inMemory), pragma(*this), limit(*this), collatingFunctions(other.collatingFunctions), currentTransaction(other.currentTransaction) {} protected: using collating_function = std::function<int(int, const void*, int, const void*)>; std::string filename; impl_type impl; std::shared_ptr<internal::database_connection> currentTransaction; const bool inMemory; bool isOpenedForever = false; std::map<std::string, collating_function> collatingFunctions; using collating_function_pair = typename decltype(collatingFunctions)::value_type; /** * Check whether connection exists and returns it if yes or creates a new one * and returns it. */ std::shared_ptr<internal::database_connection> get_or_create_connection() { decltype(this->currentTransaction) connection; if(!this->currentTransaction){ connection = std::make_shared<internal::database_connection>(this->filename); this->on_open_internal(connection->get_db()); }else{ connection = this->currentTransaction; } return connection; } template<class O, class T, class G, class S, class ...Op> std::string serialize_column_schema(internal::column_t<O, T, G, S, Op...> c) { std::stringstream ss; ss << "'" << c.name << "' "; using field_type = typename decltype(c)::field_type; using constraints_type = typename decltype(c)::constraints_type; ss << type_printer<field_type>().print() << " "; tuple_helper::iterator<std::tuple_size<constraints_type>::value - 1, Op...>()(c.constraints, [&ss](auto &v){ ss << static_cast<std::string>(v) << ' '; }); if(c.not_null()){ ss << "NOT NULL "; } return ss.str(); } template<class ...Cs> std::string serialize_column_schema(constraints::primary_key_t<Cs...> fk) { std::stringstream ss; ss << static_cast<std::string>(fk) << " ("; std::vector<std::string> columnNames; columnNames.reserve(std::tuple_size<decltype(fk.columns)>::value); tuple_helper::iterator<std::tuple_size<decltype(fk.columns)>::value - 1, Cs...>()(fk.columns, [&columnNames, this](auto &c){ columnNames.push_back(this->impl.column_name(c)); }); for(size_t i = 0; i < columnNames.size(); ++i) { ss << columnNames[i]; if(i < columnNames.size() - 1) { ss << ", "; } } ss << ") "; return ss.str(); } #if SQLITE_VERSION_NUMBER >= 3006019 template<class C, class R> std::string serialize_column_schema(constraints::foreign_key_t<C, R> &fk) { std::stringstream ss; using ref_type = typename internal::table_type<decltype(fk.r)>::type; auto refTableName = this->impl.template find_table_name<ref_type>(); auto refColumnName = this->impl.column_name(fk.r); ss << "FOREIGN KEY(" << this->impl.column_name(fk.m) << ") REFERENCES "; ss << refTableName << "(" << refColumnName << ") "; return ss.str(); } #endif template<class I> void create_table(sqlite3 *db, const std::string &tableName, I *impl) { std::stringstream ss; ss << "CREATE TABLE '" << tableName << "' ( "; auto columnsCount = impl->table.columns_count(); auto index = 0; impl->table.for_each_column_with_constraints([columnsCount, &index, &ss, this] (auto c) { ss << this->serialize_column_schema(c); if(index < columnsCount - 1) { ss << ", "; } index++; }); ss << ") "; if(impl->table._without_rowid) { ss << "WITHOUT ROWID "; } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } template<class I> void backup_table(sqlite3 *db, I *impl) { // here we copy source table to another with a name with '_backup' suffix, but in case table with such // a name already exists we append suffix 1, then 2, etc until we find a free name.. auto backupTableName = impl->table.name + "_backup"; if(impl->table_exists(backupTableName, db)){ int suffix = 1; do{ std::stringstream stream; stream << suffix; auto anotherBackupTableName = backupTableName + stream.str(); if(!impl->table_exists(anotherBackupTableName, db)){ backupTableName = anotherBackupTableName; break; } ++suffix; }while(true); } this->create_table(db, backupTableName, impl); impl->copy_table(db, backupTableName); this->drop_table_internal(impl->table.name, db); impl->rename_table(db, backupTableName, impl->table.name); } template<class O> void assert_mapped_type() { using mapped_types_tuples = std::tuple<typename Ts::object_type...>; static_assert(tuple_helper::has_type<O, mapped_types_tuples>::value, "type is not mapped to a storage"); } template<class O> auto& get_impl() { return this->impl.template get_impl<O>(); } std::string escape(std::string text) { for(size_t i = 0; i < text.length(); ) { if(text[i] == '\''){ text.insert(text.begin() + i, '\''); i += 2; } else ++i; } return text; } template<class T> std::string string_from_expression(T t, bool /*noTableName*/ = false, bool escape = false) { auto isNullable = type_is_nullable<T>::value; if(isNullable && !type_is_nullable<T>()(t)){ return "NULL"; }else{ auto needQuotes = std::is_base_of<text_printer, type_printer<T>>::value; std::stringstream ss; if(needQuotes){ ss << "'"; } std::string text = field_printer<T>()(t); if(escape){ text = this->escape(text); } ss << text; if(needQuotes){ ss << "'"; } return ss.str(); } } template<class T, class C> std::string string_from_expression(const alias_column_t<T, C> &als, bool noTableName = false, bool /*escape*/ = false) { std::stringstream ss; if(!noTableName){ ss << "'" << T::get() << "'."; } ss << this->string_from_expression(als.column, true); return ss.str(); } std::string string_from_expression(const std::string &t, bool /*noTableName*/ = false, bool escape = false) { std::stringstream ss; std::string text = t; if(escape){ text = this->escape(text); } ss << "'" << text << "'"; return ss.str(); } std::string string_from_expression(const char *t, bool /*noTableName*/ = false, bool escape = false) { std::stringstream ss; std::string text = t; if(escape){ text = this->escape(text); } ss << "'" << text << "'"; return ss.str(); } template<class F, class O> std::string string_from_expression(F O::*m, bool noTableName = false, bool /*escape*/ = false) { std::stringstream ss; if(!noTableName){ ss << "'" << this->impl.template find_table_name<O>() << "'."; } ss << "\"" << this->impl.column_name(m) << "\""; return ss.str(); } std::string string_from_expression(const rowid_t &rid, bool /*noTableName*/ = false, bool /*escape*/ = false) { return static_cast<std::string>(rid); } std::string string_from_expression(const oid_t &rid, bool /*noTableName*/ = false, bool /*escape*/ = false) { return static_cast<std::string>(rid); } std::string string_from_expression(const _rowid_t &rid, bool /*noTableName*/ = false, bool /*escape*/ = false) { return static_cast<std::string>(rid); } template<class O> std::string string_from_expression(const table_rowid_t<O> &rid, bool noTableName = false, bool /*escape*/ = false) { std::stringstream ss; if(!noTableName){ ss << "'" << this->impl.template find_table_name<O>() << "'."; } ss << static_cast<std::string>(rid); return ss.str(); } template<class O> std::string string_from_expression(const table_oid_t<O> &rid, bool noTableName = false, bool /*escape*/ = false) { std::stringstream ss; if(!noTableName){ ss << "'" << this->impl.template find_table_name<O>() << "'."; } ss << static_cast<std::string>(rid); return ss.str(); } template<class O> std::string string_from_expression(const table__rowid_t<O> &rid, bool noTableName = false, bool /*escape*/ = false) { std::stringstream ss; if(!noTableName){ ss << "'" << this->impl.template find_table_name<O>() << "'."; } ss << static_cast<std::string>(rid); return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::group_concat_double_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); auto expr2 = this->string_from_expression(f.y); ss << static_cast<std::string>(f) << "(" << expr << ", " << expr2 << ") "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::group_concat_single_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class L, class R> std::string string_from_expression(const conc_t<L, R> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto lhs = this->string_from_expression(f.l); auto rhs = this->string_from_expression(f.r); ss << "(" << lhs << " || " << rhs << ") "; return ss.str(); } template<class L, class R> std::string string_from_expression(const add_t<L, R> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto lhs = this->string_from_expression(f.l); auto rhs = this->string_from_expression(f.r); ss << "(" << lhs << " + " << rhs << ") "; return ss.str(); } template<class L, class R> std::string string_from_expression(const sub_t<L, R> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto lhs = this->string_from_expression(f.l); auto rhs = this->string_from_expression(f.r); ss << "(" << lhs << " - " << rhs << ") "; return ss.str(); } template<class L, class R> std::string string_from_expression(const mul_t<L, R> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto lhs = this->string_from_expression(f.l); auto rhs = this->string_from_expression(f.r); ss << "(" << lhs << " * " << rhs << ") "; return ss.str(); } template<class L, class R> std::string string_from_expression(const div_t<L, R> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto lhs = this->string_from_expression(f.l); auto rhs = this->string_from_expression(f.r); ss << "(" << lhs << " / " << rhs << ") "; return ss.str(); } template<class L, class R> std::string string_from_expression(const mod_t<L, R> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto lhs = this->string_from_expression(f.l); auto rhs = this->string_from_expression(f.r); ss << "(" << lhs << " % " << rhs << ") "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::min_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::max_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::total_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::sum_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } std::string string_from_expression(const aggregate_functions::count_asterisk_t &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; ss << static_cast<std::string>(f) << "(*) "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::count_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const aggregate_functions::avg_t<T> &a, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(a.t); ss << static_cast<std::string>(a) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const distinct_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const all_t<T> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.t); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class X, class Y> std::string string_from_expression(const core_functions::rtrim_double_t<X, Y> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.x); auto expr2 = this->string_from_expression(f.y); ss << static_cast<std::string>(f) << "(" << expr << ", " << expr2 << ") "; return ss.str(); } template<class X> std::string string_from_expression(const core_functions::rtrim_single_t<X> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.x); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class X, class Y> std::string string_from_expression(const core_functions::ltrim_double_t<X, Y> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.x); auto expr2 = this->string_from_expression(f.y); ss << static_cast<std::string>(f) << "(" << expr << ", " << expr2 << ") "; return ss.str(); } template<class X> std::string string_from_expression(const core_functions::ltrim_single_t<X> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.x); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } template<class X, class Y> std::string string_from_expression(const core_functions::trim_double_t<X, Y> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.x); auto expr2 = this->string_from_expression(f.y); ss << static_cast<std::string>(f) << "(" << expr << ", " << expr2 << ") "; return ss.str(); } template<class X> std::string string_from_expression(const core_functions::trim_single_t<X> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(f.x); ss << static_cast<std::string>(f) << "(" << expr << ") "; return ss.str(); } std::string string_from_expression(const core_functions::changes_t &ch, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; ss << static_cast<std::string>(ch) << "() "; return ss.str(); } template<class T> std::string string_from_expression(const core_functions::length_t<T> &len, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(len.t); ss << static_cast<std::string>(len) << "(" << expr << ") "; return ss.str(); } template<class T, class ...Args> std::string string_from_expression(const core_functions::datetime_t<T, Args...> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; ss << static_cast<std::string>(f) << "(" << this->string_from_expression(f.timestring); using tuple_t = std::tuple<Args...>; tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(f.modifiers, [&ss, this](auto &v){ ss << ", " << this->string_from_expression(v); }); ss << ") "; return ss.str(); } template<class T, class ...Args> std::string string_from_expression(const core_functions::date_t<T, Args...> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; ss << static_cast<std::string>(f) << "(" << this->string_from_expression(f.timestring); using tuple_t = std::tuple<Args...>; tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(f.modifiers, [&ss, this](auto &v){ ss << ", " << this->string_from_expression(v); }); ss << ") "; return ss.str(); } std::string string_from_expression(const core_functions::random_t &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; ss << static_cast<std::string>(f) << "() "; return ss.str(); } #if SQLITE_VERSION_NUMBER >= 3007016 template<class ...Args> std::string string_from_expression(const core_functions::char_t_<Args...> &f, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; using tuple_t = decltype(f.args); std::vector<std::string> args; args.reserve(std::tuple_size<tuple_t>::value); tuple_helper::tuple_for_each(f.args, [&args, this](auto &v){ auto expression = this->string_from_expression(v); args.emplace_back(std::move(expression)); }); ss << static_cast<std::string>(f) << "("; auto lim = int(args.size()); for(auto i = 0; i < lim; ++i) { ss << args[i]; if(i < lim - 1) { ss << ", "; }else{ ss << " "; } } ss << ") "; return ss.str(); } #endif template<class T> std::string string_from_expression(const core_functions::upper_t<T> &a, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(a.t); ss << static_cast<std::string>(a) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const core_functions::lower_t<T> &a, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(a.t); ss << static_cast<std::string>(a) << "(" << expr << ") "; return ss.str(); } template<class T> std::string string_from_expression(const core_functions::abs_t<T> &a, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; auto expr = this->string_from_expression(a.t); ss << static_cast<std::string>(a) << "(" << expr << ") "; return ss.str(); } template<class T, class F> std::string string_from_expression(const column_pointer<T, F> &c, bool noTableName = false, bool escape = false) { std::stringstream ss; if(!noTableName){ ss << "'" << this->impl.template find_table_name<T>() << "'."; } auto &impl = this->get_impl<T>(); ss << "\"" << impl.column_name_simple(c.field) << "\""; return ss.str(); } template<class T> std::vector<std::string> get_column_names(const T &t) { auto columnName = this->string_from_expression(t); if(columnName.length()){ return {columnName}; }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } } template<class ...Args> std::vector<std::string> get_column_names(const internal::columns_t<Args...> &cols) { std::vector<std::string> columnNames; columnNames.reserve(cols.count()); cols.for_each([&columnNames, this](auto &m) { auto columnName = this->string_from_expression(m); if(columnName.length()){ columnNames.push_back(columnName); }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } }); return columnNames; } /** * Takes select_t object and returns SELECT query string */ template<class T, class ...Args> std::string string_from_expression(const internal::select_t<T, Args...> &sel, bool /*noTableName*/ = false, bool /*escape*/ = false) { std::stringstream ss; ss << "SELECT "; if(get_distinct(sel.col)) { ss << static_cast<std::string>(distinct(0)) << " "; } auto columnNames = this->get_column_names(sel.col); for(size_t i = 0; i < columnNames.size(); ++i) { ss << columnNames[i]; if(i < columnNames.size() - 1) { ss << ","; } ss << " "; } auto tableNamesSet = this->parse_table_names(sel.col); internal::join_iterator<Args...>()([&tableNamesSet, this](auto c){ using original_join_type = typename decltype(c)::type; using cross_join_type = typename internal::mapped_type_proxy<original_join_type>::type; auto crossJoinedTableName = this->impl.template find_table_name<cross_join_type>(); auto tableAliasString = alias_exractor<original_join_type>::get(); if(!tableAliasString.length()){ tableNamesSet.erase(crossJoinedTableName); } }); if(tableNamesSet.size()){ ss << "FROM "; std::vector<std::string> tableNames(tableNamesSet.begin(), tableNamesSet.end()); for(size_t i = 0; i < tableNames.size(); ++i) { ss << " '" << tableNames[i] << "' "; if(int(i) < int(tableNames.size()) - 1) { ss << ","; } ss << " "; } } using tuple_t = typename std::decay<decltype(sel)>::type::conditions_type; tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(sel.conditions, [&ss, this](auto &v){ this->process_single_condition(ss, v); }, false); return ss.str(); } template<class T> std::string process_where(const conditions::is_null_t<T> &c) { std::stringstream ss; ss << this->string_from_expression(c.t) << " " << static_cast<std::string>(c) << " "; return ss.str(); } template<class T> std::string process_where(const conditions::is_not_null_t<T> &c) { std::stringstream ss; ss << this->string_from_expression(c.t) << " " << static_cast<std::string>(c) << " "; return ss.str(); } template<class C> std::string process_where(const conditions::negated_condition_t<C> &c) { std::stringstream ss; ss << " " << static_cast<std::string>(c) << " "; auto cString = this->process_where(c.c); ss << " (" << cString << " ) "; return ss.str(); } template<class L, class R> std::string process_where(const conditions::and_condition_t<L, R> &c) { std::stringstream ss; ss << " (" << this->process_where(c.l) << ") " << static_cast<std::string>(c) << " (" << this->process_where(c.r) << ") "; return ss.str(); } template<class L, class R> std::string process_where(const conditions::or_condition_t<L, R> &c) { std::stringstream ss; ss << " (" << this->process_where(c.l) << ") " << static_cast<std::string>(c) << " (" << this->process_where(c.r) << ") "; return ss.str(); } /** * Common case. Is used to process binary conditions like is_equal, not_equal */ template<class C> std::string process_where(const C &c) { auto leftString = this->string_from_expression(c.l, false, true); auto rightString = this->string_from_expression(c.r, false, true); std::stringstream ss; ss << leftString << " " << static_cast<std::string>(c) << " " << rightString; return ss.str(); } template<class T> std::string process_where(const conditions::named_collate<T> &col) { auto res = this->process_where(col.expr); return res + " " + static_cast<std::string>(col); } template<class T> std::string process_where(const conditions::collate_t<T> &col) { auto res = this->process_where(col.expr); return res + " " + static_cast<std::string>(col); } template<class L, class E> std::string process_where(const conditions::in_t<L, E> &inCondition) { std::stringstream ss; auto leftString = this->string_from_expression(inCondition.l); ss << leftString << " " << static_cast<std::string>(inCondition) << " ("; for(size_t index = 0; index < inCondition.values.size(); ++index) { auto &value = inCondition.values[index]; ss << " " << this->string_from_expression(value); if(index < inCondition.values.size() - 1) { ss << ", "; } } ss << " )"; return ss.str(); } template<class A, class T> std::string process_where(const conditions::like_t<A, T> &l) { std::stringstream ss; ss << this->string_from_expression(l.a) << " " << static_cast<std::string>(l) << " " << this->string_from_expression(l.t) << " "; return ss.str(); } template<class A, class T> std::string process_where(const conditions::between_t<A, T> &bw) { std::stringstream ss; auto expr = this->string_from_expression(bw.expr); ss << expr << " " << static_cast<std::string>(bw) << " " << this->string_from_expression(bw.b1) << " AND " << this->string_from_expression(bw.b2) << " "; return ss.str(); } template<class O> std::string process_order_by(const conditions::order_by_t<O> &orderBy) { std::stringstream ss; auto columnName = this->string_from_expression(orderBy.o); ss << columnName << " "; if(orderBy._collate_argument.length()){ ss << "COLLATE " << orderBy._collate_argument << " "; } switch(orderBy.asc_desc){ case 1: ss << "ASC "; break; case -1: ss << "DESC "; break; } return ss.str(); } template<class T> void process_join_constraint(std::stringstream &ss, const conditions::on_t<T> &t) { ss << static_cast<std::string>(t) << " " << this->process_where(t.t) << " "; } template<class F, class O> void process_join_constraint(std::stringstream &ss, const conditions::using_t<F, O> &u) { ss << static_cast<std::string>(u) << " (" << this->string_from_expression(u.column, true) << " ) "; } void process_single_condition(std::stringstream &ss, const conditions::limit_t &limt) { ss << static_cast<std::string>(limt) << " "; if(limt.has_offset) { if(limt.offset_is_implicit){ ss << limt.off << ", " << limt.lim; }else{ ss << limt.lim << " OFFSET " << limt.off; } }else{ ss << limt.lim; } ss << " "; } template<class O> void process_single_condition(std::stringstream &ss, const conditions::cross_join_t<O> &c) { ss << static_cast<std::string>(c) << " "; ss << " '" << this->impl.template find_table_name<O>() << "' "; } template<class O> void process_single_condition(std::stringstream &ss, const conditions::natural_join_t<O> &c) { ss << static_cast<std::string>(c) << " "; ss << " '" << this->impl.template find_table_name<O>() << "' "; } template<class T, class O> void process_single_condition(std::stringstream &ss, const conditions::inner_join_t<T, O> &l) { ss << static_cast<std::string>(l) << " "; auto aliasString = alias_exractor<T>::get(); ss << " '" << this->impl.template find_table_name<typename mapped_type_proxy<T>::type>() << "' "; if(aliasString.length()){ ss << "'" << aliasString << "' "; } this->process_join_constraint(ss, l.constraint); } template<class T, class O> void process_single_condition(std::stringstream &ss, const conditions::left_outer_join_t<T, O> &l) { ss << static_cast<std::string>(l) << " "; ss << " '" << this->impl.template find_table_name<T>() << "' "; this->process_join_constraint(ss, l.constraint); } template<class T, class O> void process_single_condition(std::stringstream &ss, const conditions::left_join_t<T, O> &l) { ss << static_cast<std::string>(l) << " "; ss << " '" << this->impl.template find_table_name<T>() << "' "; this->process_join_constraint(ss, l.constraint); } template<class T, class O> void process_single_condition(std::stringstream &ss, const conditions::join_t<T, O> &l) { ss << static_cast<std::string>(l) << " "; ss << " '" << this->impl.template find_table_name<T>() << "' "; this->process_join_constraint(ss, l.constraint); } template<class C> void process_single_condition(std::stringstream &ss, const conditions::where_t<C> &w) { ss << static_cast<std::string>(w) << " "; auto whereString = this->process_where(w.c); ss << "( " << whereString << ") "; } template<class O> void process_single_condition(std::stringstream &ss, const conditions::order_by_t<O> &orderBy) { ss << static_cast<std::string>(orderBy) << " "; auto orderByString = this->process_order_by(orderBy); ss << orderByString << " "; } template<class ...Args> void process_single_condition(std::stringstream &ss, const conditions::multi_order_by_t<Args...> &orderBy) { std::vector<std::string> expressions; using tuple_t = std::tuple<Args...>; tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(orderBy.args, [&expressions, this](auto &v){ auto expression = this->process_order_by(v); expressions.insert(expressions.begin(), expression); }); ss << static_cast<std::string>(orderBy) << " "; for(size_t i = 0; i < expressions.size(); ++i) { ss << expressions[i]; if(i < expressions.size() - 1) { ss << ", "; } } ss << " "; } template<class ...Args> void process_single_condition(std::stringstream &ss, const conditions::group_by_t<Args...> &groupBy) { std::vector<std::string> expressions; using tuple_t = std::tuple<Args...>; tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(groupBy.args, [&expressions, this](auto &v){ auto expression = this->string_from_expression(v); expressions.push_back(expression); }); ss << static_cast<std::string>(groupBy) << " "; for(size_t i = 0; i < expressions.size(); ++i) { ss << expressions[i]; if(i < expressions.size() - 1) { ss << ", "; } } ss << " "; } /** * Recursion end. */ template<class ...Args> void process_conditions(std::stringstream &, Args .../*args*/) { //.. } template<class C, class ...Args> void process_conditions(std::stringstream &ss, C c, Args&& ...args) { this->process_single_condition(ss, c); this->process_conditions(ss, std::forward<Args>(args)...); } void on_open_internal(sqlite3 *db) { #if SQLITE_VERSION_NUMBER >= 3006019 if(this->foreign_keys_count()){ this->foreign_keys(db, true); } #endif if(this->pragma._synchronous != -1) { this->pragma.synchronous(this->pragma._synchronous); } for(auto &p : this->collatingFunctions){ if(sqlite3_create_collation(db, p.first.c_str(), SQLITE_UTF8, &p.second, collate_callback) != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } for(auto &p : this->limit.limits) { sqlite3_limit(db, p.first, p.second); } if(this->on_open){ this->on_open(db); } } #if SQLITE_VERSION_NUMBER >= 3006019 // returns foreign keys count in storage definition int foreign_keys_count() { auto res = 0; this->impl.for_each([&res](auto impl){ res += impl->foreign_keys_count(); }); return res; } #endif static int collate_callback(void *arg, int leftLen, const void *lhs, int rightLen, const void *rhs) { auto &f = *(collating_function*)arg; return f(leftLen, lhs, rightLen, rhs); } public: template<class T, class ...Args> view_t<T, Args...> iterate(Args&& ...args) { this->assert_mapped_type<T>(); auto connection = this->get_or_create_connection(); return {*this, connection, std::forward<Args>(args)...}; } void create_collation(const std::string &name, collating_function f) { collating_function *functionPointer = nullptr; if(f){ functionPointer = &(collatingFunctions[name] = f); }else{ collatingFunctions.erase(name); } // create collations if db is open if(this->currentTransaction){ auto db = this->currentTransaction->get_db(); if(sqlite3_create_collation(db, name.c_str(), SQLITE_UTF8, functionPointer, f ? collate_callback : nullptr) != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } } template<class O, class ...Args> void remove_all(Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::stringstream ss; ss << "DELETE FROM '" << impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } /** * Delete routine. * O is an object's type. Must be specified explicitly. * @param id id of object to be removed. */ template<class O, class I> void remove(I id) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::stringstream ss; ss << "DELETE FROM '" << impl.table.name << "' "; ss << "WHERE "; auto primaryKeyColumnNames = impl.table.primary_key_column_names(); for(size_t i = 0; i < primaryKeyColumnNames.size(); ++i) { ss << "\"" << primaryKeyColumnNames[i] << "\"" << " = ?"; if(i < primaryKeyColumnNames.size() - 1) { ss << " AND "; }else{ ss << " "; } } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; statement_binder<I>().bind(stmt, index++, id); if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } /** * Update routine. Sets all non primary key fields where primary key is equal. * O is an object type. May be not specified explicitly cause it can be deduced by * compiler from first parameter. * @param o object to be updated. */ template<class O> void update(const O &o) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::stringstream ss; ss << "UPDATE '" << impl.table.name << "' SET "; std::vector<std::string> setColumnNames; impl.table.for_each_column([&setColumnNames](auto c) { if(!c.template has<constraints::primary_key_t<>>()) { setColumnNames.emplace_back(c.name); } }); for(size_t i = 0; i < setColumnNames.size(); ++i) { ss << "\"" << setColumnNames[i] << "\"" << " = ?"; if(i < setColumnNames.size() - 1) { ss << ", "; }else{ ss << " "; } } ss << "WHERE "; auto primaryKeyColumnNames = impl.table.primary_key_column_names(); for(size_t i = 0; i < primaryKeyColumnNames.size(); ++i) { ss << "\"" << primaryKeyColumnNames[i] << "\"" << " = ?"; if(i < primaryKeyColumnNames.size() - 1) { ss << " AND "; }else{ ss << " "; } } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; impl.table.for_each_column([&o, stmt, &index] (auto c) { if(!c.template has<constraints::primary_key_t<>>()) { using field_type = typename decltype(c)::field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } statement_binder<field_type>().bind(stmt, index++, *value); } }); impl.table.for_each_column([&o, stmt, &index] (auto c) { if(c.template has<constraints::primary_key_t<>>()) { typedef typename decltype(c)::field_type field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } statement_binder<field_type>().bind(stmt, index++, *value); } }); if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } template<class ...Args, class ...Wargs> void update_all(internal::set_t<Args...> set, Wargs ...wh) { auto connection = this->get_or_create_connection(); std::stringstream ss; ss << "UPDATE "; std::set<std::string> tableNamesSet; set.for_each([this, &tableNamesSet](auto &asgn) { auto tableName = this->parse_table_name(asgn.l); tableNamesSet.insert(tableName.begin(), tableName.end()); }); if(tableNamesSet.size()){ if(tableNamesSet.size() == 1){ ss << " '" << *tableNamesSet.begin() << "' "; ss << static_cast<std::string>(set) << " "; std::vector<std::string> setPairs; set.for_each([this, &setPairs](auto &asgn){ std::stringstream sss; sss << this->string_from_expression(asgn.l, true) << " = " << this->string_from_expression(asgn.r) << " "; setPairs.push_back(sss.str()); }); auto setPairsCount = setPairs.size(); for(size_t i = 0; i < setPairsCount; ++i) { ss << setPairs[i] << " "; if(i < setPairsCount - 1) { ss << ", "; } } this->process_conditions(ss, wh...); auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::too_many_tables_specified)); } }else{ throw std::system_error(std::make_error_code(orm_error_code::incorrect_set_fields_specified)); } } protected: /** * O - mapped type * Args - conditions * @param query - result query string * @return impl for O */ template<class O, class ...Args> auto& generate_select_asterisk(std::string *query, Args&& ...args) { std::stringstream ss; ss << "SELECT "; auto &impl = this->get_impl<O>(); auto columnNames = impl.table.column_names(); for(size_t i = 0; i < columnNames.size(); ++i) { ss << "'" << impl.table.name << "'." << "\"" << columnNames[i] << "\"" ; if(i < columnNames.size() - 1) { ss << ", "; }else{ ss << " "; } } ss << "FROM '" << impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); if(query){ *query = ss.str(); } return impl; } template<class T> std::set<std::string> parse_table_name(const T &) { return {}; } template<class F, class O> std::set<std::string> parse_table_name(F O::*) { return {this->impl.template find_table_name<O>()}; } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::min_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::max_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::sum_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::total_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::group_concat_double_t<T> &f) { auto res = this->parse_table_name(f.t); auto secondSet = this->parse_table_name(f.y); res.insert(secondSet.begin(), secondSet.end()); return res; } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::group_concat_single_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::count_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const aggregate_functions::avg_t<T> &a) { return this->parse_table_name(a.t); } template<class T> std::set<std::string> parse_table_name(const core_functions::length_t<T> &len) { return this->parse_table_name(len.t); } template<class T, class ...Args> std::set<std::string> parse_table_name(const core_functions::date_t<T, Args...> &f) { auto res = this->parse_table_name(f.timestring); using tuple_t = decltype(f.modifiers); tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(f.modifiers, [&res, this](auto &v){ auto tableNames = this->parse_table_name(v); res.insert(tableNames.begin(), tableNames.end()); }); return res; } template<class T, class ...Args> std::set<std::string> parse_table_name(const core_functions::datetime_t<T, Args...> &f) { auto res = this->parse_table_name(f.timestring); using tuple_t = decltype(f.modifiers); tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(f.modifiers, [&res, this](auto &v){ auto tableNames = this->parse_table_name(v); res.insert(tableNames.begin(), tableNames.end()); }); return res; } template<class X> std::set<std::string> parse_table_name(const core_functions::trim_single_t<X> &f) { return this->parse_table_name(f.x); } template<class X, class Y> std::set<std::string> parse_table_name(const core_functions::trim_double_t<X, Y> &f) { auto res = this->parse_table_name(f.x); auto res2 = this->parse_table_name(f.y); res.insert(res2.begin(), res2.end()); return res; } template<class X> std::set<std::string> parse_table_name(const core_functions::rtrim_single_t<X> &f) { return this->parse_table_name(f.x); } template<class X, class Y> std::set<std::string> parse_table_name(const core_functions::rtrim_double_t<X, Y> &f) { auto res = this->parse_table_name(f.x); auto res2 = this->parse_table_name(f.y); res.insert(res2.begin(), res2.end()); return res; } template<class X> std::set<std::string> parse_table_name(const core_functions::ltrim_single_t<X> &f) { return this->parse_table_name(f.x); } template<class X, class Y> std::set<std::string> parse_table_name(const core_functions::ltrim_double_t<X, Y> &f) { auto res = this->parse_table_name(f.x); auto res2 = this->parse_table_name(f.y); res.insert(res2.begin(), res2.end()); return res; } #if SQLITE_VERSION_NUMBER >= 3007016 template<class ...Args> std::set<std::string> parse_table_name(const core_functions::char_t_<Args...> &f) { std::set<std::string> res; using tuple_t = decltype(f.args); tuple_helper::iterator<std::tuple_size<tuple_t>::value - 1, Args...>()(f.args, [&res, this](auto &v){ auto tableNames = this->parse_table_name(v); res.insert(tableNames.begin(), tableNames.end()); }); return res; } #endif std::set<std::string> parse_table_name(const core_functions::random_t &) { return {}; } template<class T> std::set<std::string> parse_table_name(const core_functions::upper_t<T> &a) { return this->parse_table_name(a.t); } template<class T> std::set<std::string> parse_table_name(const core_functions::lower_t<T> &a) { return this->parse_table_name(a.t); } template<class T> std::set<std::string> parse_table_name(const core_functions::abs_t<T> &a) { return this->parse_table_name(a.t); } template<class T> std::set<std::string> parse_table_name(const distinct_t<T> &f) { return this->parse_table_name(f.t); } template<class T> std::set<std::string> parse_table_name(const all_t<T> &f) { return this->parse_table_name(f.t); } template<class L, class R, class ...Args> std::set<std::string> parse_table_name(const conc_t<L, R> &f) { std::set<std::string> res; auto leftSet = this->parse_table_names(f.l); res.insert(leftSet.begin(), leftSet.end()); auto rightSet = this->parse_table_names(f.r); res.insert(rightSet.begin(), rightSet.end()); return res; } template<class L, class R, class ...Args> std::set<std::string> parse_table_name(const add_t<L, R> &f) { std::set<std::string> res; auto leftSet = this->parse_table_names(f.l); res.insert(leftSet.begin(), leftSet.end()); auto rightSet = this->parse_table_names(f.r); res.insert(rightSet.begin(), rightSet.end()); return res; } template<class L, class R, class ...Args> std::set<std::string> parse_table_name(const sub_t<L, R> &f) { std::set<std::string> res; auto leftSet = this->parse_table_names(f.l); res.insert(leftSet.begin(), leftSet.end()); auto rightSet = this->parse_table_names(f.r); res.insert(rightSet.begin(), rightSet.end()); return res; } template<class L, class R, class ...Args> std::set<std::string> parse_table_name(const mul_t<L, R> &f) { std::set<std::string> res; auto leftSet = this->parse_table_names(f.l); res.insert(leftSet.begin(), leftSet.end()); auto rightSet = this->parse_table_names(f.r); res.insert(rightSet.begin(), rightSet.end()); return res; } template<class L, class R, class ...Args> std::set<std::string> parse_table_name(const div_t<L, R> &f) { std::set<std::string> res; auto leftSet = this->parse_table_names(f.l); res.insert(leftSet.begin(), leftSet.end()); auto rightSet = this->parse_table_names(f.r); res.insert(rightSet.begin(), rightSet.end()); return res; } template<class L, class R, class ...Args> std::set<std::string> parse_table_name(const mod_t<L, R> &f) { std::set<std::string> res; auto leftSet = this->parse_table_names(f.l); res.insert(leftSet.begin(), leftSet.end()); auto rightSet = this->parse_table_names(f.r); res.insert(rightSet.begin(), rightSet.end()); return res; } template<class T, class F> std::set<std::string> parse_table_name(const column_pointer<T, F> &c) { std::set<std::string> res; res.insert(this->impl.template find_table_name<T>()); return res; } template<class ...Args> std::set<std::string> parse_table_names(Args...) { return {}; } template<class H, class ...Args> std::set<std::string> parse_table_names(H h, Args&& ...args) { auto res = this->parse_table_names(std::forward<Args>(args)...); auto tableName = this->parse_table_name(h); res.insert(tableName.begin(), tableName.end()); return res; } template<class ...Args> std::set<std::string> parse_table_names(const internal::columns_t<Args...> &cols) { std::set<std::string> res; cols.for_each([&res, this](auto &m){ auto tableName = this->parse_table_name(m); res.insert(tableName.begin(), tableName.end()); }); return res; } template<class F, class O, class ...Args> std::string group_concat_internal(F O::*m, std::shared_ptr<const std::string> y, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::string res; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::group_concat(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName; if(y){ ss << ",\"" << *y << "\""; } ss << ") FROM '"<< impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv,char **) -> int { auto &res = *(std::string*)data; if(argc){ res = row_extractor<std::string>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } public: /** * Select * with no conditions routine. * O is an object type to be extracted. Must be specified explicitly. * @return All objects of type O stored in database at the moment. */ template<class O, class C = std::vector<O>, class ...Args> C get_all(Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); C res; std::string query; auto &impl = this->generate_select_asterisk<O>(&query, std::forward<Args>(args)...); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; int stepRes; do{ stepRes = sqlite3_step(stmt); switch(stepRes){ case SQLITE_ROW:{ O obj; auto index = 0; impl.table.for_each_column([&index, &obj, stmt] (auto c) { using field_type = typename decltype(c)::field_type; auto value = row_extractor<field_type>().extract(stmt, index++); if(c.member_pointer){ obj.*c.member_pointer = value; }else{ ((obj).*(c.setter))(std::move(value)); } }); res.push_back(std::move(obj)); }break; case SQLITE_DONE: break; default:{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } }while(stepRes != SQLITE_DONE); return res; }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } /** * Select * by id routine. * throws std::system_error(orm_error_code::not_found, orm_error_category) if object not found with given id. * throws std::system_error with orm_error_category in case of db error. * O is an object type to be extracted. Must be specified explicitly. * @return Object of type O where id is equal parameter passed or throws `std::system_error(orm_error_code::not_found, orm_error_category)` * if there is no object with such id. */ template<class O, class ...Ids> O get(Ids ...ids) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::shared_ptr<O> res; std::stringstream ss; ss << "SELECT "; auto columnNames = impl.table.column_names(); for(size_t i = 0; i < columnNames.size(); ++i) { ss << "\"" << columnNames[i] << "\""; if(i < columnNames.size() - 1) { ss << ", "; }else{ ss << " "; } } ss << "FROM '" << impl.table.name << "' WHERE "; auto primaryKeyColumnNames = impl.table.primary_key_column_names(); if(primaryKeyColumnNames.size()){ for(size_t i = 0; i < primaryKeyColumnNames.size(); ++i) { ss << "\"" << primaryKeyColumnNames[i] << "\"" << " = ? "; if(i < primaryKeyColumnNames.size() - 1) { ss << "AND "; } ss << ' '; } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; auto idsTuple = std::make_tuple(std::forward<Ids>(ids)...); constexpr const auto idsCount = std::tuple_size<decltype(idsTuple)>::value; tuple_helper::iterator<idsCount - 1, Ids...>()(idsTuple, [stmt, &index](auto &v){ using field_type = typename std::decay<decltype(v)>::type; statement_binder<field_type>().bind(stmt, index++, v); }); auto stepRes = sqlite3_step(stmt); switch(stepRes){ case SQLITE_ROW:{ O res; index = 0; impl.table.for_each_column([&index, &res, stmt] (auto c) { using field_type = typename decltype(c)::field_type; auto value = row_extractor<field_type>().extract(stmt, index++); if(c.member_pointer){ res.*c.member_pointer = value; }else{ ((res).*(c.setter))(std::move(value)); } }); return res; }break; case SQLITE_DONE:{ throw std::system_error(std::make_error_code(sqlite_orm::orm_error_code::not_found)); }break; default:{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::table_has_no_primary_key_column)); } } /** * The same as `get` function but doesn't throw an exception if noting found but returns std::shared_ptr with null value. * throws std::system_error in case of db error. */ template<class O, class ...Ids> std::shared_ptr<O> get_no_throw(Ids ...ids) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::shared_ptr<O> res; std::stringstream ss; ss << "SELECT "; auto columnNames = impl.table.column_names(); for(size_t i = 0; i < columnNames.size(); ++i) { ss << "\"" << columnNames[i] << "\""; if(i < columnNames.size() - 1) { ss << ", "; }else{ ss << " "; } } ss << "FROM '" << impl.table.name << "' WHERE "; auto primaryKeyColumnNames = impl.table.primary_key_column_names(); if(primaryKeyColumnNames.size() && primaryKeyColumnNames.front().length()){ for(size_t i = 0; i < primaryKeyColumnNames.size(); ++i) { ss << "\"" << primaryKeyColumnNames[i] << "\"" << " = ? "; if(i < primaryKeyColumnNames.size() - 1) { ss << "AND "; } ss << ' '; } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; auto idsTuple = std::make_tuple(std::forward<Ids>(ids)...); constexpr const auto idsCount = std::tuple_size<decltype(idsTuple)>::value; tuple_helper::iterator<idsCount - 1, Ids...>()(idsTuple, [stmt, &index](auto &v){ using field_type = typename std::decay<decltype(v)>::type; statement_binder<field_type>().bind(stmt, index++, v); }); auto stepRes = sqlite3_step(stmt); switch(stepRes){ case SQLITE_ROW:{ O res; index = 0; impl.table.for_each_column([&index, &res, stmt] (auto c) { using field_type = typename decltype(c)::field_type; auto value = row_extractor<field_type>().extract(stmt, index++); if(c.member_pointer){ res.*c.member_pointer = value; }else{ ((res).*(c.setter))(std::move(value)); } }); return std::make_shared<O>(std::move(res)); }break; case SQLITE_DONE:{ return {}; }break; default:{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::table_has_no_primary_key_column)); } } /** * SELECT COUNT(*) with no conditions routine. https://www.sqlite.org/lang_aggfunc.html#count * @return Number of O object in table. */ template<class O, class ...Args, class R = typename mapped_type_proxy<O>::type> int count(Args&& ...args) { this->assert_mapped_type<R>(); auto tableAliasString = alias_exractor<O>::get(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<R>(); int res = 0; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::count()) << "(*) FROM '" << impl.table.name << "' "; if(tableAliasString.length()) { ss << "'" << tableAliasString << "' "; } this->process_conditions(ss, args...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv, char **) -> int { auto &res = *(int*)data; if(argc){ res = row_extractor<int>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } return res; } /** * SELECT COUNT(X) https://www.sqlite.org/lang_aggfunc.html#count * @param m member pointer to class mapped to the storage. */ template<class F, class O, class ...Args> int count(F O::*m, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); int res = 0; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::count(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName << ") FROM '"<< impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv,char **) -> int { auto &res = *(int*)data; if(argc){ res = row_extractor<int>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } /** * AVG(X) query. https://www.sqlite.org/lang_aggfunc.html#avg * @param m is a class member pointer (the same you passed into make_column). * @return average value from db. */ template<class F, class O, class ...Args> double avg(F O::*m, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); double res = 0; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::avg(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName << ") FROM '"<< impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv,char **)->int{ auto &res = *(double*)data; if(argc){ res = row_extractor<double>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } template<class F, class O> std::string group_concat(F O::*m) { return this->group_concat_internal(m, {}); } /** * GROUP_CONCAT(X) query. https://www.sqlite.org/lang_aggfunc.html#groupconcat * @param m is a class member pointer (the same you passed into make_column). * @return group_concat query result. */ template<class F, class O, class ...Args, class Tuple = std::tuple<Args...>, typename sfinae = typename std::enable_if<std::tuple_size<std::tuple<Args...>>::value >= 1>::type > std::string group_concat(F O::*m, Args&& ...args) { return this->group_concat_internal(m, {}, std::forward<Args>(args)...); } /** * GROUP_CONCAT(X, Y) query. https://www.sqlite.org/lang_aggfunc.html#groupconcat * @param m is a class member pointer (the same you passed into make_column). * @return group_concat query result. */ template<class F, class O, class ...Args> std::string group_concat(F O::*m, const std::string &y, Args&& ...args) { return this->group_concat_internal(m, std::make_shared<std::string>(y), std::forward<Args>(args)...); } template<class F, class O, class ...Args> std::string group_concat(F O::*m, const char *y, Args&& ...args) { return this->group_concat_internal(m, std::make_shared<std::string>(y), std::forward<Args>(args)...); } /** * MAX(x) query. * @param m is a class member pointer (the same you passed into make_column). * @return std::shared_ptr with max value or null if sqlite engine returned null. */ template<class F, class O, class ...Args, class Ret = typename column_result_t<F O::*>::type> std::shared_ptr<Ret> max(F O::*m, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::shared_ptr<Ret> res; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::max(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName << ") FROM '" << impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv,char **)->int{ auto &res = *(std::shared_ptr<Ret>*)data; if(argc){ if(argv[0]){ res = std::make_shared<Ret>(row_extractor<Ret>().extract(argv[0])); } } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } /** * MIN(x) query. * @param m is a class member pointer (the same you passed into make_column). * @return std::shared_ptr with min value or null if sqlite engine returned null. */ template<class F, class O, class ...Args, class Ret = typename column_result_t<F O::*>::type> std::shared_ptr<Ret> min(F O::*m, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::shared_ptr<Ret> res; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::min(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName << ") FROM '" << impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv,char **)->int{ auto &res = *(std::shared_ptr<Ret>*)data; if(argc){ if(argv[0]){ res = std::make_shared<Ret>(row_extractor<Ret>().extract(argv[0])); } } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } /** * SUM(x) query. * @param m is a class member pointer (the same you passed into make_column). * @return std::shared_ptr with sum value or null if sqlite engine returned null. */ template<class F, class O, class ...Args, class Ret = typename column_result_t<F O::*>::type> std::shared_ptr<Ret> sum(F O::*m, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = this->get_impl<O>(); std::shared_ptr<Ret> res; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::sum(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName << ") FROM '"<< impl.table.name << "' "; this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv, char **)->int{ auto &res = *(std::shared_ptr<Ret>*)data; if(argc){ res = std::make_shared<Ret>(row_extractor<Ret>().extract(argv[0])); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } /** * TOTAL(x) query. * @param m is a class member pointer (the same you passed into make_column). * @return total value (the same as SUM but not nullable. More details here https://www.sqlite.org/lang_aggfunc.html) */ template<class F, class O, class ...Args> double total(F O::*m, Args&& ...args) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); double res; std::stringstream ss; ss << "SELECT " << static_cast<std::string>(sqlite_orm::total(0)) << "("; auto columnName = this->string_from_expression(m); if(columnName.length()){ ss << columnName << ") "; auto tableNamesSet = this->parse_table_names(m); if(tableNamesSet.size()){ ss << "FROM " ; std::vector<std::string> tableNames(tableNamesSet.begin(), tableNamesSet.end()); for(size_t i = 0; i < tableNames.size(); ++i) { ss << " '" << tableNames[i] << "' "; if(i < tableNames.size() - 1) { ss << ","; } ss << " "; } } this->process_conditions(ss, std::forward<Args>(args)...); auto query = ss.str(); auto rc = sqlite3_exec(connection->get_db(), query.c_str(), [](void *data, int argc, char **argv, char **)->int{ auto &res = *(double*)data; if(argc){ res = row_extractor<double>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } return res; } /** * Select a single column into std::vector<T> or multiple columns into std::vector<std::tuple<...>>. * For a single column use `auto rows = storage.select(&User::id, where(...)); * For multicolumns user `auto rows = storage.select(columns(&User::id, &User::name), where(...)); */ template< class T, class ...Args, class R = typename internal::column_result_t<T>::type> std::vector<R> select(T m, Args ...args) { using select_type = select_t<T, Args...>; auto query = this->string_from_expression(select_type{std::move(m), std::make_tuple<Args...>(std::forward<Args>(args)...)}); auto connection = this->get_or_create_connection(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; std::vector<R> res; int stepRes; do{ stepRes = sqlite3_step(stmt); switch(stepRes){ case SQLITE_ROW:{ res.push_back(row_extractor<R>().extract(stmt, 0)); }break; case SQLITE_DONE: break; default:{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } }while(stepRes != SQLITE_DONE); return res; }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } template< class L, class R, class ...Args, class Ret = typename internal::column_result_t<union_t<L, R>>::type> std::vector<Ret> select(union_t<L, R> op, Args ...args) { std::stringstream ss; ss << this->string_from_expression(op.left) << " "; ss << static_cast<std::string>(op) << " "; ss << this->string_from_expression(op.right) << " "; auto query = ss.str(); auto connection = this->get_or_create_connection(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; std::vector<Ret> res; int stepRes; do{ stepRes = sqlite3_step(stmt); switch(stepRes){ case SQLITE_ROW:{ res.push_back(row_extractor<Ret>().extract(stmt, 0)); }break; case SQLITE_DONE: break; default:{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } }while(stepRes != SQLITE_DONE); return res; }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } /** * Returns a string representation of object of a class mapped to the storage. * Type of string has json-like style. */ template<class O> std::string dump(const O &o) { this->assert_mapped_type<O>(); return this->impl.dump(o); } /** * This is REPLACE (INSERT OR REPLACE) function. * Also if you need to insert value with knows id you should * also you this function instead of insert cause inserts ignores * id and creates own one. */ template<class O> void replace(const O &o) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = get_impl<O>(); std::stringstream ss; ss << "REPLACE INTO '" << impl.table.name << "' ("; auto columnNames = impl.table.column_names(); auto columnNamesCount = columnNames.size(); for(size_t i = 0; i < columnNamesCount; ++i) { ss << "\"" << columnNames[i] << "\""; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ") "; } } ss << "VALUES("; for(size_t i = 0; i < columnNamesCount; ++i) { ss << "?"; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ")"; } } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; impl.table.for_each_column([&o, &index, &stmt] (auto c) { using field_type = typename decltype(c)::field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } statement_binder<field_type>().bind(stmt, index++, *value); }); if (sqlite3_step(stmt) == SQLITE_DONE) { //.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } template<class It> void replace_range(It from, It to) { using O = typename std::iterator_traits<It>::value_type; this->assert_mapped_type<O>(); if(from == to) { return; } auto connection = this->get_or_create_connection(); auto &impl = get_impl<O>(); std::stringstream ss; ss << "REPLACE INTO '" << impl.table.name << "' ("; auto columnNames = impl.table.column_names(); auto columnNamesCount = columnNames.size(); for(size_t i = 0; i < columnNamesCount; ++i) { ss << "\"" << columnNames[i] << "\""; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ") "; } } ss << "VALUES "; auto valuesString = [columnNamesCount]{ std::stringstream ss; ss << "("; for(size_t i = 0; i < columnNamesCount; ++i) { ss << "?"; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ")"; } } return ss.str(); }(); auto valuesCount = static_cast<int>(std::distance(from, to)); for(auto i = 0; i < valuesCount; ++i) { ss << valuesString; if(i < valuesCount - 1) { ss << ","; } ss << " "; } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; for(auto it = from; it != to; ++it) { auto &o = *it; impl.table.for_each_column([&o, &index, &stmt] (auto c) { using field_type = typename decltype(c)::field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } statement_binder<field_type>().bind(stmt, index++, *value); }); } if (sqlite3_step(stmt) == SQLITE_DONE) { //.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } template<class O, class ...Cols> int insert(const O &o, columns_t<Cols...> cols) { constexpr const size_t colsCount = std::tuple_size<std::tuple<Cols...>>::value; static_assert(colsCount > 0, "Use insert or replace with 1 argument instead"); this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = get_impl<O>(); std::stringstream ss; ss << "INSERT INTO '" << impl.table.name << "' "; std::vector<std::string> columnNames; columnNames.reserve(colsCount); cols.for_each([&columnNames, this](auto &m) { auto columnName = this->string_from_expression(m, true); if(columnName.length()){ columnNames.push_back(columnName); }else{ throw std::system_error(std::make_error_code(orm_error_code::column_not_found)); } }); ss << "("; for(size_t i = 0; i < columnNames.size(); ++i){ ss << columnNames[i]; if(i < columnNames.size() - 1){ ss << ","; }else{ ss << ")"; } ss << " "; } ss << "VALUES ("; for(size_t i = 0; i < columnNames.size(); ++i){ ss << "?"; if(i < columnNames.size() - 1){ ss << ","; }else{ ss << ")"; } ss << " "; } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; cols.for_each([&o, &index, &stmt, &impl] (auto &m) { using column_type = typename std::decay<decltype(m)>::type; using field_type = typename column_result_t<column_type>::type; const field_type *value = impl.table.template get_object_field_pointer<field_type>(o, m); statement_binder<field_type>().bind(stmt, index++, *value); }); if (sqlite3_step(stmt) == SQLITE_DONE) { return int(sqlite3_last_insert_rowid(connection->get_db())); }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } /** * Insert routine. Inserts object with all non primary key fields in passed object. Id of passed * object doesn't matter. * @return id of just created object. */ template<class O> int insert(const O &o) { this->assert_mapped_type<O>(); auto connection = this->get_or_create_connection(); auto &impl = get_impl<O>(); int res = 0; std::stringstream ss; ss << "INSERT INTO '" << impl.table.name << "' "; std::vector<std::string> columnNames; auto compositeKeyColumnNames = impl.table.composite_key_columns_names(); impl.table.for_each_column([&impl, &columnNames, &compositeKeyColumnNames] (auto c) { if(impl.table._without_rowid || !c.template has<constraints::primary_key_t<>>()) { auto it = std::find(compositeKeyColumnNames.begin(), compositeKeyColumnNames.end(), c.name); if(it == compositeKeyColumnNames.end()){ columnNames.emplace_back(c.name); } } }); auto columnNamesCount = columnNames.size(); if(columnNamesCount){ ss << "( "; for(size_t i = 0; i < columnNamesCount; ++i) { ss << "\"" << columnNames[i] << "\""; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ") "; } } }else{ ss << "DEFAULT "; } ss << "VALUES "; if(columnNamesCount){ ss << "( "; for(size_t i = 0; i < columnNamesCount; ++i) { ss << "?"; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ")"; } } } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; impl.table.for_each_column([&o, &index, &stmt, &impl, &compositeKeyColumnNames] (auto c) { if(impl.table._without_rowid || !c.template has<constraints::primary_key_t<>>()){ auto it = std::find(compositeKeyColumnNames.begin(), compositeKeyColumnNames.end(), c.name); if(it == compositeKeyColumnNames.end()){ using field_type = typename decltype(c)::field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } statement_binder<field_type>().bind(stmt, index++, *value); } } }); if (sqlite3_step(stmt) == SQLITE_DONE) { res = int(sqlite3_last_insert_rowid(connection->get_db())); }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } return res; } template<class It> void insert_range(It from, It to) { using O = typename std::iterator_traits<It>::value_type; this->assert_mapped_type<O>(); if(from == to) { return; } auto connection = this->get_or_create_connection(); auto &impl = get_impl<O>(); std::stringstream ss; ss << "INSERT INTO '" << impl.table.name << "' ("; std::vector<std::string> columnNames; impl.table.for_each_column([&columnNames] (auto c) { if(!c.template has<constraints::primary_key_t<>>()) { columnNames.emplace_back(c.name); } }); auto columnNamesCount = columnNames.size(); for(size_t i = 0; i < columnNamesCount; ++i) { ss << "\"" << columnNames[i] << "\""; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ") "; } } ss << "VALUES "; auto valuesString = [columnNamesCount]{ std::stringstream ss; ss << "("; for(size_t i = 0; i < columnNamesCount; ++i) { ss << "?"; if(i < columnNamesCount - 1) { ss << ", "; }else{ ss << ")"; } } return ss.str(); }(); auto valuesCount = static_cast<int>(std::distance(from, to)); for(auto i = 0; i < valuesCount; ++i) { ss << valuesString; if(i < valuesCount - 1) { ss << ","; } ss << " "; } auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; auto index = 1; for(auto it = from; it != to; ++it) { auto &o = *it; impl.table.for_each_column([&o, &index, &stmt] (auto c) { if(!c.template has<constraints::primary_key_t<>>()){ typedef typename decltype(c)::field_type field_type; const field_type *value = nullptr; if(c.member_pointer){ value = &(o.*c.member_pointer); }else{ value = &((o).*(c.getter))(); } statement_binder<field_type>().bind(stmt, index++, *value); } }); } if (sqlite3_step(stmt) == SQLITE_DONE) { //.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } void drop_index(const std::string &indexName) { auto connection = this->get_or_create_connection(); std::stringstream ss; ss << "DROP INDEX '" << indexName + "'"; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } void vacuum() { auto connection = this->get_or_create_connection(); std::string query = "VACUUM"; sqlite3_stmt *stmt; if (sqlite3_prepare_v2(connection->get_db(), query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(connection->get_db()), get_sqlite_error_category())); } } protected: void drop_table_internal(const std::string &tableName, sqlite3 *db) { std::stringstream ss; ss << "DROP TABLE '" << tableName + "'"; auto query = ss.str(); sqlite3_stmt *stmt; if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) == SQLITE_OK) { statement_finalizer finalizer{stmt}; if (sqlite3_step(stmt) == SQLITE_DONE) { // done.. }else{ throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } }else { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } public: /** * Drops table with given name. */ void drop_table(const std::string &tableName) { auto connection = this->get_or_create_connection(); this->drop_table_internal(tableName, connection->get_db()); } /** * sqlite3_changes function. */ int changes() { auto connection = this->get_or_create_connection(); return sqlite3_changes(connection->get_db()); } /** * sqlite3_total_changes function. */ int total_changes() { auto connection = this->get_or_create_connection(); return sqlite3_total_changes(connection->get_db()); } int64 last_insert_rowid() { auto connection = this->get_or_create_connection(); return sqlite3_last_insert_rowid(connection->get_db()); } int busy_timeout(int ms) { auto connection = this->get_or_create_connection(); return sqlite3_busy_timeout(connection->get_db(), ms); } /** * Returns libsqltie3 lib version, not sqlite_orm */ std::string libversion() { return sqlite3_libversion(); } protected: template<class ...Tss, class ...Cols> sync_schema_result sync_table(storage_impl<internal::index_t<Cols...>, Tss...> *impl, sqlite3 *db, bool) { auto res = sync_schema_result::already_in_sync; std::stringstream ss; ss << "CREATE "; if(impl->table.unique){ ss << "UNIQUE "; } using columns_type = typename decltype(impl->table)::columns_type; using head_t = typename std::tuple_element<0, columns_type>::type; using indexed_type = typename internal::table_type<head_t>::type; ss << "INDEX IF NOT EXISTS " << impl->table.name << " ON '" << this->impl.template find_table_name<indexed_type>() << "' ( "; std::vector<std::string> columnNames; tuple_helper::iterator<std::tuple_size<columns_type>::value - 1, Cols...>()(impl->table.columns, [&columnNames, this](auto &v){ columnNames.push_back(this->impl.column_name(v)); }); for(size_t i = 0; i < columnNames.size(); ++i) { ss << columnNames[i]; if(i < columnNames.size() - 1) { ss << ","; } ss << " "; } ss << ") "; auto query = ss.str(); auto rc = sqlite3_exec(db, query.c_str(), nullptr, nullptr, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } return res; } template<class ...Tss, class ...Cs> sync_schema_result sync_table(storage_impl<table_t<Cs...>, Tss...> *impl, sqlite3 *db, bool preserve) { auto res = sync_schema_result::already_in_sync; auto schema_stat = impl->schema_status(db, preserve); if(schema_stat != decltype(schema_stat)::already_in_sync) { if(schema_stat == decltype(schema_stat)::new_table_created) { this->create_table(db, impl->table.name, impl); res = decltype(res)::new_table_created; }else{ if(schema_stat == sync_schema_result::old_columns_removed || schema_stat == sync_schema_result::new_columns_added || schema_stat == sync_schema_result::new_columns_added_and_old_columns_removed) { // get table info provided in `make_table` call.. auto storageTableInfo = impl->table.get_table_info(); // now get current table info from db using `PRAGMA table_info` query.. auto dbTableInfo = impl->get_table_info(impl->table.name, db); // this vector will contain pointers to columns that gotta be added.. std::vector<table_info*> columnsToAdd; impl->get_remove_add_columns(columnsToAdd, storageTableInfo, dbTableInfo); if(schema_stat == sync_schema_result::old_columns_removed) { // extra table columns than storage columns this->backup_table(db, impl); res = decltype(res)::old_columns_removed; } if(schema_stat == sync_schema_result::new_columns_added) { for(auto columnPointer : columnsToAdd) { impl->add_column(*columnPointer, db); } res = decltype(res)::new_columns_added; } if(schema_stat == sync_schema_result::new_columns_added_and_old_columns_removed) { //remove extra columns this->backup_table(db, impl); for(auto columnPointer : columnsToAdd) { impl->add_column(*columnPointer, db); } res = decltype(res)::new_columns_added_and_old_columns_removed; } } else if(schema_stat == sync_schema_result::dropped_and_recreated) { this->drop_table_internal(impl->table.name, db); this->create_table(db, impl->table.name, impl); res = decltype(res)::dropped_and_recreated; } } } return res; } public: /** * This is a cute function used to replace migration up/down functionality. * It performs check storage schema with actual db schema and: * * if there are excess tables exist in db they are ignored (not dropped) * * every table from storage is compared with it's db analog and * * if table doesn't exist it is being created * * if table exists its colums are being compared with table_info from db and * * if there are columns in db that do not exist in storage (excess) table will be dropped and recreated * * if there are columns in storage that do not exist in db they will be added using `ALTER TABLE ... ADD COLUMN ...' command * * if there is any column existing in both db and storage but differs by any of properties/constraints (type, pk, notnull, dflt_value) table will be dropped and recreated * Be aware that `sync_schema` doesn't guarantee that data will not be dropped. It guarantees only that it will make db schema the same * as you specified in `make_storage` function call. A good point is that if you have no db file at all it will be created and * all tables also will be created with exact tables and columns you specified in `make_storage`, `make_table` and `make_column` call. * The best practice is to call this function right after storage creation. * @param preserve affects on function behaviour in case it is needed to remove a column. If it is `false` so table will be dropped * if there is column to remove, if `true` - table is being copied into another table, dropped and copied table is renamed with source table name. * Warning: sync_schema doesn't check foreign keys cause it is unable to do so in sqlite3. If you know how to get foreign key info * please submit an issue https://github.com/fnc12/sqlite_orm/issues * @return std::map with std::string key equal table name and `sync_schema_result` as value. `sync_schema_result` is a enum value that stores * table state after syncing a schema. `sync_schema_result` can be printed out on std::ostream with `operator<<`. */ std::map<std::string, sync_schema_result> sync_schema(bool preserve = false) { auto connection = this->get_or_create_connection(); std::map<std::string, sync_schema_result> result; auto db = connection->get_db(); this->impl.for_each([&result, db, preserve, this](auto impl){ auto res = this->sync_table(impl, db, preserve); result.insert({impl->table.name, res}); }); return result; } /** * This function returns the same map that `sync_schema` returns but it * doesn't perform `sync_schema` actually - just simulates it in case you want to know * what will happen if you sync your schema. */ std::map<std::string, sync_schema_result> sync_schema_simulate(bool preserve = false) { auto connection = this->get_or_create_connection(); std::map<std::string, sync_schema_result> result; auto db = connection->get_db(); this->impl.for_each([&result, db, preserve](auto impl){ result.insert({impl->table.name, impl->schema_status(db, preserve)}); }); return result; } bool transaction(std::function<bool()> f) { this->begin_transaction(); auto db = this->currentTransaction->get_db(); auto shouldCommit = f(); if(shouldCommit){ this->impl.commit(db); }else{ this->impl.rollback(db); } if(!this->inMemory && !this->isOpenedForever){ this->currentTransaction = nullptr; } return shouldCommit; } void begin_transaction() { if(!this->inMemory){ if(!this->isOpenedForever){ if(this->currentTransaction) throw std::system_error(std::make_error_code(orm_error_code::cannot_start_a_transaction_within_a_transaction)); this->currentTransaction = std::make_shared<internal::database_connection>(this->filename); this->on_open_internal(this->currentTransaction->get_db()); } } auto db = this->currentTransaction->get_db(); this->impl.begin_transaction(db); } void commit() { if(!this->inMemory){ if(!this->currentTransaction) throw std::system_error(std::make_error_code(orm_error_code::no_active_transaction)); } auto db = this->currentTransaction->get_db(); this->impl.commit(db); if(!this->inMemory && !this->isOpenedForever){ this->currentTransaction = nullptr; } } void rollback() { if(!this->inMemory){ if(!this->currentTransaction) throw std::system_error(std::make_error_code(orm_error_code::no_active_transaction)); } auto db = this->currentTransaction->get_db(); this->impl.rollback(db); if(!this->inMemory && !this->isOpenedForever){ this->currentTransaction = nullptr; } } std::string current_timestamp() { auto connection = this->get_or_create_connection(); return this->impl.current_timestamp(connection->get_db()); } protected: #if SQLITE_VERSION_NUMBER >= 3006019 void foreign_keys(sqlite3 *db, bool value) { std::stringstream ss; ss << "PRAGMA foreign_keys = " << value; auto query = ss.str(); auto rc = sqlite3_exec(db, query.c_str(), nullptr, nullptr, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } } bool foreign_keys(sqlite3 *db) { std::string query = "PRAGMA foreign_keys"; auto res = false; auto rc = sqlite3_exec(db, query.c_str(), [](void *data, int argc, char **argv,char **) -> int { auto &res = *(bool*)data; if(argc){ res = row_extractor<bool>().extract(argv[0]); } return 0; }, &res, nullptr); if(rc != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(db), get_sqlite_error_category())); } return res; } #endif public: #if SQLITE_VERSION_NUMBER >= 3007010 /** * \fn db_release_memory * \brief Releases freeable memory of database. It is function can/should be called periodically by application, * if application has less memory usage constraint. * \note sqlite3_db_release_memory added in 3.7.10 https://sqlite.org/changes.html */ int db_release_memory() { auto connection = this->get_or_create_connection(); return sqlite3_db_release_memory(connection->get_db()); } #endif /** * Checks whether table exists in db. Doesn't check storage itself - works only with actual database. * Note: table can be not mapped to a storage * @return true if table with a given name exists in db, false otherwise. */ bool table_exists(const std::string &tableName) { auto connection = this->get_or_create_connection(); return this->impl.table_exists(tableName, connection->get_db()); } /** * Returns existing permanent table names in database. Doesn't check storage itself - works only with actual database. * @return Returns list of tables in database. */ std::vector<std::string> table_names() { auto connection = this->get_or_create_connection(); std::vector<std::string> tableNames; std::string sql = "SELECT name FROM sqlite_master WHERE type='table'"; using Data = std::vector<std::string>; int res = sqlite3_exec(connection->get_db(), sql.c_str(), [] (void *data, int argc, char **argv, char ** /*columnName*/) -> int { auto& tableNames = *(Data*)data; for(int i = 0; i < argc; i++) { if(argv[i]){ tableNames.push_back(argv[i]); } } return 0; }, &tableNames,nullptr); if(res != SQLITE_OK) { throw std::system_error(std::error_code(sqlite3_errcode(connection->db()), get_sqlite_error_category())); } return tableNames; } void open_forever() { this->isOpenedForever = true; if(!this->currentTransaction){ this->currentTransaction = std::make_shared<internal::database_connection>(this->filename); this->on_open_internal(this->currentTransaction->get_db()); } } public: pragma_t pragma; limit_accesor limit; }; } template<class ...Ts> internal::storage_t<Ts...> make_storage(const std::string &filename, Ts ...tables) { return {filename, internal::storage_impl<Ts...>(tables...)}; } } #pragma once #if defined(_MSC_VER) # if defined(__RESTORE_MIN__) __pragma(pop_macro("min")) # undef __RESTORE_MIN__ # endif # if defined(__RESTORE_MAX__) __pragma(pop_macro("max")) # undef __RESTORE_MAX__ # endif #endif // defined(_MSC_VER)
[ "sergiosvieira@gmail.com" ]
sergiosvieira@gmail.com
c74de3c706687e9c2a2e86191e83c1037265e6b4
0006f89c8d952bcf14a6150e9c26c94e47fab040
/src/trace/D3DDriver/AD3D9/FFGenerator/FFShaderGenerator.h
f4cc832bc76a73e706a19e3838647278406ba353
[ "BSD-3-Clause" ]
permissive
cooperyuan/attila
eceb5d34b8c64c53ffcc52cd96b684d4f88b706f
29a0ceab793b566c09cf81af26263e4855842c7a
refs/heads/master
2016-09-05T18:55:56.472248
2013-06-29T14:42:02
2013-06-29T14:42:02
10,222,034
8
1
null
null
null
null
UTF-8
C++
false
false
32,913
h
/************************************************************************** * * Copyright (c) 2002 - 2011 by Computer Architecture Department, * Universitat Politecnica de Catalunya. * All rights reserved. * * The contents of this file may not be disclosed to third parties, * copied or duplicated in any form, in whole or in part, without the * prior permission of the authors, Computer Architecture Department * and Universitat Politecnica de Catalunya. * */ #ifndef ____FF_SHADER_GENERATOR #define ____FF_SHADER_GENERATOR #include <set> #include <list> #include <map> #include <vector> #include "Types.h" /** * * Defines the state associated with fixed function D3D9 Texture Stage. * */ struct TextureStageState { D3DTEXTUREOP colorOp; /**< Stage operation for the color components RGB. */ u32bit colorArg0; /**< Third argument for the color operation (triadic operations MAD and LERP). */ u32bit colorArg1; /**< First argument for the color operation. */ u32bit colorArg2; /**< Second argument for the color operation. */ D3DTEXTUREOP alphaOp; /**< Stage operation for the alpha component. */ u32bit alphaArg0; /**< Third argument for the alpha operation (triadic operations MAD and LERP). */ u32bit alphaArg1; /**< First argument for the alpha operation. */ u32bit alphaArg2; /**< Second argument for the alpha operation. */ f32bit bumpEnvMatrix[2][2]; /**< Bump-mapping matrix. */ f32bit bumpEnvLScale; /**< Bump-mapping luminance scale. */ f32bit bumpEnvLOffset; /**< Bump-mapping luminance offset. */ u32bit index; /**< Index to the texture coordinate to use for the stage. */ D3DTEXTURETRANSFORMFLAGS transformFlags; /**< Transformation for the texture coordinates. */ u32bit resultArg; /**< Destination register for the result (current or temp). */ D3DCOLORVALUE constant; /**< Constant color value. */ /** * * Constructor. Used to initialize the TextureStageState fields to default values. * */ TextureStageState(); }; /** * * Defines the fixed function state for D3D9 shader generation. * */ struct FFState { // // Vertex related state. // // // Vertex input declaration. // DWORD fvf; /**< Fixed function vertex declaration. */ std::vector<D3DVERTEXELEMENT9> vertexDeclaration; /**< Vertex declaration. */ // // Vertex position transformation and blending. // D3DMATRIX world; /**< World matrix. */ D3DMATRIX view; /**< View matrix. */ D3DMATRIX projection; /**< Projection matrix. */ DWORD vertexBlend; /**< Defines if vertex blending is enabled and the mode. */ bool indexedVertexBlend; /**< Defines if indexed vertex blending is enabled. */ f32bit tweenFactor; /**< Tween factor for vertex blending. */ // Texture coordinate transformation matrices. D3DMATRIX texture[8]; /**< Texture coordinate transform matrix. */ // // Vertex color and ligthing. // bool lightingEnabled; /**< Defines if vertex lighting is enabled. */ bool vertexColor; /**< Defines if vertex color is enabled. */ bool specularEnable; /**< Defines if specular highlights are enabled (adds a second color output, applied in pixel). */ bool localViewer; /**< Defines if camera-relative specular highlights (true) or orthogonal specular highlights (false) are used. */ bool normalizeNormals; /**< Defines if vertex normals are normalized. */ D3DMATERIALCOLORSOURCE diffuseMaterialSource; /**< Defines the diffuse material source for vertex lighting. */ D3DMATERIALCOLORSOURCE specularMaterialSource; /**< Defines the specular material source for vertex lighting. */ D3DMATERIALCOLORSOURCE ambientMaterialSource; /**< Defines the ambient material source for vertex lighting. */ D3DMATERIALCOLORSOURCE emissiveMaterialSource; /**< Defines the emissive material source for vertex lighting. */ D3DMATERIAL9 material; /**< Defines the material for vertex lighting. */ D3DCOLORVALUE ambient; /**< Defines the ambient color for vertex lighting. */ D3DLIGHT9 lights[8]; /**< Defines the lights for vertex lighiting. */ bool lightsEnabled[8]; /**< Defines if lights are enabled for vertex lighting. */ // // Pixel related state. // bool settedTexture[8]; /**< Defines if a texture stage has a defined texture. */ D3DSAMPLER_TEXTURE_TYPE textureType[8]; /**< The texture type for the defined texture. */ TextureStageState textureStage[8]; /**< Texture stage state. */ D3DCOLORVALUE textureFactor; /**< Texture factor from render state. */ // // Fog related state (shared between vertex and pixel). // bool fogEnable; /**< Defines if fog is enabled. */ D3DCOLORVALUE fogColor; /**< Defines the fog color. */ D3DFOGMODE fogPixelMode; /**< Defines the pixel fog mode. */ D3DFOGMODE fogVertexMode; /**< Defines the vertex fog mode. */ FLOAT fogStart; /**< Defines the fog start. */ FLOAT fogEnd; /**< Defines the fog end. */ FLOAT fogDensity; /**< Defines the fog density. */ bool fogRange; /**< Defines the fog range. */ /** * * Constructor. Initializes the structure with default values. * */ FFState(); }; /** * * Defines the usages for constants in the fixed function shaders. * */ enum FFUsage { FF_NONE, FF_VIEWPORT, /**< Constant stores viewport/resolution information -> (2/width, 2/height, 1, ) */ FF_WORLDVIEWPROJ, /**< Constants store the world x view x projection matrix. */ FF_WORLDVIEW, /**< Constants store the world x view matrix. */ FF_WORLDVIEW_IT, /**< Constants store the world x view ? matrix. */ FF_VIEW_IT, /**< Constants store the view matrix ?. */ FF_WORLD, /**< Constants store the world matrix. */ FF_MATERIAL_EMISSIVE, /**< Constant stores the material emissive color. */ FF_MATERIAL_SPECULAR, /**< Constant stores the material specular color. */ FF_MATERIAL_DIFFUSE, /**< Constant stores the material diffuse color. */ FF_MATERIAL_AMBIENT, /**< Constant stores the material ambient color. */ FF_MATERIAL_POWER, /**< Constant stores the material specular power ?. */ FF_AMBIENT, /**< Constant stores the ambient color. */ FF_LIGHT_POSITION, /**< Constant stores the light position. */ FF_LIGHT_DIRECTION, /**< Constant stores the light direction. */ FF_LIGHT_AMBIENT, /**< Constant stores the light ambient color. */ FF_LIGHT_DIFFUSE, /**< Constant stores the light diffuse color. */ FF_LIGHT_SPECULAR, /**< Constant stores the light specular color. */ FF_LIGHT_RANGE, /**< Constant stores the light range. */ FF_LIGHT_ATTENUATION, /**< Constant stores the light attenuation. */ FF_LIGHT_SPOT /**< Constant stores the light spot ?. */ }; /** * * Defines the fixed function usage for a constant in a generated shader. */ struct FFUsageId { FFUsage usage; /**< Defines the usage of the constant. */ BYTE index; /**< Defines the index for the usage. */ /** * * Less-than comparison operator. * * @param b Reference to a FFUsageId object to be compared with this object. * * @return If this object usage is smaller than the parameter object usage, or if equal if this object usage index is smaller than the parameter object usage index. * */ bool operator<(const FFUsageId &b) const { if((unsigned int)(usage) < (unsigned int)(b.usage)) return true; else if((unsigned int)(usage) > (unsigned int)(b.usage)) return false; else return (index < b.index); } /** * * Equal comparison operator. * * @param b Reference to a FFUsageId object to be compared with this object. * * @return If this object usage and usage index is equal to the parameter object usage and usage index. * */ bool operator==(const FFUsageId &b) const { return (usage == b.usage) && (index == b.index); } /** * * Constructor. Sets default values. * */ FFUsageId(): usage(FF_NONE), index(0) {} /** * * Constructor. Sets defined values. * * @param _usage The usage defined for the new object. * @param _index The usage index defined for the new object, default is 0. * **/ FFUsageId(FFUsage _usage, BYTE _index = 0): usage(_usage), index(_index) {} }; /** * * Template class that stores information about the different registers banks for the * generated shaders. * * Class parameters: * * REGISTERID The type to be used the register identifiers. * USAGEID The type to be used for the register usages. * */ template<typename REGISTERID, typename USAGEID = REGISTERID> class RegisterBank { private: std::set<REGISTERID> available; /**< Set storing the available registers. */ std::map<USAGEID, REGISTERID> reservedUsage; /**< Map that maps registers to usages. */ std::set<REGISTERID> reserved; /**< Set storing the reserved registers. */ public: /** * * Adds a register to the bank. * * @param reg The register identifier for the new register to be added. * */ void insert(REGISTERID reg) { available.insert(reg); } /** * * Clears the register bank from all registers. * */ void clear() { available.clear(); reserved.clear(); reservedUsage.clear(); } /** * * Reserves a register. * * @return The identifier of the reserved register. * */ REGISTERID reserve() { REGISTERID reserved; typename std::set<REGISTERID>::iterator it_a; // Get the first available register. it_a = available.begin(); // Check if it actually got a register. if (it_a == available.end()) { panic("RegisterBank", "reserve", "There are no available registers."); } else { // Set the register as reserved. reserved = *it_a; available.erase(reserved); } return reserved; } /** * * Checks if the usage is used in a reserved register. * * @param usage The usage to check for a reserved register. * * @return If the usage is used by a reserved register. * */ bool isReservedUsage(USAGEID usage) { return (reservedUsage.find(usage) != reservedUsage.end()); } /** * * Checks if a register is reserved. * * @param reg The identifier of the register to check if it is reserved. * * @return If the register is reserved. * */ bool isReserved(REGISTERID reg) { return (reserved.find(reg) != reserved.end()); } /** * * Reserves a register and associates an usage. * * @param usage The usage defined for the usage. * * @return The reserved register identifier. * */ REGISTERID reserveUsage(USAGEID usage) { // Reserve a register. REGISTERID reserved = reserve(); typename std::map<USAGEID, REGISTERID>::iterator it; // Check if the usage is already defined to reserved register. if (isReservedUsage(usage)) panic("RegisterBank", "reserveUsage", "Usage was already reserved for a reserved register."); // Map the reserved register with the usage. reservedUsage[usage] = reserved; return reserved; } /** * * Search for the register associated with the defined usage. If the usage has no register reserved and * the function is asked to a new register will be reserved and returned. * * @param usage The usage for which to search the associated reserved register. * @param reserve Defines if when the usage has not register reserved reserve a register on the spot and return it. * * @return The register identifier for the reserved register associated with the defined usage. * */ REGISTERID findUsage(USAGEID usage, bool reserve = false) { REGISTERID found_register; typename std::map<USAGEID, REGISTERID>::iterator it_u; // Search for the usage. it_u = reservedUsage.find(usage); if(it_u != reservedUsage.end()) { // Return the usage found. found_register = (*it_u).second; } else { // Check if requested to reserve a register if not found. if(reserve) { // Reserve a new register for the usage. found_register = reserveUsage(usage); } else panic("RegisterBank", "findUsage", "Could not reserve register for usage."); } return found_register; } /** * * Releases as register. * * @param reg The identifier of the register to release. * */ void release(REGISTERID reg) { available.insert(reg); reserved.erase(reg); } /** * * Releases an usage and it's associated register. * * @param usage The usage to release. * */ void releaseUsage(USAGEID usage) { typename std::map<USAGEID, REGISTERID>::iterator it_u; // Search for the usage. it_u = reservedUsage.find(usage); // Check if the usage was found. if(it_u != reservedUsage.end()) { REGISTERID released; released = (*it_u).second; reservedUsage.erase(usage); reserved.erase(released); } else panic("RegisterBank", "releaseUsage", "Usage not reserved."); } }; // // // Helper functions used to operate with matrices. // /** * * Creates an identity matrix. * * @param dest Pointer to a matrix where to store the matrix. * */ void identityMatrix(D3DMATRIX *dest); /** * * Copy a matrix. * * @param dest Pointer to a matrix where to store the copy. * @param source Pointer to the matrix to copy. * */ void copyMatrix(D3DMATRIX *dest, const D3DMATRIX* source); /** * * Multiply two matrices. * * @param dest Pointer to a matrix where to store the multiplication result matrix. * @param source_a Pointer to the first matrix to multiply. * @param source_b Pointer to the second matrix to multiply. * */ void multiplyMatrix(D3DMATRIX *dest, const D3DMATRIX* source_a, const D3DMATRIX* source_b); /** * * Transpose a matrix. * * @param dest Pointer to the matrix where to store the transposition result matrix. * @param source Pointer to the matrix to transpose. * */ void transpose_matrix(D3DMATRIX *dest, const D3DMATRIX *source); /** * * Invert a matrix. * * @param dest Pointer to the matrix where to store the inverted result matrix. * @param source Pointer to the matrix to invert. * */ void invertMatrix(D3DMATRIX *dest, const D3DMATRIX *source); // // Helper functions used to assemble D3D9 shader bytecode tokens. // /** * * Assemble a D3D9 shader bytecode pixel shader version token. * * @param _Major The shader version major number. * @param _Minor The shader version minor number. * * @return The assembled D3D9 shader bytecode pixel shader version token. * */ DWORD ver_ps_tk(UINT _Major,UINT _Minor); /** * * Assemble a D3D9 shader bytecode vertex shader version token. * * @param _Major The shader version major number. * @param _Minor The shader version minor number. * * @return The assembled D3D9 shader bytecode vertex shader version token. * */ DWORD ver_vs_tk(UINT _Major,UINT _Minor); /** * * Assemble a D3D9 shader bytecode end token. * * @return The assembled a D3D9 shader bytecode end token. * */ DWORD end_tk(); /** * * Assemble a D3D9 shader bytecode instruction token. * * @param opcode The instruction opcode. * @param length The number of tokens associated with the instruction (arguments, results, ...), default 0 * * @return The assembled a D3D9 shader bytecode instruction token. * */ DWORD ins_tk(D3DSHADER_INSTRUCTION_OPCODE_TYPE opcode, BYTE length = 0); /** * * Assemble a D3D9 shader bytecode source parameter token. * * @param reg Identifier of a D3D9 shader register. * @param swz_x Swizzle for the the parameter x component, default x (0 -> x , 1 -> y , 2 -> z , 3 -> w). * @param swz_y Swizzle for the the parameter y component, default y (0 -> x , 1 -> y , 2 -> z , 3 -> w). * @param swz_z Swizzle for the the parameter z component, default z (0 -> x , 1 -> y , 2 -> z , 3 -> w). * @param swz_w Swizzle for the the parameter w component, default w (0 -> x , 1 -> y , 2 -> z , 3 -> w). * @param modifier The source parameter modifier, default none. * * @return The assembled a D3D9 shader bytecode source parameter token. * */ DWORD src_tk(D3DRegisterId reg, BYTE swz_x = 0, BYTE swz_y = 1, BYTE swz_z = 2, BYTE swz_w = 3, D3DSHADER_PARAM_SRCMOD_TYPE modifier = D3DSPSM_NONE ); /** * * Assemble a D3D9 shader bytecode destination parameter token. * * @param reg Identifier of a D3D9 shader register. * @param wmx Mask for the parameter x component, default write (0 -> do not write, 1 -> write). * @param wmy Mask for the parameter x component, default write (0 -> do not write, 1 -> write). * @param wmz Mask for the parameter x component, default write (0 -> do not write, 1 -> write). * @param wmw Mask for the parameter x component, default write (0 -> do not write, 1 -> write). * @param modifier The destination parameter modifier, default none (?). * @param shift The destination parameter shift, default none (?) * * @return The assembled a D3D9 shader bytecode destination parameter token. * */ DWORD dst_tk(D3DRegisterId reg, BYTE wmx = 1, BYTE wmy = 1, BYTE wmz = 1, BYTE wmw = 1, DWORD modifier = 0, DWORD shift = 0); /** * * Assemble a D3D9 shader bytecode semantic token. * * @param usage The D3D9 semantic usage. * @param usage_index The usage index. * * @return The assembled a D3D9 shader bytecode semantic token. * */ DWORD sem_tk(UINT usage, UINT usage_index = 0); /** * * Assemble a D3D9 shader bytecode float point value token. * * @param value A float point value. * * @return The assembled a D3D9 shader bytecode float point value token. * */ DWORD flt_tk(FLOAT value); /** * * Assemble a D3D9 shader bytecode sampler definition token. * * @param type The sampler type. * * @return The assembled a D3D9 shader sampler definition token. * */ DWORD sam_tk(D3DSAMPLER_TEXTURE_TYPE type); /** * * Assemble a D3D9 shader bytecode comment token. * * @param size Number of tokens/dwords in the comment. * * @return The assembled a D3D9 shader comment token. * */ DWORD com_tk(DWORD size); /** * * Defines fixed function constant declarations in the generated shaders. * */ struct FFConstRegisterDeclaration { D3DRegisterId constant; /**< D3D9 register identifier for the defined constant. */ FFUsageId usage; /**< Fixed function usage for the defined constant. */ /** * * Constructor. Sets defined values. * * @param _constant The D3D9 register identifier for the constant to define. * @param _usage The fixed function usage for the constant. * */ FFConstRegisterDeclaration(D3DRegisterId _constant, FFUsageId _usage): constant(_constant), usage(_usage) {} /** * * Constructor. Empty. * */ FFConstRegisterDeclaration() {} }; /** * * Stores the D3D9 shader generated to emulate fixed function and related information. * * */ struct FFGeneratedShader { std::list<FFConstRegisterDeclaration> const_declaration; /**< List with the defined constants with fixed function usage. */ DWORD *code; /**< Pointer to the generated D3D9 shader bytecode. */ /** * * Constructor. Set with the defined values. * * @param _const_declaration The list of constant declarations with fixed function usage. * @param code Pointer to the generated D3D9 shader bytecode. * */ FFGeneratedShader(std::list<FFConstRegisterDeclaration> _const_declaration, DWORD *_code): const_declaration(_const_declaration), code(_code) {} /** * * Constructor. Empty. * */ FFGeneratedShader(): code(0) {} /** * * Destructor. Deletes code array if required. * */ ~FFGeneratedShader() { if (code !=0) delete[] code; } }; /** * * Fixed function D3D9 shader generator. * * Generates D3D9 shaders in bytecode format based on the defined D3D9 fixed function state. * */ class FFShaderGenerator { public: /** * * Generate a D3D9 vertex shader (vs 3.0) for the defined D3D9 fixed function state. * * @param _ff_state Defined fixed function state. * * @return A pointer to the structure storing the generated vertex shader in shader bytecode format and related information. * */ FFGeneratedShader *generate_vertex_shader(FFState _ff_state); /** * * Generate a D3D9 pixel shader (ps 3.0) for the defined D3D9 fixed function state. * * @param _ff_state Defined fixed function state. * * @return A pointer to the structure storing the generated pixel shader in shader bytecode format and related information. * */ FFGeneratedShader *generate_pixel_shader(FFState _ff_state); private: FFState ff_state; /**< The current fixed function state. */ std::list<DWORD> def; /**< List with the D3D9 shader definition tokens. */ std::list<DWORD> dec; /**< List with the D3D9 shader declaration tokens. */ std::list<DWORD> cod; /**< List with the D3D9 shader code (instruction, comments?) tokens. */ RegisterBank<D3DRegisterId, D3DUsageId> input; /**< Register bank for inputs. */ RegisterBank<D3DRegisterId, D3DUsageId> output; /**< Register bank for outputs. */ RegisterBank<D3DRegisterId, D3DUsageId> samplers; /**< Register bank for samplers. */ RegisterBank<D3DRegisterId> temp; /**< Register bank for temporary registers. */ RegisterBank<D3DRegisterId, FFUsageId> constant; /**< Register bank for constant registers. */ D3DRegisterId literals; /**< D3D9 register identifier for some basic constant values (0, 1, 0, 0). */ std::list<FFConstRegisterDeclaration> const_declaration; /** * * Initialize register banks for vertex shader generation. * */ void vsInitializeRegisterBanks(); /** * * Initialize register banks for pixel shader generation. * */ void psInitializeRegisterBanks(); /** * * Generate vertex shader code for space transformations. * * @param dst_N D3D9 register identifier for the normal. * @param dst_V D3D9 register identifier for the position in viewer space (?). * @param dst_P D3D9 regsiter identifier for the position in clip space. * */ void vs_transform(D3DRegisterId dst_N, D3DRegisterId dst_V, D3DRegisterId dst_P); /** * * Generate vertex shader code for vertex lighting. * * @param src_N D3D9 register identifier for the normal. * @param src_V D3D9 register identifier for the position in viewer space (?). * */ void vs_lighting(D3DRegisterId src_N, D3DRegisterId src_V); /** * * Generate the vertex shader input declaration. * */ void vs_input_declaration(); /** * * Generate vertex shader code for pretransformed position (usage POSITIONT). * */ void vs_transformed_position(); /** * * Generate a comment. * * @param text Pointer to a char string with the comment. * */ void comment(char *text); /** * * Generate code to negate a value. * * @param dst D3D9 register where to store the negated value. * @param src D3D9 register with the value to negate. * */ void negate(D3DRegisterId dst, D3DRegisterId src); /** * * Generate code to copy a value. * * @param dst D3D9 register where to store the copied value. * @param src D3D9 register with the value to copy. * */ void mov(D3DRegisterId dst, D3DRegisterId src); /** * * Generate code to normalize a 3-component vector. * * @param dst D3D9 register where to store the normalized 3-component vector. * @param src D3D9 register with the 3-component vector to normalize. * */ void normalize(D3DRegisterId res, D3DRegisterId vec); /** * * Generate code for a 3-component vector matrix multiplication. * * @param dst D3D9 register where to store the result 3-component vector. * @param src_vec D3D9 register with the 3-component input vector. * @param src_mat0 D3D9 register with the first row of the matrix with whic to multiply. * @param src_mat1 D3D9 register with the second row of the matrix with which to multiply. * @param src_mat2 D3D9 register with the third row of the matrix with which to multiply. * */ void mul_mat3_vec3(D3DRegisterId dst, D3DRegisterId src_vec, D3DRegisterId src_mat0, D3DRegisterId src_mat1, D3DRegisterId src_mat2); /** * * Generate code for a 4-component vector matrix multiplication. * * @param dst D3D9 register where to store the result 4-component vector. * @param src_vec D3D9 register with the 4-component input vector. * @param src_mat0 D3D9 register with the first row of the matrix with whic to multiply. * @param src_mat1 D3D9 register with the second row of the matrix with which to multiply. * @param src_mat2 D3D9 register with the third row of the matrix with which to multiply. * @param src_mat3 D3D9 register with the fourth row of the matrix with which to multiply. * */ void mul_mat4_vec4(D3DRegisterId dst, D3DRegisterId src_vec, D3DRegisterId src_mat0, D3DRegisterId src_mat1, D3DRegisterId src_mat2, D3DRegisterId src_mat3); /** * * Generate code for a 3-component vector 4x4 matrix multiplication. * * @param dst D3D9 register where to store the result 3-component vector. * @param src_vec D3D9 register with the 3-component input vector. * @param src_mat0 D3D9 register with the first row of the matrix with whic to multiply. * @param src_mat1 D3D9 register with the second row of the matrix with which to multiply. * @param src_mat2 D3D9 register with the third row of the matrix with which to multiply. * @param src_mat3 D3D9 register with the fourth row of the matrix with which to multiply. * */ void mul_mat4_vec3(D3DRegisterId dst, D3DRegisterId src_vec, D3DRegisterId src_mat0, D3DRegisterId src_mat1, D3DRegisterId src_mat2, D3DRegisterId src_mat3); /** * * Checks if a usage is defined in the vertex declaration. * * @param usage The D3D9 usage to check if it's defined in the current vertex declaration. * * @return If the D3D9 usage is defined in the current vertex declaration. * */ bool checkUsageInVertexDeclaration(D3DUsageId usage); /** * * Generates a D3D9 shader bytecode source parameter token corresponding with the defined * texture stage operation argument. * * @param arg The texture stage operation argument. * @param constant The texture stage constant color. * @param current The temporary register holding the current color. * @param defaultColor A constant register used for default oclor. * @param tempReg A temporary register corresponding with the texture stages temp register. * @param texture A temporary register holding the stag texture color. * @param textFactorColor A constant register holding the texture factor color. * @param textureFactorDefined A reference to a boolean register that stores if the texture factor * constant was defined. If the constant was not defined the function will define it and set * the variable to true. * @param diffuseDefined Vertex diffuse color output defined. * @param specularDefined Vertex specular color output defined. * * @return A source parameter token corresponding with the defined texture stage operation * argument and parameters. * */ DWORD genSourceTokenForTextureStageArg(u32bit arg, D3DCOLORVALUE constant, D3DRegisterId current, D3DRegisterId defaultColor, D3DRegisterId tempReg, D3DRegisterId texture, D3DRegisterId textFactorColor, bool &textureFactorDefined, bool diffuseDefined, bool specularDefined); /** * * Generates a D3D9 shader bytecode destination parameter token for the corresponding result argument * for the texture stage. * * @param stage The texture stage. * @param current The temporary register that holds the current color. * @param tempReg The temporary register corresponding with texture stages temp register. * @param maskX The write mask for the x component, default 1 (0 -> do not write, 1 -> write). * @param maskY The write mask for the y component, default 1 (0 -> do not write, 1 -> write). * @param maskZ The write mask for the z component, default 1 (0 -> do not write, 1 -> write). * @param maskW The write mask for the w component, default 1 (0 -> do not write, 1 -> write). * * @return A destination parameter token corresponding with the defined texture stage result argument. * */ DWORD genDestTokenForTextureStage(u32bit stage, D3DRegisterId current, D3DRegisterId tempReg, BYTE maskX = 1, BYTE maskY = 1, BYTE maskZ = 1, BYTE maskW = 1); /** * * Generates D3D9 shader bytecode to emulate the texture stage operation. * * @param op The texture stage operation to emulate. * @param arg1 The texture stage first operation argument. * @param arg2 The texture stage second operation argument. * @param arg3 The texture stage third operation argument. * @param sourceToken1 The D3D9 shader bytecode token for the first operation argument. * @param sourceToken2 The D3D9 shader bytecode token for the second operation argument. * @param sourceToken3 The D3D9 shader bytecode token for the third operation argument. * @param destToken The D3D9 shader bytecode token for the result argument. * @param defaultColor A constant register with immediate value. * */ void genCodeForTextureStageOp(D3DTEXTUREOP op, u32bit arg1, u32bit arg2, u32bit arg3, DWORD sourceToken1, DWORD sourceToken2, DWORD sourceToken3, DWORD destToken, D3DRegisterId defaultColor); }; #endif
[ "cooperyuan@gmail.com" ]
cooperyuan@gmail.com
289054069486fa27337569a38fe16913a5e7e4f5
d0fb46aecc3b69983e7f6244331a81dff42d9595
/sgw/include/alibabacloud/sgw/SgwClient.h
3a77876f93e6cb7a9a1290baa749d278f99159a4
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-cpp-sdk
3d8d051d44ad00753a429817dd03957614c0c66a
e862bd03c844bcb7ccaa90571bceaa2802c7f135
refs/heads/master
2023-08-29T11:54:00.525102
2023-08-29T03:32:48
2023-08-29T03:32:48
115,379,460
104
82
NOASSERTION
2023-09-14T06:13:33
2017-12-26T02:53:27
C++
UTF-8
C++
false
false
122,205
h
/* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ALIBABACLOUD_SGW_SGWCLIENT_H_ #define ALIBABACLOUD_SGW_SGWCLIENT_H_ #include <future> #include <alibabacloud/core/AsyncCallerContext.h> #include <alibabacloud/core/EndpointProvider.h> #include <alibabacloud/core/RpcServiceClient.h> #include "SgwExport.h" #include "model/ActivateAllInOneGatewayRequest.h" #include "model/ActivateAllInOneGatewayResult.h" #include "model/ActivateGatewayRequest.h" #include "model/ActivateGatewayResult.h" #include "model/AddSharesToExpressSyncRequest.h" #include "model/AddSharesToExpressSyncResult.h" #include "model/AddTagsToGatewayRequest.h" #include "model/AddTagsToGatewayResult.h" #include "model/CheckActivationKeyRequest.h" #include "model/CheckActivationKeyResult.h" #include "model/CheckBlockVolumeNameRequest.h" #include "model/CheckBlockVolumeNameResult.h" #include "model/CheckGatewayEssdSupportRequest.h" #include "model/CheckGatewayEssdSupportResult.h" #include "model/CheckMnsServiceRequest.h" #include "model/CheckMnsServiceResult.h" #include "model/CheckRoleRequest.h" #include "model/CheckRoleResult.h" #include "model/CheckSlrRoleRequest.h" #include "model/CheckSlrRoleResult.h" #include "model/CheckUpgradeVersionRequest.h" #include "model/CheckUpgradeVersionResult.h" #include "model/CreateCacheRequest.h" #include "model/CreateCacheResult.h" #include "model/CreateElasticGatewayPrivateZoneRequest.h" #include "model/CreateElasticGatewayPrivateZoneResult.h" #include "model/CreateExpressSyncRequest.h" #include "model/CreateExpressSyncResult.h" #include "model/CreateGatewayRequest.h" #include "model/CreateGatewayResult.h" #include "model/CreateGatewayBlockVolumeRequest.h" #include "model/CreateGatewayBlockVolumeResult.h" #include "model/CreateGatewayCacheDiskRequest.h" #include "model/CreateGatewayCacheDiskResult.h" #include "model/CreateGatewayFileShareRequest.h" #include "model/CreateGatewayFileShareResult.h" #include "model/CreateGatewayLoggingRequest.h" #include "model/CreateGatewayLoggingResult.h" #include "model/CreateGatewaySMBUserRequest.h" #include "model/CreateGatewaySMBUserResult.h" #include "model/CreateStorageBundleRequest.h" #include "model/CreateStorageBundleResult.h" #include "model/DeleteCSGClientsRequest.h" #include "model/DeleteCSGClientsResult.h" #include "model/DeleteElasticGatewayPrivateZoneRequest.h" #include "model/DeleteElasticGatewayPrivateZoneResult.h" #include "model/DeleteExpressSyncRequest.h" #include "model/DeleteExpressSyncResult.h" #include "model/DeleteGatewayRequest.h" #include "model/DeleteGatewayResult.h" #include "model/DeleteGatewayBlockVolumesRequest.h" #include "model/DeleteGatewayBlockVolumesResult.h" #include "model/DeleteGatewayCacheDiskRequest.h" #include "model/DeleteGatewayCacheDiskResult.h" #include "model/DeleteGatewayFileSharesRequest.h" #include "model/DeleteGatewayFileSharesResult.h" #include "model/DeleteGatewayLoggingRequest.h" #include "model/DeleteGatewayLoggingResult.h" #include "model/DeleteGatewaySMBUserRequest.h" #include "model/DeleteGatewaySMBUserResult.h" #include "model/DeleteStorageBundleRequest.h" #include "model/DeleteStorageBundleResult.h" #include "model/DeployCSGClientsRequest.h" #include "model/DeployCSGClientsResult.h" #include "model/DeployCacheDiskRequest.h" #include "model/DeployCacheDiskResult.h" #include "model/DeployGatewayRequest.h" #include "model/DeployGatewayResult.h" #include "model/DescribeAccountConfigRequest.h" #include "model/DescribeAccountConfigResult.h" #include "model/DescribeBlockVolumeSnapshotsRequest.h" #include "model/DescribeBlockVolumeSnapshotsResult.h" #include "model/DescribeCSGClientTasksRequest.h" #include "model/DescribeCSGClientTasksResult.h" #include "model/DescribeCSGClientsRequest.h" #include "model/DescribeCSGClientsResult.h" #include "model/DescribeDashboardRequest.h" #include "model/DescribeDashboardResult.h" #include "model/DescribeExpireCachesRequest.h" #include "model/DescribeExpireCachesResult.h" #include "model/DescribeExpressSyncSharesRequest.h" #include "model/DescribeExpressSyncSharesResult.h" #include "model/DescribeExpressSyncsRequest.h" #include "model/DescribeExpressSyncsResult.h" #include "model/DescribeGatewayRequest.h" #include "model/DescribeGatewayResult.h" #include "model/DescribeGatewayADInfoRequest.h" #include "model/DescribeGatewayADInfoResult.h" #include "model/DescribeGatewayActionsRequest.h" #include "model/DescribeGatewayActionsResult.h" #include "model/DescribeGatewayAuthInfoRequest.h" #include "model/DescribeGatewayAuthInfoResult.h" #include "model/DescribeGatewayBlockVolumesRequest.h" #include "model/DescribeGatewayBlockVolumesResult.h" #include "model/DescribeGatewayBucketCachesRequest.h" #include "model/DescribeGatewayBucketCachesResult.h" #include "model/DescribeGatewayCachesRequest.h" #include "model/DescribeGatewayCachesResult.h" #include "model/DescribeGatewayCapacityLimitRequest.h" #include "model/DescribeGatewayCapacityLimitResult.h" #include "model/DescribeGatewayCategoriesRequest.h" #include "model/DescribeGatewayCategoriesResult.h" #include "model/DescribeGatewayClassesRequest.h" #include "model/DescribeGatewayClassesResult.h" #include "model/DescribeGatewayCredentialRequest.h" #include "model/DescribeGatewayCredentialResult.h" #include "model/DescribeGatewayDNSRequest.h" #include "model/DescribeGatewayDNSResult.h" #include "model/DescribeGatewayFileSharesRequest.h" #include "model/DescribeGatewayFileSharesResult.h" #include "model/DescribeGatewayFileStatusRequest.h" #include "model/DescribeGatewayFileStatusResult.h" #include "model/DescribeGatewayImagesRequest.h" #include "model/DescribeGatewayImagesResult.h" #include "model/DescribeGatewayInfoRequest.h" #include "model/DescribeGatewayInfoResult.h" #include "model/DescribeGatewayLDAPInfoRequest.h" #include "model/DescribeGatewayLDAPInfoResult.h" #include "model/DescribeGatewayLocationsRequest.h" #include "model/DescribeGatewayLocationsResult.h" #include "model/DescribeGatewayLoggingRequest.h" #include "model/DescribeGatewayLoggingResult.h" #include "model/DescribeGatewayLogsRequest.h" #include "model/DescribeGatewayLogsResult.h" #include "model/DescribeGatewayModificationClassesRequest.h" #include "model/DescribeGatewayModificationClassesResult.h" #include "model/DescribeGatewayNFSClientsRequest.h" #include "model/DescribeGatewayNFSClientsResult.h" #include "model/DescribeGatewaySMBUsersRequest.h" #include "model/DescribeGatewaySMBUsersResult.h" #include "model/DescribeGatewayStatisticsRequest.h" #include "model/DescribeGatewayStatisticsResult.h" #include "model/DescribeGatewayStockRequest.h" #include "model/DescribeGatewayStockResult.h" #include "model/DescribeGatewayTypesRequest.h" #include "model/DescribeGatewayTypesResult.h" #include "model/DescribeGatewaysRequest.h" #include "model/DescribeGatewaysResult.h" #include "model/DescribeGatewaysForCmsRequest.h" #include "model/DescribeGatewaysForCmsResult.h" #include "model/DescribeGatewaysTagsRequest.h" #include "model/DescribeGatewaysTagsResult.h" #include "model/DescribeKmsKeyRequest.h" #include "model/DescribeKmsKeyResult.h" #include "model/DescribeMqttConfigRequest.h" #include "model/DescribeMqttConfigResult.h" #include "model/DescribeOssBucketInfoRequest.h" #include "model/DescribeOssBucketInfoResult.h" #include "model/DescribeOssBucketsRequest.h" #include "model/DescribeOssBucketsResult.h" #include "model/DescribePayAsYouGoPriceRequest.h" #include "model/DescribePayAsYouGoPriceResult.h" #include "model/DescribeRegionsRequest.h" #include "model/DescribeRegionsResult.h" #include "model/DescribeSharesBucketInfoForExpressSyncRequest.h" #include "model/DescribeSharesBucketInfoForExpressSyncResult.h" #include "model/DescribeStorageBundleRequest.h" #include "model/DescribeStorageBundleResult.h" #include "model/DescribeStorageBundlesRequest.h" #include "model/DescribeStorageBundlesResult.h" #include "model/DescribeSubscriptionPriceRequest.h" #include "model/DescribeSubscriptionPriceResult.h" #include "model/DescribeTasksRequest.h" #include "model/DescribeTasksResult.h" #include "model/DescribeUserBusinessStatusRequest.h" #include "model/DescribeUserBusinessStatusResult.h" #include "model/DescribeVSwitchesRequest.h" #include "model/DescribeVSwitchesResult.h" #include "model/DescribeVpcsRequest.h" #include "model/DescribeVpcsResult.h" #include "model/DescribeZonesRequest.h" #include "model/DescribeZonesResult.h" #include "model/DisableGatewayLoggingRequest.h" #include "model/DisableGatewayLoggingResult.h" #include "model/DisableGatewayNFSVersionRequest.h" #include "model/DisableGatewayNFSVersionResult.h" #include "model/EnableGatewayIpv6Request.h" #include "model/EnableGatewayIpv6Result.h" #include "model/EnableGatewayLoggingRequest.h" #include "model/EnableGatewayLoggingResult.h" #include "model/ExpandCacheDiskRequest.h" #include "model/ExpandCacheDiskResult.h" #include "model/ExpandGatewayNetworkBandwidthRequest.h" #include "model/ExpandGatewayNetworkBandwidthResult.h" #include "model/GenerateGatewayTokenRequest.h" #include "model/GenerateGatewayTokenResult.h" #include "model/GenerateMqttTokenRequest.h" #include "model/GenerateMqttTokenResult.h" #include "model/GenerateStsTokenRequest.h" #include "model/GenerateStsTokenResult.h" #include "model/ListTagResourcesRequest.h" #include "model/ListTagResourcesResult.h" #include "model/ModifyGatewayRequest.h" #include "model/ModifyGatewayResult.h" #include "model/ModifyGatewayBlockVolumeRequest.h" #include "model/ModifyGatewayBlockVolumeResult.h" #include "model/ModifyGatewayClassRequest.h" #include "model/ModifyGatewayClassResult.h" #include "model/ModifyGatewayFileShareRequest.h" #include "model/ModifyGatewayFileShareResult.h" #include "model/ModifyGatewayFileShareWatermarkRequest.h" #include "model/ModifyGatewayFileShareWatermarkResult.h" #include "model/ModifyStorageBundleRequest.h" #include "model/ModifyStorageBundleResult.h" #include "model/OpenSgwServiceRequest.h" #include "model/OpenSgwServiceResult.h" #include "model/OperateGatewayRequest.h" #include "model/OperateGatewayResult.h" #include "model/ReleaseServiceRequest.h" #include "model/ReleaseServiceResult.h" #include "model/RemoveSharesFromExpressSyncRequest.h" #include "model/RemoveSharesFromExpressSyncResult.h" #include "model/RemoveTagsFromGatewayRequest.h" #include "model/RemoveTagsFromGatewayResult.h" #include "model/ReportBlockVolumesRequest.h" #include "model/ReportBlockVolumesResult.h" #include "model/ReportFileSharesRequest.h" #include "model/ReportFileSharesResult.h" #include "model/ReportGatewayInfoRequest.h" #include "model/ReportGatewayInfoResult.h" #include "model/ReportGatewayUsageRequest.h" #include "model/ReportGatewayUsageResult.h" #include "model/ResetGatewayPasswordRequest.h" #include "model/ResetGatewayPasswordResult.h" #include "model/RestartFileSharesRequest.h" #include "model/RestartFileSharesResult.h" #include "model/SetGatewayADInfoRequest.h" #include "model/SetGatewayADInfoResult.h" #include "model/SetGatewayDNSRequest.h" #include "model/SetGatewayDNSResult.h" #include "model/SetGatewayLDAPInfoRequest.h" #include "model/SetGatewayLDAPInfoResult.h" #include "model/SwitchCSGClientsReverseSyncConfigurationRequest.h" #include "model/SwitchCSGClientsReverseSyncConfigurationResult.h" #include "model/SwitchGatewayExpirationPolicyRequest.h" #include "model/SwitchGatewayExpirationPolicyResult.h" #include "model/SwitchToSubscriptionRequest.h" #include "model/SwitchToSubscriptionResult.h" #include "model/TagResourcesRequest.h" #include "model/TagResourcesResult.h" #include "model/TriggerGatewayRemoteSyncRequest.h" #include "model/TriggerGatewayRemoteSyncResult.h" #include "model/UntagResourcesRequest.h" #include "model/UntagResourcesResult.h" #include "model/UpdateGatewayBlockVolumeRequest.h" #include "model/UpdateGatewayBlockVolumeResult.h" #include "model/UpdateGatewayFileShareRequest.h" #include "model/UpdateGatewayFileShareResult.h" #include "model/UpgradeGatewayRequest.h" #include "model/UpgradeGatewayResult.h" #include "model/UploadCSGClientLogRequest.h" #include "model/UploadCSGClientLogResult.h" #include "model/UploadGatewayLogRequest.h" #include "model/UploadGatewayLogResult.h" #include "model/ValidateExpressSyncConfigRequest.h" #include "model/ValidateExpressSyncConfigResult.h" #include "model/ValidateGatewayNameRequest.h" #include "model/ValidateGatewayNameResult.h" namespace AlibabaCloud { namespace Sgw { class ALIBABACLOUD_SGW_EXPORT SgwClient : public RpcServiceClient { public: typedef Outcome<Error, Model::ActivateAllInOneGatewayResult> ActivateAllInOneGatewayOutcome; typedef std::future<ActivateAllInOneGatewayOutcome> ActivateAllInOneGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ActivateAllInOneGatewayRequest&, const ActivateAllInOneGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ActivateAllInOneGatewayAsyncHandler; typedef Outcome<Error, Model::ActivateGatewayResult> ActivateGatewayOutcome; typedef std::future<ActivateGatewayOutcome> ActivateGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ActivateGatewayRequest&, const ActivateGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ActivateGatewayAsyncHandler; typedef Outcome<Error, Model::AddSharesToExpressSyncResult> AddSharesToExpressSyncOutcome; typedef std::future<AddSharesToExpressSyncOutcome> AddSharesToExpressSyncOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::AddSharesToExpressSyncRequest&, const AddSharesToExpressSyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AddSharesToExpressSyncAsyncHandler; typedef Outcome<Error, Model::AddTagsToGatewayResult> AddTagsToGatewayOutcome; typedef std::future<AddTagsToGatewayOutcome> AddTagsToGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::AddTagsToGatewayRequest&, const AddTagsToGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AddTagsToGatewayAsyncHandler; typedef Outcome<Error, Model::CheckActivationKeyResult> CheckActivationKeyOutcome; typedef std::future<CheckActivationKeyOutcome> CheckActivationKeyOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckActivationKeyRequest&, const CheckActivationKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckActivationKeyAsyncHandler; typedef Outcome<Error, Model::CheckBlockVolumeNameResult> CheckBlockVolumeNameOutcome; typedef std::future<CheckBlockVolumeNameOutcome> CheckBlockVolumeNameOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckBlockVolumeNameRequest&, const CheckBlockVolumeNameOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckBlockVolumeNameAsyncHandler; typedef Outcome<Error, Model::CheckGatewayEssdSupportResult> CheckGatewayEssdSupportOutcome; typedef std::future<CheckGatewayEssdSupportOutcome> CheckGatewayEssdSupportOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckGatewayEssdSupportRequest&, const CheckGatewayEssdSupportOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckGatewayEssdSupportAsyncHandler; typedef Outcome<Error, Model::CheckMnsServiceResult> CheckMnsServiceOutcome; typedef std::future<CheckMnsServiceOutcome> CheckMnsServiceOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckMnsServiceRequest&, const CheckMnsServiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckMnsServiceAsyncHandler; typedef Outcome<Error, Model::CheckRoleResult> CheckRoleOutcome; typedef std::future<CheckRoleOutcome> CheckRoleOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckRoleRequest&, const CheckRoleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckRoleAsyncHandler; typedef Outcome<Error, Model::CheckSlrRoleResult> CheckSlrRoleOutcome; typedef std::future<CheckSlrRoleOutcome> CheckSlrRoleOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckSlrRoleRequest&, const CheckSlrRoleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckSlrRoleAsyncHandler; typedef Outcome<Error, Model::CheckUpgradeVersionResult> CheckUpgradeVersionOutcome; typedef std::future<CheckUpgradeVersionOutcome> CheckUpgradeVersionOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CheckUpgradeVersionRequest&, const CheckUpgradeVersionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckUpgradeVersionAsyncHandler; typedef Outcome<Error, Model::CreateCacheResult> CreateCacheOutcome; typedef std::future<CreateCacheOutcome> CreateCacheOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateCacheRequest&, const CreateCacheOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateCacheAsyncHandler; typedef Outcome<Error, Model::CreateElasticGatewayPrivateZoneResult> CreateElasticGatewayPrivateZoneOutcome; typedef std::future<CreateElasticGatewayPrivateZoneOutcome> CreateElasticGatewayPrivateZoneOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateElasticGatewayPrivateZoneRequest&, const CreateElasticGatewayPrivateZoneOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateElasticGatewayPrivateZoneAsyncHandler; typedef Outcome<Error, Model::CreateExpressSyncResult> CreateExpressSyncOutcome; typedef std::future<CreateExpressSyncOutcome> CreateExpressSyncOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateExpressSyncRequest&, const CreateExpressSyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateExpressSyncAsyncHandler; typedef Outcome<Error, Model::CreateGatewayResult> CreateGatewayOutcome; typedef std::future<CreateGatewayOutcome> CreateGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateGatewayRequest&, const CreateGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGatewayAsyncHandler; typedef Outcome<Error, Model::CreateGatewayBlockVolumeResult> CreateGatewayBlockVolumeOutcome; typedef std::future<CreateGatewayBlockVolumeOutcome> CreateGatewayBlockVolumeOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateGatewayBlockVolumeRequest&, const CreateGatewayBlockVolumeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGatewayBlockVolumeAsyncHandler; typedef Outcome<Error, Model::CreateGatewayCacheDiskResult> CreateGatewayCacheDiskOutcome; typedef std::future<CreateGatewayCacheDiskOutcome> CreateGatewayCacheDiskOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateGatewayCacheDiskRequest&, const CreateGatewayCacheDiskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGatewayCacheDiskAsyncHandler; typedef Outcome<Error, Model::CreateGatewayFileShareResult> CreateGatewayFileShareOutcome; typedef std::future<CreateGatewayFileShareOutcome> CreateGatewayFileShareOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateGatewayFileShareRequest&, const CreateGatewayFileShareOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGatewayFileShareAsyncHandler; typedef Outcome<Error, Model::CreateGatewayLoggingResult> CreateGatewayLoggingOutcome; typedef std::future<CreateGatewayLoggingOutcome> CreateGatewayLoggingOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateGatewayLoggingRequest&, const CreateGatewayLoggingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGatewayLoggingAsyncHandler; typedef Outcome<Error, Model::CreateGatewaySMBUserResult> CreateGatewaySMBUserOutcome; typedef std::future<CreateGatewaySMBUserOutcome> CreateGatewaySMBUserOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateGatewaySMBUserRequest&, const CreateGatewaySMBUserOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGatewaySMBUserAsyncHandler; typedef Outcome<Error, Model::CreateStorageBundleResult> CreateStorageBundleOutcome; typedef std::future<CreateStorageBundleOutcome> CreateStorageBundleOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::CreateStorageBundleRequest&, const CreateStorageBundleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateStorageBundleAsyncHandler; typedef Outcome<Error, Model::DeleteCSGClientsResult> DeleteCSGClientsOutcome; typedef std::future<DeleteCSGClientsOutcome> DeleteCSGClientsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteCSGClientsRequest&, const DeleteCSGClientsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteCSGClientsAsyncHandler; typedef Outcome<Error, Model::DeleteElasticGatewayPrivateZoneResult> DeleteElasticGatewayPrivateZoneOutcome; typedef std::future<DeleteElasticGatewayPrivateZoneOutcome> DeleteElasticGatewayPrivateZoneOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteElasticGatewayPrivateZoneRequest&, const DeleteElasticGatewayPrivateZoneOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteElasticGatewayPrivateZoneAsyncHandler; typedef Outcome<Error, Model::DeleteExpressSyncResult> DeleteExpressSyncOutcome; typedef std::future<DeleteExpressSyncOutcome> DeleteExpressSyncOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteExpressSyncRequest&, const DeleteExpressSyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteExpressSyncAsyncHandler; typedef Outcome<Error, Model::DeleteGatewayResult> DeleteGatewayOutcome; typedef std::future<DeleteGatewayOutcome> DeleteGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteGatewayRequest&, const DeleteGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGatewayAsyncHandler; typedef Outcome<Error, Model::DeleteGatewayBlockVolumesResult> DeleteGatewayBlockVolumesOutcome; typedef std::future<DeleteGatewayBlockVolumesOutcome> DeleteGatewayBlockVolumesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteGatewayBlockVolumesRequest&, const DeleteGatewayBlockVolumesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGatewayBlockVolumesAsyncHandler; typedef Outcome<Error, Model::DeleteGatewayCacheDiskResult> DeleteGatewayCacheDiskOutcome; typedef std::future<DeleteGatewayCacheDiskOutcome> DeleteGatewayCacheDiskOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteGatewayCacheDiskRequest&, const DeleteGatewayCacheDiskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGatewayCacheDiskAsyncHandler; typedef Outcome<Error, Model::DeleteGatewayFileSharesResult> DeleteGatewayFileSharesOutcome; typedef std::future<DeleteGatewayFileSharesOutcome> DeleteGatewayFileSharesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteGatewayFileSharesRequest&, const DeleteGatewayFileSharesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGatewayFileSharesAsyncHandler; typedef Outcome<Error, Model::DeleteGatewayLoggingResult> DeleteGatewayLoggingOutcome; typedef std::future<DeleteGatewayLoggingOutcome> DeleteGatewayLoggingOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteGatewayLoggingRequest&, const DeleteGatewayLoggingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGatewayLoggingAsyncHandler; typedef Outcome<Error, Model::DeleteGatewaySMBUserResult> DeleteGatewaySMBUserOutcome; typedef std::future<DeleteGatewaySMBUserOutcome> DeleteGatewaySMBUserOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteGatewaySMBUserRequest&, const DeleteGatewaySMBUserOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteGatewaySMBUserAsyncHandler; typedef Outcome<Error, Model::DeleteStorageBundleResult> DeleteStorageBundleOutcome; typedef std::future<DeleteStorageBundleOutcome> DeleteStorageBundleOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeleteStorageBundleRequest&, const DeleteStorageBundleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteStorageBundleAsyncHandler; typedef Outcome<Error, Model::DeployCSGClientsResult> DeployCSGClientsOutcome; typedef std::future<DeployCSGClientsOutcome> DeployCSGClientsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeployCSGClientsRequest&, const DeployCSGClientsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeployCSGClientsAsyncHandler; typedef Outcome<Error, Model::DeployCacheDiskResult> DeployCacheDiskOutcome; typedef std::future<DeployCacheDiskOutcome> DeployCacheDiskOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeployCacheDiskRequest&, const DeployCacheDiskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeployCacheDiskAsyncHandler; typedef Outcome<Error, Model::DeployGatewayResult> DeployGatewayOutcome; typedef std::future<DeployGatewayOutcome> DeployGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DeployGatewayRequest&, const DeployGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeployGatewayAsyncHandler; typedef Outcome<Error, Model::DescribeAccountConfigResult> DescribeAccountConfigOutcome; typedef std::future<DescribeAccountConfigOutcome> DescribeAccountConfigOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeAccountConfigRequest&, const DescribeAccountConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeAccountConfigAsyncHandler; typedef Outcome<Error, Model::DescribeBlockVolumeSnapshotsResult> DescribeBlockVolumeSnapshotsOutcome; typedef std::future<DescribeBlockVolumeSnapshotsOutcome> DescribeBlockVolumeSnapshotsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeBlockVolumeSnapshotsRequest&, const DescribeBlockVolumeSnapshotsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeBlockVolumeSnapshotsAsyncHandler; typedef Outcome<Error, Model::DescribeCSGClientTasksResult> DescribeCSGClientTasksOutcome; typedef std::future<DescribeCSGClientTasksOutcome> DescribeCSGClientTasksOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeCSGClientTasksRequest&, const DescribeCSGClientTasksOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeCSGClientTasksAsyncHandler; typedef Outcome<Error, Model::DescribeCSGClientsResult> DescribeCSGClientsOutcome; typedef std::future<DescribeCSGClientsOutcome> DescribeCSGClientsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeCSGClientsRequest&, const DescribeCSGClientsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeCSGClientsAsyncHandler; typedef Outcome<Error, Model::DescribeDashboardResult> DescribeDashboardOutcome; typedef std::future<DescribeDashboardOutcome> DescribeDashboardOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeDashboardRequest&, const DescribeDashboardOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeDashboardAsyncHandler; typedef Outcome<Error, Model::DescribeExpireCachesResult> DescribeExpireCachesOutcome; typedef std::future<DescribeExpireCachesOutcome> DescribeExpireCachesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeExpireCachesRequest&, const DescribeExpireCachesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeExpireCachesAsyncHandler; typedef Outcome<Error, Model::DescribeExpressSyncSharesResult> DescribeExpressSyncSharesOutcome; typedef std::future<DescribeExpressSyncSharesOutcome> DescribeExpressSyncSharesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeExpressSyncSharesRequest&, const DescribeExpressSyncSharesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeExpressSyncSharesAsyncHandler; typedef Outcome<Error, Model::DescribeExpressSyncsResult> DescribeExpressSyncsOutcome; typedef std::future<DescribeExpressSyncsOutcome> DescribeExpressSyncsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeExpressSyncsRequest&, const DescribeExpressSyncsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeExpressSyncsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayResult> DescribeGatewayOutcome; typedef std::future<DescribeGatewayOutcome> DescribeGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayRequest&, const DescribeGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayADInfoResult> DescribeGatewayADInfoOutcome; typedef std::future<DescribeGatewayADInfoOutcome> DescribeGatewayADInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayADInfoRequest&, const DescribeGatewayADInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayADInfoAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayActionsResult> DescribeGatewayActionsOutcome; typedef std::future<DescribeGatewayActionsOutcome> DescribeGatewayActionsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayActionsRequest&, const DescribeGatewayActionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayActionsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayAuthInfoResult> DescribeGatewayAuthInfoOutcome; typedef std::future<DescribeGatewayAuthInfoOutcome> DescribeGatewayAuthInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayAuthInfoRequest&, const DescribeGatewayAuthInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayAuthInfoAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayBlockVolumesResult> DescribeGatewayBlockVolumesOutcome; typedef std::future<DescribeGatewayBlockVolumesOutcome> DescribeGatewayBlockVolumesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayBlockVolumesRequest&, const DescribeGatewayBlockVolumesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayBlockVolumesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayBucketCachesResult> DescribeGatewayBucketCachesOutcome; typedef std::future<DescribeGatewayBucketCachesOutcome> DescribeGatewayBucketCachesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayBucketCachesRequest&, const DescribeGatewayBucketCachesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayBucketCachesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayCachesResult> DescribeGatewayCachesOutcome; typedef std::future<DescribeGatewayCachesOutcome> DescribeGatewayCachesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayCachesRequest&, const DescribeGatewayCachesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayCachesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayCapacityLimitResult> DescribeGatewayCapacityLimitOutcome; typedef std::future<DescribeGatewayCapacityLimitOutcome> DescribeGatewayCapacityLimitOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayCapacityLimitRequest&, const DescribeGatewayCapacityLimitOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayCapacityLimitAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayCategoriesResult> DescribeGatewayCategoriesOutcome; typedef std::future<DescribeGatewayCategoriesOutcome> DescribeGatewayCategoriesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayCategoriesRequest&, const DescribeGatewayCategoriesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayCategoriesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayClassesResult> DescribeGatewayClassesOutcome; typedef std::future<DescribeGatewayClassesOutcome> DescribeGatewayClassesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayClassesRequest&, const DescribeGatewayClassesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayClassesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayCredentialResult> DescribeGatewayCredentialOutcome; typedef std::future<DescribeGatewayCredentialOutcome> DescribeGatewayCredentialOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayCredentialRequest&, const DescribeGatewayCredentialOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayCredentialAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayDNSResult> DescribeGatewayDNSOutcome; typedef std::future<DescribeGatewayDNSOutcome> DescribeGatewayDNSOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayDNSRequest&, const DescribeGatewayDNSOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayDNSAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayFileSharesResult> DescribeGatewayFileSharesOutcome; typedef std::future<DescribeGatewayFileSharesOutcome> DescribeGatewayFileSharesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayFileSharesRequest&, const DescribeGatewayFileSharesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayFileSharesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayFileStatusResult> DescribeGatewayFileStatusOutcome; typedef std::future<DescribeGatewayFileStatusOutcome> DescribeGatewayFileStatusOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayFileStatusRequest&, const DescribeGatewayFileStatusOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayFileStatusAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayImagesResult> DescribeGatewayImagesOutcome; typedef std::future<DescribeGatewayImagesOutcome> DescribeGatewayImagesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayImagesRequest&, const DescribeGatewayImagesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayImagesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayInfoResult> DescribeGatewayInfoOutcome; typedef std::future<DescribeGatewayInfoOutcome> DescribeGatewayInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayInfoRequest&, const DescribeGatewayInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayInfoAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayLDAPInfoResult> DescribeGatewayLDAPInfoOutcome; typedef std::future<DescribeGatewayLDAPInfoOutcome> DescribeGatewayLDAPInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayLDAPInfoRequest&, const DescribeGatewayLDAPInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayLDAPInfoAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayLocationsResult> DescribeGatewayLocationsOutcome; typedef std::future<DescribeGatewayLocationsOutcome> DescribeGatewayLocationsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayLocationsRequest&, const DescribeGatewayLocationsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayLocationsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayLoggingResult> DescribeGatewayLoggingOutcome; typedef std::future<DescribeGatewayLoggingOutcome> DescribeGatewayLoggingOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayLoggingRequest&, const DescribeGatewayLoggingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayLoggingAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayLogsResult> DescribeGatewayLogsOutcome; typedef std::future<DescribeGatewayLogsOutcome> DescribeGatewayLogsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayLogsRequest&, const DescribeGatewayLogsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayLogsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayModificationClassesResult> DescribeGatewayModificationClassesOutcome; typedef std::future<DescribeGatewayModificationClassesOutcome> DescribeGatewayModificationClassesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayModificationClassesRequest&, const DescribeGatewayModificationClassesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayModificationClassesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayNFSClientsResult> DescribeGatewayNFSClientsOutcome; typedef std::future<DescribeGatewayNFSClientsOutcome> DescribeGatewayNFSClientsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayNFSClientsRequest&, const DescribeGatewayNFSClientsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayNFSClientsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewaySMBUsersResult> DescribeGatewaySMBUsersOutcome; typedef std::future<DescribeGatewaySMBUsersOutcome> DescribeGatewaySMBUsersOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewaySMBUsersRequest&, const DescribeGatewaySMBUsersOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewaySMBUsersAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayStatisticsResult> DescribeGatewayStatisticsOutcome; typedef std::future<DescribeGatewayStatisticsOutcome> DescribeGatewayStatisticsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayStatisticsRequest&, const DescribeGatewayStatisticsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayStatisticsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayStockResult> DescribeGatewayStockOutcome; typedef std::future<DescribeGatewayStockOutcome> DescribeGatewayStockOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayStockRequest&, const DescribeGatewayStockOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayStockAsyncHandler; typedef Outcome<Error, Model::DescribeGatewayTypesResult> DescribeGatewayTypesOutcome; typedef std::future<DescribeGatewayTypesOutcome> DescribeGatewayTypesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewayTypesRequest&, const DescribeGatewayTypesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewayTypesAsyncHandler; typedef Outcome<Error, Model::DescribeGatewaysResult> DescribeGatewaysOutcome; typedef std::future<DescribeGatewaysOutcome> DescribeGatewaysOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewaysRequest&, const DescribeGatewaysOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewaysAsyncHandler; typedef Outcome<Error, Model::DescribeGatewaysForCmsResult> DescribeGatewaysForCmsOutcome; typedef std::future<DescribeGatewaysForCmsOutcome> DescribeGatewaysForCmsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewaysForCmsRequest&, const DescribeGatewaysForCmsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewaysForCmsAsyncHandler; typedef Outcome<Error, Model::DescribeGatewaysTagsResult> DescribeGatewaysTagsOutcome; typedef std::future<DescribeGatewaysTagsOutcome> DescribeGatewaysTagsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeGatewaysTagsRequest&, const DescribeGatewaysTagsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeGatewaysTagsAsyncHandler; typedef Outcome<Error, Model::DescribeKmsKeyResult> DescribeKmsKeyOutcome; typedef std::future<DescribeKmsKeyOutcome> DescribeKmsKeyOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeKmsKeyRequest&, const DescribeKmsKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeKmsKeyAsyncHandler; typedef Outcome<Error, Model::DescribeMqttConfigResult> DescribeMqttConfigOutcome; typedef std::future<DescribeMqttConfigOutcome> DescribeMqttConfigOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeMqttConfigRequest&, const DescribeMqttConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeMqttConfigAsyncHandler; typedef Outcome<Error, Model::DescribeOssBucketInfoResult> DescribeOssBucketInfoOutcome; typedef std::future<DescribeOssBucketInfoOutcome> DescribeOssBucketInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeOssBucketInfoRequest&, const DescribeOssBucketInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeOssBucketInfoAsyncHandler; typedef Outcome<Error, Model::DescribeOssBucketsResult> DescribeOssBucketsOutcome; typedef std::future<DescribeOssBucketsOutcome> DescribeOssBucketsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeOssBucketsRequest&, const DescribeOssBucketsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeOssBucketsAsyncHandler; typedef Outcome<Error, Model::DescribePayAsYouGoPriceResult> DescribePayAsYouGoPriceOutcome; typedef std::future<DescribePayAsYouGoPriceOutcome> DescribePayAsYouGoPriceOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribePayAsYouGoPriceRequest&, const DescribePayAsYouGoPriceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribePayAsYouGoPriceAsyncHandler; typedef Outcome<Error, Model::DescribeRegionsResult> DescribeRegionsOutcome; typedef std::future<DescribeRegionsOutcome> DescribeRegionsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeRegionsRequest&, const DescribeRegionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRegionsAsyncHandler; typedef Outcome<Error, Model::DescribeSharesBucketInfoForExpressSyncResult> DescribeSharesBucketInfoForExpressSyncOutcome; typedef std::future<DescribeSharesBucketInfoForExpressSyncOutcome> DescribeSharesBucketInfoForExpressSyncOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeSharesBucketInfoForExpressSyncRequest&, const DescribeSharesBucketInfoForExpressSyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeSharesBucketInfoForExpressSyncAsyncHandler; typedef Outcome<Error, Model::DescribeStorageBundleResult> DescribeStorageBundleOutcome; typedef std::future<DescribeStorageBundleOutcome> DescribeStorageBundleOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeStorageBundleRequest&, const DescribeStorageBundleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeStorageBundleAsyncHandler; typedef Outcome<Error, Model::DescribeStorageBundlesResult> DescribeStorageBundlesOutcome; typedef std::future<DescribeStorageBundlesOutcome> DescribeStorageBundlesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeStorageBundlesRequest&, const DescribeStorageBundlesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeStorageBundlesAsyncHandler; typedef Outcome<Error, Model::DescribeSubscriptionPriceResult> DescribeSubscriptionPriceOutcome; typedef std::future<DescribeSubscriptionPriceOutcome> DescribeSubscriptionPriceOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeSubscriptionPriceRequest&, const DescribeSubscriptionPriceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeSubscriptionPriceAsyncHandler; typedef Outcome<Error, Model::DescribeTasksResult> DescribeTasksOutcome; typedef std::future<DescribeTasksOutcome> DescribeTasksOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeTasksRequest&, const DescribeTasksOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeTasksAsyncHandler; typedef Outcome<Error, Model::DescribeUserBusinessStatusResult> DescribeUserBusinessStatusOutcome; typedef std::future<DescribeUserBusinessStatusOutcome> DescribeUserBusinessStatusOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeUserBusinessStatusRequest&, const DescribeUserBusinessStatusOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeUserBusinessStatusAsyncHandler; typedef Outcome<Error, Model::DescribeVSwitchesResult> DescribeVSwitchesOutcome; typedef std::future<DescribeVSwitchesOutcome> DescribeVSwitchesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeVSwitchesRequest&, const DescribeVSwitchesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeVSwitchesAsyncHandler; typedef Outcome<Error, Model::DescribeVpcsResult> DescribeVpcsOutcome; typedef std::future<DescribeVpcsOutcome> DescribeVpcsOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeVpcsRequest&, const DescribeVpcsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeVpcsAsyncHandler; typedef Outcome<Error, Model::DescribeZonesResult> DescribeZonesOutcome; typedef std::future<DescribeZonesOutcome> DescribeZonesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DescribeZonesRequest&, const DescribeZonesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeZonesAsyncHandler; typedef Outcome<Error, Model::DisableGatewayLoggingResult> DisableGatewayLoggingOutcome; typedef std::future<DisableGatewayLoggingOutcome> DisableGatewayLoggingOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DisableGatewayLoggingRequest&, const DisableGatewayLoggingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DisableGatewayLoggingAsyncHandler; typedef Outcome<Error, Model::DisableGatewayNFSVersionResult> DisableGatewayNFSVersionOutcome; typedef std::future<DisableGatewayNFSVersionOutcome> DisableGatewayNFSVersionOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::DisableGatewayNFSVersionRequest&, const DisableGatewayNFSVersionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DisableGatewayNFSVersionAsyncHandler; typedef Outcome<Error, Model::EnableGatewayIpv6Result> EnableGatewayIpv6Outcome; typedef std::future<EnableGatewayIpv6Outcome> EnableGatewayIpv6OutcomeCallable; typedef std::function<void(const SgwClient*, const Model::EnableGatewayIpv6Request&, const EnableGatewayIpv6Outcome&, const std::shared_ptr<const AsyncCallerContext>&)> EnableGatewayIpv6AsyncHandler; typedef Outcome<Error, Model::EnableGatewayLoggingResult> EnableGatewayLoggingOutcome; typedef std::future<EnableGatewayLoggingOutcome> EnableGatewayLoggingOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::EnableGatewayLoggingRequest&, const EnableGatewayLoggingOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EnableGatewayLoggingAsyncHandler; typedef Outcome<Error, Model::ExpandCacheDiskResult> ExpandCacheDiskOutcome; typedef std::future<ExpandCacheDiskOutcome> ExpandCacheDiskOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ExpandCacheDiskRequest&, const ExpandCacheDiskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ExpandCacheDiskAsyncHandler; typedef Outcome<Error, Model::ExpandGatewayNetworkBandwidthResult> ExpandGatewayNetworkBandwidthOutcome; typedef std::future<ExpandGatewayNetworkBandwidthOutcome> ExpandGatewayNetworkBandwidthOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ExpandGatewayNetworkBandwidthRequest&, const ExpandGatewayNetworkBandwidthOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ExpandGatewayNetworkBandwidthAsyncHandler; typedef Outcome<Error, Model::GenerateGatewayTokenResult> GenerateGatewayTokenOutcome; typedef std::future<GenerateGatewayTokenOutcome> GenerateGatewayTokenOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::GenerateGatewayTokenRequest&, const GenerateGatewayTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateGatewayTokenAsyncHandler; typedef Outcome<Error, Model::GenerateMqttTokenResult> GenerateMqttTokenOutcome; typedef std::future<GenerateMqttTokenOutcome> GenerateMqttTokenOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::GenerateMqttTokenRequest&, const GenerateMqttTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateMqttTokenAsyncHandler; typedef Outcome<Error, Model::GenerateStsTokenResult> GenerateStsTokenOutcome; typedef std::future<GenerateStsTokenOutcome> GenerateStsTokenOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::GenerateStsTokenRequest&, const GenerateStsTokenOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenerateStsTokenAsyncHandler; typedef Outcome<Error, Model::ListTagResourcesResult> ListTagResourcesOutcome; typedef std::future<ListTagResourcesOutcome> ListTagResourcesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ListTagResourcesRequest&, const ListTagResourcesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListTagResourcesAsyncHandler; typedef Outcome<Error, Model::ModifyGatewayResult> ModifyGatewayOutcome; typedef std::future<ModifyGatewayOutcome> ModifyGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ModifyGatewayRequest&, const ModifyGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyGatewayAsyncHandler; typedef Outcome<Error, Model::ModifyGatewayBlockVolumeResult> ModifyGatewayBlockVolumeOutcome; typedef std::future<ModifyGatewayBlockVolumeOutcome> ModifyGatewayBlockVolumeOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ModifyGatewayBlockVolumeRequest&, const ModifyGatewayBlockVolumeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyGatewayBlockVolumeAsyncHandler; typedef Outcome<Error, Model::ModifyGatewayClassResult> ModifyGatewayClassOutcome; typedef std::future<ModifyGatewayClassOutcome> ModifyGatewayClassOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ModifyGatewayClassRequest&, const ModifyGatewayClassOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyGatewayClassAsyncHandler; typedef Outcome<Error, Model::ModifyGatewayFileShareResult> ModifyGatewayFileShareOutcome; typedef std::future<ModifyGatewayFileShareOutcome> ModifyGatewayFileShareOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ModifyGatewayFileShareRequest&, const ModifyGatewayFileShareOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyGatewayFileShareAsyncHandler; typedef Outcome<Error, Model::ModifyGatewayFileShareWatermarkResult> ModifyGatewayFileShareWatermarkOutcome; typedef std::future<ModifyGatewayFileShareWatermarkOutcome> ModifyGatewayFileShareWatermarkOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ModifyGatewayFileShareWatermarkRequest&, const ModifyGatewayFileShareWatermarkOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyGatewayFileShareWatermarkAsyncHandler; typedef Outcome<Error, Model::ModifyStorageBundleResult> ModifyStorageBundleOutcome; typedef std::future<ModifyStorageBundleOutcome> ModifyStorageBundleOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ModifyStorageBundleRequest&, const ModifyStorageBundleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyStorageBundleAsyncHandler; typedef Outcome<Error, Model::OpenSgwServiceResult> OpenSgwServiceOutcome; typedef std::future<OpenSgwServiceOutcome> OpenSgwServiceOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::OpenSgwServiceRequest&, const OpenSgwServiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> OpenSgwServiceAsyncHandler; typedef Outcome<Error, Model::OperateGatewayResult> OperateGatewayOutcome; typedef std::future<OperateGatewayOutcome> OperateGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::OperateGatewayRequest&, const OperateGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> OperateGatewayAsyncHandler; typedef Outcome<Error, Model::ReleaseServiceResult> ReleaseServiceOutcome; typedef std::future<ReleaseServiceOutcome> ReleaseServiceOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ReleaseServiceRequest&, const ReleaseServiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReleaseServiceAsyncHandler; typedef Outcome<Error, Model::RemoveSharesFromExpressSyncResult> RemoveSharesFromExpressSyncOutcome; typedef std::future<RemoveSharesFromExpressSyncOutcome> RemoveSharesFromExpressSyncOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::RemoveSharesFromExpressSyncRequest&, const RemoveSharesFromExpressSyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RemoveSharesFromExpressSyncAsyncHandler; typedef Outcome<Error, Model::RemoveTagsFromGatewayResult> RemoveTagsFromGatewayOutcome; typedef std::future<RemoveTagsFromGatewayOutcome> RemoveTagsFromGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::RemoveTagsFromGatewayRequest&, const RemoveTagsFromGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RemoveTagsFromGatewayAsyncHandler; typedef Outcome<Error, Model::ReportBlockVolumesResult> ReportBlockVolumesOutcome; typedef std::future<ReportBlockVolumesOutcome> ReportBlockVolumesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ReportBlockVolumesRequest&, const ReportBlockVolumesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReportBlockVolumesAsyncHandler; typedef Outcome<Error, Model::ReportFileSharesResult> ReportFileSharesOutcome; typedef std::future<ReportFileSharesOutcome> ReportFileSharesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ReportFileSharesRequest&, const ReportFileSharesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReportFileSharesAsyncHandler; typedef Outcome<Error, Model::ReportGatewayInfoResult> ReportGatewayInfoOutcome; typedef std::future<ReportGatewayInfoOutcome> ReportGatewayInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ReportGatewayInfoRequest&, const ReportGatewayInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReportGatewayInfoAsyncHandler; typedef Outcome<Error, Model::ReportGatewayUsageResult> ReportGatewayUsageOutcome; typedef std::future<ReportGatewayUsageOutcome> ReportGatewayUsageOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ReportGatewayUsageRequest&, const ReportGatewayUsageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReportGatewayUsageAsyncHandler; typedef Outcome<Error, Model::ResetGatewayPasswordResult> ResetGatewayPasswordOutcome; typedef std::future<ResetGatewayPasswordOutcome> ResetGatewayPasswordOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ResetGatewayPasswordRequest&, const ResetGatewayPasswordOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ResetGatewayPasswordAsyncHandler; typedef Outcome<Error, Model::RestartFileSharesResult> RestartFileSharesOutcome; typedef std::future<RestartFileSharesOutcome> RestartFileSharesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::RestartFileSharesRequest&, const RestartFileSharesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RestartFileSharesAsyncHandler; typedef Outcome<Error, Model::SetGatewayADInfoResult> SetGatewayADInfoOutcome; typedef std::future<SetGatewayADInfoOutcome> SetGatewayADInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::SetGatewayADInfoRequest&, const SetGatewayADInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SetGatewayADInfoAsyncHandler; typedef Outcome<Error, Model::SetGatewayDNSResult> SetGatewayDNSOutcome; typedef std::future<SetGatewayDNSOutcome> SetGatewayDNSOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::SetGatewayDNSRequest&, const SetGatewayDNSOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SetGatewayDNSAsyncHandler; typedef Outcome<Error, Model::SetGatewayLDAPInfoResult> SetGatewayLDAPInfoOutcome; typedef std::future<SetGatewayLDAPInfoOutcome> SetGatewayLDAPInfoOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::SetGatewayLDAPInfoRequest&, const SetGatewayLDAPInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SetGatewayLDAPInfoAsyncHandler; typedef Outcome<Error, Model::SwitchCSGClientsReverseSyncConfigurationResult> SwitchCSGClientsReverseSyncConfigurationOutcome; typedef std::future<SwitchCSGClientsReverseSyncConfigurationOutcome> SwitchCSGClientsReverseSyncConfigurationOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::SwitchCSGClientsReverseSyncConfigurationRequest&, const SwitchCSGClientsReverseSyncConfigurationOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SwitchCSGClientsReverseSyncConfigurationAsyncHandler; typedef Outcome<Error, Model::SwitchGatewayExpirationPolicyResult> SwitchGatewayExpirationPolicyOutcome; typedef std::future<SwitchGatewayExpirationPolicyOutcome> SwitchGatewayExpirationPolicyOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::SwitchGatewayExpirationPolicyRequest&, const SwitchGatewayExpirationPolicyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SwitchGatewayExpirationPolicyAsyncHandler; typedef Outcome<Error, Model::SwitchToSubscriptionResult> SwitchToSubscriptionOutcome; typedef std::future<SwitchToSubscriptionOutcome> SwitchToSubscriptionOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::SwitchToSubscriptionRequest&, const SwitchToSubscriptionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SwitchToSubscriptionAsyncHandler; typedef Outcome<Error, Model::TagResourcesResult> TagResourcesOutcome; typedef std::future<TagResourcesOutcome> TagResourcesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::TagResourcesRequest&, const TagResourcesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TagResourcesAsyncHandler; typedef Outcome<Error, Model::TriggerGatewayRemoteSyncResult> TriggerGatewayRemoteSyncOutcome; typedef std::future<TriggerGatewayRemoteSyncOutcome> TriggerGatewayRemoteSyncOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::TriggerGatewayRemoteSyncRequest&, const TriggerGatewayRemoteSyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TriggerGatewayRemoteSyncAsyncHandler; typedef Outcome<Error, Model::UntagResourcesResult> UntagResourcesOutcome; typedef std::future<UntagResourcesOutcome> UntagResourcesOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::UntagResourcesRequest&, const UntagResourcesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UntagResourcesAsyncHandler; typedef Outcome<Error, Model::UpdateGatewayBlockVolumeResult> UpdateGatewayBlockVolumeOutcome; typedef std::future<UpdateGatewayBlockVolumeOutcome> UpdateGatewayBlockVolumeOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::UpdateGatewayBlockVolumeRequest&, const UpdateGatewayBlockVolumeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateGatewayBlockVolumeAsyncHandler; typedef Outcome<Error, Model::UpdateGatewayFileShareResult> UpdateGatewayFileShareOutcome; typedef std::future<UpdateGatewayFileShareOutcome> UpdateGatewayFileShareOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::UpdateGatewayFileShareRequest&, const UpdateGatewayFileShareOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateGatewayFileShareAsyncHandler; typedef Outcome<Error, Model::UpgradeGatewayResult> UpgradeGatewayOutcome; typedef std::future<UpgradeGatewayOutcome> UpgradeGatewayOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::UpgradeGatewayRequest&, const UpgradeGatewayOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpgradeGatewayAsyncHandler; typedef Outcome<Error, Model::UploadCSGClientLogResult> UploadCSGClientLogOutcome; typedef std::future<UploadCSGClientLogOutcome> UploadCSGClientLogOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::UploadCSGClientLogRequest&, const UploadCSGClientLogOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UploadCSGClientLogAsyncHandler; typedef Outcome<Error, Model::UploadGatewayLogResult> UploadGatewayLogOutcome; typedef std::future<UploadGatewayLogOutcome> UploadGatewayLogOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::UploadGatewayLogRequest&, const UploadGatewayLogOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UploadGatewayLogAsyncHandler; typedef Outcome<Error, Model::ValidateExpressSyncConfigResult> ValidateExpressSyncConfigOutcome; typedef std::future<ValidateExpressSyncConfigOutcome> ValidateExpressSyncConfigOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ValidateExpressSyncConfigRequest&, const ValidateExpressSyncConfigOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ValidateExpressSyncConfigAsyncHandler; typedef Outcome<Error, Model::ValidateGatewayNameResult> ValidateGatewayNameOutcome; typedef std::future<ValidateGatewayNameOutcome> ValidateGatewayNameOutcomeCallable; typedef std::function<void(const SgwClient*, const Model::ValidateGatewayNameRequest&, const ValidateGatewayNameOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ValidateGatewayNameAsyncHandler; SgwClient(const Credentials &credentials, const ClientConfiguration &configuration); SgwClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration); SgwClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); ~SgwClient(); ActivateAllInOneGatewayOutcome activateAllInOneGateway(const Model::ActivateAllInOneGatewayRequest &request)const; void activateAllInOneGatewayAsync(const Model::ActivateAllInOneGatewayRequest& request, const ActivateAllInOneGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ActivateAllInOneGatewayOutcomeCallable activateAllInOneGatewayCallable(const Model::ActivateAllInOneGatewayRequest& request) const; ActivateGatewayOutcome activateGateway(const Model::ActivateGatewayRequest &request)const; void activateGatewayAsync(const Model::ActivateGatewayRequest& request, const ActivateGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ActivateGatewayOutcomeCallable activateGatewayCallable(const Model::ActivateGatewayRequest& request) const; AddSharesToExpressSyncOutcome addSharesToExpressSync(const Model::AddSharesToExpressSyncRequest &request)const; void addSharesToExpressSyncAsync(const Model::AddSharesToExpressSyncRequest& request, const AddSharesToExpressSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; AddSharesToExpressSyncOutcomeCallable addSharesToExpressSyncCallable(const Model::AddSharesToExpressSyncRequest& request) const; AddTagsToGatewayOutcome addTagsToGateway(const Model::AddTagsToGatewayRequest &request)const; void addTagsToGatewayAsync(const Model::AddTagsToGatewayRequest& request, const AddTagsToGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; AddTagsToGatewayOutcomeCallable addTagsToGatewayCallable(const Model::AddTagsToGatewayRequest& request) const; CheckActivationKeyOutcome checkActivationKey(const Model::CheckActivationKeyRequest &request)const; void checkActivationKeyAsync(const Model::CheckActivationKeyRequest& request, const CheckActivationKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckActivationKeyOutcomeCallable checkActivationKeyCallable(const Model::CheckActivationKeyRequest& request) const; CheckBlockVolumeNameOutcome checkBlockVolumeName(const Model::CheckBlockVolumeNameRequest &request)const; void checkBlockVolumeNameAsync(const Model::CheckBlockVolumeNameRequest& request, const CheckBlockVolumeNameAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckBlockVolumeNameOutcomeCallable checkBlockVolumeNameCallable(const Model::CheckBlockVolumeNameRequest& request) const; CheckGatewayEssdSupportOutcome checkGatewayEssdSupport(const Model::CheckGatewayEssdSupportRequest &request)const; void checkGatewayEssdSupportAsync(const Model::CheckGatewayEssdSupportRequest& request, const CheckGatewayEssdSupportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckGatewayEssdSupportOutcomeCallable checkGatewayEssdSupportCallable(const Model::CheckGatewayEssdSupportRequest& request) const; CheckMnsServiceOutcome checkMnsService(const Model::CheckMnsServiceRequest &request)const; void checkMnsServiceAsync(const Model::CheckMnsServiceRequest& request, const CheckMnsServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckMnsServiceOutcomeCallable checkMnsServiceCallable(const Model::CheckMnsServiceRequest& request) const; CheckRoleOutcome checkRole(const Model::CheckRoleRequest &request)const; void checkRoleAsync(const Model::CheckRoleRequest& request, const CheckRoleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckRoleOutcomeCallable checkRoleCallable(const Model::CheckRoleRequest& request) const; CheckSlrRoleOutcome checkSlrRole(const Model::CheckSlrRoleRequest &request)const; void checkSlrRoleAsync(const Model::CheckSlrRoleRequest& request, const CheckSlrRoleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckSlrRoleOutcomeCallable checkSlrRoleCallable(const Model::CheckSlrRoleRequest& request) const; CheckUpgradeVersionOutcome checkUpgradeVersion(const Model::CheckUpgradeVersionRequest &request)const; void checkUpgradeVersionAsync(const Model::CheckUpgradeVersionRequest& request, const CheckUpgradeVersionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CheckUpgradeVersionOutcomeCallable checkUpgradeVersionCallable(const Model::CheckUpgradeVersionRequest& request) const; CreateCacheOutcome createCache(const Model::CreateCacheRequest &request)const; void createCacheAsync(const Model::CreateCacheRequest& request, const CreateCacheAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateCacheOutcomeCallable createCacheCallable(const Model::CreateCacheRequest& request) const; CreateElasticGatewayPrivateZoneOutcome createElasticGatewayPrivateZone(const Model::CreateElasticGatewayPrivateZoneRequest &request)const; void createElasticGatewayPrivateZoneAsync(const Model::CreateElasticGatewayPrivateZoneRequest& request, const CreateElasticGatewayPrivateZoneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateElasticGatewayPrivateZoneOutcomeCallable createElasticGatewayPrivateZoneCallable(const Model::CreateElasticGatewayPrivateZoneRequest& request) const; CreateExpressSyncOutcome createExpressSync(const Model::CreateExpressSyncRequest &request)const; void createExpressSyncAsync(const Model::CreateExpressSyncRequest& request, const CreateExpressSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateExpressSyncOutcomeCallable createExpressSyncCallable(const Model::CreateExpressSyncRequest& request) const; CreateGatewayOutcome createGateway(const Model::CreateGatewayRequest &request)const; void createGatewayAsync(const Model::CreateGatewayRequest& request, const CreateGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateGatewayOutcomeCallable createGatewayCallable(const Model::CreateGatewayRequest& request) const; CreateGatewayBlockVolumeOutcome createGatewayBlockVolume(const Model::CreateGatewayBlockVolumeRequest &request)const; void createGatewayBlockVolumeAsync(const Model::CreateGatewayBlockVolumeRequest& request, const CreateGatewayBlockVolumeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateGatewayBlockVolumeOutcomeCallable createGatewayBlockVolumeCallable(const Model::CreateGatewayBlockVolumeRequest& request) const; CreateGatewayCacheDiskOutcome createGatewayCacheDisk(const Model::CreateGatewayCacheDiskRequest &request)const; void createGatewayCacheDiskAsync(const Model::CreateGatewayCacheDiskRequest& request, const CreateGatewayCacheDiskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateGatewayCacheDiskOutcomeCallable createGatewayCacheDiskCallable(const Model::CreateGatewayCacheDiskRequest& request) const; CreateGatewayFileShareOutcome createGatewayFileShare(const Model::CreateGatewayFileShareRequest &request)const; void createGatewayFileShareAsync(const Model::CreateGatewayFileShareRequest& request, const CreateGatewayFileShareAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateGatewayFileShareOutcomeCallable createGatewayFileShareCallable(const Model::CreateGatewayFileShareRequest& request) const; CreateGatewayLoggingOutcome createGatewayLogging(const Model::CreateGatewayLoggingRequest &request)const; void createGatewayLoggingAsync(const Model::CreateGatewayLoggingRequest& request, const CreateGatewayLoggingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateGatewayLoggingOutcomeCallable createGatewayLoggingCallable(const Model::CreateGatewayLoggingRequest& request) const; CreateGatewaySMBUserOutcome createGatewaySMBUser(const Model::CreateGatewaySMBUserRequest &request)const; void createGatewaySMBUserAsync(const Model::CreateGatewaySMBUserRequest& request, const CreateGatewaySMBUserAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateGatewaySMBUserOutcomeCallable createGatewaySMBUserCallable(const Model::CreateGatewaySMBUserRequest& request) const; CreateStorageBundleOutcome createStorageBundle(const Model::CreateStorageBundleRequest &request)const; void createStorageBundleAsync(const Model::CreateStorageBundleRequest& request, const CreateStorageBundleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; CreateStorageBundleOutcomeCallable createStorageBundleCallable(const Model::CreateStorageBundleRequest& request) const; DeleteCSGClientsOutcome deleteCSGClients(const Model::DeleteCSGClientsRequest &request)const; void deleteCSGClientsAsync(const Model::DeleteCSGClientsRequest& request, const DeleteCSGClientsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteCSGClientsOutcomeCallable deleteCSGClientsCallable(const Model::DeleteCSGClientsRequest& request) const; DeleteElasticGatewayPrivateZoneOutcome deleteElasticGatewayPrivateZone(const Model::DeleteElasticGatewayPrivateZoneRequest &request)const; void deleteElasticGatewayPrivateZoneAsync(const Model::DeleteElasticGatewayPrivateZoneRequest& request, const DeleteElasticGatewayPrivateZoneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteElasticGatewayPrivateZoneOutcomeCallable deleteElasticGatewayPrivateZoneCallable(const Model::DeleteElasticGatewayPrivateZoneRequest& request) const; DeleteExpressSyncOutcome deleteExpressSync(const Model::DeleteExpressSyncRequest &request)const; void deleteExpressSyncAsync(const Model::DeleteExpressSyncRequest& request, const DeleteExpressSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteExpressSyncOutcomeCallable deleteExpressSyncCallable(const Model::DeleteExpressSyncRequest& request) const; DeleteGatewayOutcome deleteGateway(const Model::DeleteGatewayRequest &request)const; void deleteGatewayAsync(const Model::DeleteGatewayRequest& request, const DeleteGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteGatewayOutcomeCallable deleteGatewayCallable(const Model::DeleteGatewayRequest& request) const; DeleteGatewayBlockVolumesOutcome deleteGatewayBlockVolumes(const Model::DeleteGatewayBlockVolumesRequest &request)const; void deleteGatewayBlockVolumesAsync(const Model::DeleteGatewayBlockVolumesRequest& request, const DeleteGatewayBlockVolumesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteGatewayBlockVolumesOutcomeCallable deleteGatewayBlockVolumesCallable(const Model::DeleteGatewayBlockVolumesRequest& request) const; DeleteGatewayCacheDiskOutcome deleteGatewayCacheDisk(const Model::DeleteGatewayCacheDiskRequest &request)const; void deleteGatewayCacheDiskAsync(const Model::DeleteGatewayCacheDiskRequest& request, const DeleteGatewayCacheDiskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteGatewayCacheDiskOutcomeCallable deleteGatewayCacheDiskCallable(const Model::DeleteGatewayCacheDiskRequest& request) const; DeleteGatewayFileSharesOutcome deleteGatewayFileShares(const Model::DeleteGatewayFileSharesRequest &request)const; void deleteGatewayFileSharesAsync(const Model::DeleteGatewayFileSharesRequest& request, const DeleteGatewayFileSharesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteGatewayFileSharesOutcomeCallable deleteGatewayFileSharesCallable(const Model::DeleteGatewayFileSharesRequest& request) const; DeleteGatewayLoggingOutcome deleteGatewayLogging(const Model::DeleteGatewayLoggingRequest &request)const; void deleteGatewayLoggingAsync(const Model::DeleteGatewayLoggingRequest& request, const DeleteGatewayLoggingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteGatewayLoggingOutcomeCallable deleteGatewayLoggingCallable(const Model::DeleteGatewayLoggingRequest& request) const; DeleteGatewaySMBUserOutcome deleteGatewaySMBUser(const Model::DeleteGatewaySMBUserRequest &request)const; void deleteGatewaySMBUserAsync(const Model::DeleteGatewaySMBUserRequest& request, const DeleteGatewaySMBUserAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteGatewaySMBUserOutcomeCallable deleteGatewaySMBUserCallable(const Model::DeleteGatewaySMBUserRequest& request) const; DeleteStorageBundleOutcome deleteStorageBundle(const Model::DeleteStorageBundleRequest &request)const; void deleteStorageBundleAsync(const Model::DeleteStorageBundleRequest& request, const DeleteStorageBundleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeleteStorageBundleOutcomeCallable deleteStorageBundleCallable(const Model::DeleteStorageBundleRequest& request) const; DeployCSGClientsOutcome deployCSGClients(const Model::DeployCSGClientsRequest &request)const; void deployCSGClientsAsync(const Model::DeployCSGClientsRequest& request, const DeployCSGClientsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeployCSGClientsOutcomeCallable deployCSGClientsCallable(const Model::DeployCSGClientsRequest& request) const; DeployCacheDiskOutcome deployCacheDisk(const Model::DeployCacheDiskRequest &request)const; void deployCacheDiskAsync(const Model::DeployCacheDiskRequest& request, const DeployCacheDiskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeployCacheDiskOutcomeCallable deployCacheDiskCallable(const Model::DeployCacheDiskRequest& request) const; DeployGatewayOutcome deployGateway(const Model::DeployGatewayRequest &request)const; void deployGatewayAsync(const Model::DeployGatewayRequest& request, const DeployGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DeployGatewayOutcomeCallable deployGatewayCallable(const Model::DeployGatewayRequest& request) const; DescribeAccountConfigOutcome describeAccountConfig(const Model::DescribeAccountConfigRequest &request)const; void describeAccountConfigAsync(const Model::DescribeAccountConfigRequest& request, const DescribeAccountConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeAccountConfigOutcomeCallable describeAccountConfigCallable(const Model::DescribeAccountConfigRequest& request) const; DescribeBlockVolumeSnapshotsOutcome describeBlockVolumeSnapshots(const Model::DescribeBlockVolumeSnapshotsRequest &request)const; void describeBlockVolumeSnapshotsAsync(const Model::DescribeBlockVolumeSnapshotsRequest& request, const DescribeBlockVolumeSnapshotsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeBlockVolumeSnapshotsOutcomeCallable describeBlockVolumeSnapshotsCallable(const Model::DescribeBlockVolumeSnapshotsRequest& request) const; DescribeCSGClientTasksOutcome describeCSGClientTasks(const Model::DescribeCSGClientTasksRequest &request)const; void describeCSGClientTasksAsync(const Model::DescribeCSGClientTasksRequest& request, const DescribeCSGClientTasksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeCSGClientTasksOutcomeCallable describeCSGClientTasksCallable(const Model::DescribeCSGClientTasksRequest& request) const; DescribeCSGClientsOutcome describeCSGClients(const Model::DescribeCSGClientsRequest &request)const; void describeCSGClientsAsync(const Model::DescribeCSGClientsRequest& request, const DescribeCSGClientsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeCSGClientsOutcomeCallable describeCSGClientsCallable(const Model::DescribeCSGClientsRequest& request) const; DescribeDashboardOutcome describeDashboard(const Model::DescribeDashboardRequest &request)const; void describeDashboardAsync(const Model::DescribeDashboardRequest& request, const DescribeDashboardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeDashboardOutcomeCallable describeDashboardCallable(const Model::DescribeDashboardRequest& request) const; DescribeExpireCachesOutcome describeExpireCaches(const Model::DescribeExpireCachesRequest &request)const; void describeExpireCachesAsync(const Model::DescribeExpireCachesRequest& request, const DescribeExpireCachesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeExpireCachesOutcomeCallable describeExpireCachesCallable(const Model::DescribeExpireCachesRequest& request) const; DescribeExpressSyncSharesOutcome describeExpressSyncShares(const Model::DescribeExpressSyncSharesRequest &request)const; void describeExpressSyncSharesAsync(const Model::DescribeExpressSyncSharesRequest& request, const DescribeExpressSyncSharesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeExpressSyncSharesOutcomeCallable describeExpressSyncSharesCallable(const Model::DescribeExpressSyncSharesRequest& request) const; DescribeExpressSyncsOutcome describeExpressSyncs(const Model::DescribeExpressSyncsRequest &request)const; void describeExpressSyncsAsync(const Model::DescribeExpressSyncsRequest& request, const DescribeExpressSyncsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeExpressSyncsOutcomeCallable describeExpressSyncsCallable(const Model::DescribeExpressSyncsRequest& request) const; DescribeGatewayOutcome describeGateway(const Model::DescribeGatewayRequest &request)const; void describeGatewayAsync(const Model::DescribeGatewayRequest& request, const DescribeGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayOutcomeCallable describeGatewayCallable(const Model::DescribeGatewayRequest& request) const; DescribeGatewayADInfoOutcome describeGatewayADInfo(const Model::DescribeGatewayADInfoRequest &request)const; void describeGatewayADInfoAsync(const Model::DescribeGatewayADInfoRequest& request, const DescribeGatewayADInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayADInfoOutcomeCallable describeGatewayADInfoCallable(const Model::DescribeGatewayADInfoRequest& request) const; DescribeGatewayActionsOutcome describeGatewayActions(const Model::DescribeGatewayActionsRequest &request)const; void describeGatewayActionsAsync(const Model::DescribeGatewayActionsRequest& request, const DescribeGatewayActionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayActionsOutcomeCallable describeGatewayActionsCallable(const Model::DescribeGatewayActionsRequest& request) const; DescribeGatewayAuthInfoOutcome describeGatewayAuthInfo(const Model::DescribeGatewayAuthInfoRequest &request)const; void describeGatewayAuthInfoAsync(const Model::DescribeGatewayAuthInfoRequest& request, const DescribeGatewayAuthInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayAuthInfoOutcomeCallable describeGatewayAuthInfoCallable(const Model::DescribeGatewayAuthInfoRequest& request) const; DescribeGatewayBlockVolumesOutcome describeGatewayBlockVolumes(const Model::DescribeGatewayBlockVolumesRequest &request)const; void describeGatewayBlockVolumesAsync(const Model::DescribeGatewayBlockVolumesRequest& request, const DescribeGatewayBlockVolumesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayBlockVolumesOutcomeCallable describeGatewayBlockVolumesCallable(const Model::DescribeGatewayBlockVolumesRequest& request) const; DescribeGatewayBucketCachesOutcome describeGatewayBucketCaches(const Model::DescribeGatewayBucketCachesRequest &request)const; void describeGatewayBucketCachesAsync(const Model::DescribeGatewayBucketCachesRequest& request, const DescribeGatewayBucketCachesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayBucketCachesOutcomeCallable describeGatewayBucketCachesCallable(const Model::DescribeGatewayBucketCachesRequest& request) const; DescribeGatewayCachesOutcome describeGatewayCaches(const Model::DescribeGatewayCachesRequest &request)const; void describeGatewayCachesAsync(const Model::DescribeGatewayCachesRequest& request, const DescribeGatewayCachesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayCachesOutcomeCallable describeGatewayCachesCallable(const Model::DescribeGatewayCachesRequest& request) const; DescribeGatewayCapacityLimitOutcome describeGatewayCapacityLimit(const Model::DescribeGatewayCapacityLimitRequest &request)const; void describeGatewayCapacityLimitAsync(const Model::DescribeGatewayCapacityLimitRequest& request, const DescribeGatewayCapacityLimitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayCapacityLimitOutcomeCallable describeGatewayCapacityLimitCallable(const Model::DescribeGatewayCapacityLimitRequest& request) const; DescribeGatewayCategoriesOutcome describeGatewayCategories(const Model::DescribeGatewayCategoriesRequest &request)const; void describeGatewayCategoriesAsync(const Model::DescribeGatewayCategoriesRequest& request, const DescribeGatewayCategoriesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayCategoriesOutcomeCallable describeGatewayCategoriesCallable(const Model::DescribeGatewayCategoriesRequest& request) const; DescribeGatewayClassesOutcome describeGatewayClasses(const Model::DescribeGatewayClassesRequest &request)const; void describeGatewayClassesAsync(const Model::DescribeGatewayClassesRequest& request, const DescribeGatewayClassesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayClassesOutcomeCallable describeGatewayClassesCallable(const Model::DescribeGatewayClassesRequest& request) const; DescribeGatewayCredentialOutcome describeGatewayCredential(const Model::DescribeGatewayCredentialRequest &request)const; void describeGatewayCredentialAsync(const Model::DescribeGatewayCredentialRequest& request, const DescribeGatewayCredentialAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayCredentialOutcomeCallable describeGatewayCredentialCallable(const Model::DescribeGatewayCredentialRequest& request) const; DescribeGatewayDNSOutcome describeGatewayDNS(const Model::DescribeGatewayDNSRequest &request)const; void describeGatewayDNSAsync(const Model::DescribeGatewayDNSRequest& request, const DescribeGatewayDNSAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayDNSOutcomeCallable describeGatewayDNSCallable(const Model::DescribeGatewayDNSRequest& request) const; DescribeGatewayFileSharesOutcome describeGatewayFileShares(const Model::DescribeGatewayFileSharesRequest &request)const; void describeGatewayFileSharesAsync(const Model::DescribeGatewayFileSharesRequest& request, const DescribeGatewayFileSharesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayFileSharesOutcomeCallable describeGatewayFileSharesCallable(const Model::DescribeGatewayFileSharesRequest& request) const; DescribeGatewayFileStatusOutcome describeGatewayFileStatus(const Model::DescribeGatewayFileStatusRequest &request)const; void describeGatewayFileStatusAsync(const Model::DescribeGatewayFileStatusRequest& request, const DescribeGatewayFileStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayFileStatusOutcomeCallable describeGatewayFileStatusCallable(const Model::DescribeGatewayFileStatusRequest& request) const; DescribeGatewayImagesOutcome describeGatewayImages(const Model::DescribeGatewayImagesRequest &request)const; void describeGatewayImagesAsync(const Model::DescribeGatewayImagesRequest& request, const DescribeGatewayImagesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayImagesOutcomeCallable describeGatewayImagesCallable(const Model::DescribeGatewayImagesRequest& request) const; DescribeGatewayInfoOutcome describeGatewayInfo(const Model::DescribeGatewayInfoRequest &request)const; void describeGatewayInfoAsync(const Model::DescribeGatewayInfoRequest& request, const DescribeGatewayInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayInfoOutcomeCallable describeGatewayInfoCallable(const Model::DescribeGatewayInfoRequest& request) const; DescribeGatewayLDAPInfoOutcome describeGatewayLDAPInfo(const Model::DescribeGatewayLDAPInfoRequest &request)const; void describeGatewayLDAPInfoAsync(const Model::DescribeGatewayLDAPInfoRequest& request, const DescribeGatewayLDAPInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayLDAPInfoOutcomeCallable describeGatewayLDAPInfoCallable(const Model::DescribeGatewayLDAPInfoRequest& request) const; DescribeGatewayLocationsOutcome describeGatewayLocations(const Model::DescribeGatewayLocationsRequest &request)const; void describeGatewayLocationsAsync(const Model::DescribeGatewayLocationsRequest& request, const DescribeGatewayLocationsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayLocationsOutcomeCallable describeGatewayLocationsCallable(const Model::DescribeGatewayLocationsRequest& request) const; DescribeGatewayLoggingOutcome describeGatewayLogging(const Model::DescribeGatewayLoggingRequest &request)const; void describeGatewayLoggingAsync(const Model::DescribeGatewayLoggingRequest& request, const DescribeGatewayLoggingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayLoggingOutcomeCallable describeGatewayLoggingCallable(const Model::DescribeGatewayLoggingRequest& request) const; DescribeGatewayLogsOutcome describeGatewayLogs(const Model::DescribeGatewayLogsRequest &request)const; void describeGatewayLogsAsync(const Model::DescribeGatewayLogsRequest& request, const DescribeGatewayLogsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayLogsOutcomeCallable describeGatewayLogsCallable(const Model::DescribeGatewayLogsRequest& request) const; DescribeGatewayModificationClassesOutcome describeGatewayModificationClasses(const Model::DescribeGatewayModificationClassesRequest &request)const; void describeGatewayModificationClassesAsync(const Model::DescribeGatewayModificationClassesRequest& request, const DescribeGatewayModificationClassesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayModificationClassesOutcomeCallable describeGatewayModificationClassesCallable(const Model::DescribeGatewayModificationClassesRequest& request) const; DescribeGatewayNFSClientsOutcome describeGatewayNFSClients(const Model::DescribeGatewayNFSClientsRequest &request)const; void describeGatewayNFSClientsAsync(const Model::DescribeGatewayNFSClientsRequest& request, const DescribeGatewayNFSClientsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayNFSClientsOutcomeCallable describeGatewayNFSClientsCallable(const Model::DescribeGatewayNFSClientsRequest& request) const; DescribeGatewaySMBUsersOutcome describeGatewaySMBUsers(const Model::DescribeGatewaySMBUsersRequest &request)const; void describeGatewaySMBUsersAsync(const Model::DescribeGatewaySMBUsersRequest& request, const DescribeGatewaySMBUsersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewaySMBUsersOutcomeCallable describeGatewaySMBUsersCallable(const Model::DescribeGatewaySMBUsersRequest& request) const; DescribeGatewayStatisticsOutcome describeGatewayStatistics(const Model::DescribeGatewayStatisticsRequest &request)const; void describeGatewayStatisticsAsync(const Model::DescribeGatewayStatisticsRequest& request, const DescribeGatewayStatisticsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayStatisticsOutcomeCallable describeGatewayStatisticsCallable(const Model::DescribeGatewayStatisticsRequest& request) const; DescribeGatewayStockOutcome describeGatewayStock(const Model::DescribeGatewayStockRequest &request)const; void describeGatewayStockAsync(const Model::DescribeGatewayStockRequest& request, const DescribeGatewayStockAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayStockOutcomeCallable describeGatewayStockCallable(const Model::DescribeGatewayStockRequest& request) const; DescribeGatewayTypesOutcome describeGatewayTypes(const Model::DescribeGatewayTypesRequest &request)const; void describeGatewayTypesAsync(const Model::DescribeGatewayTypesRequest& request, const DescribeGatewayTypesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewayTypesOutcomeCallable describeGatewayTypesCallable(const Model::DescribeGatewayTypesRequest& request) const; DescribeGatewaysOutcome describeGateways(const Model::DescribeGatewaysRequest &request)const; void describeGatewaysAsync(const Model::DescribeGatewaysRequest& request, const DescribeGatewaysAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewaysOutcomeCallable describeGatewaysCallable(const Model::DescribeGatewaysRequest& request) const; DescribeGatewaysForCmsOutcome describeGatewaysForCms(const Model::DescribeGatewaysForCmsRequest &request)const; void describeGatewaysForCmsAsync(const Model::DescribeGatewaysForCmsRequest& request, const DescribeGatewaysForCmsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewaysForCmsOutcomeCallable describeGatewaysForCmsCallable(const Model::DescribeGatewaysForCmsRequest& request) const; DescribeGatewaysTagsOutcome describeGatewaysTags(const Model::DescribeGatewaysTagsRequest &request)const; void describeGatewaysTagsAsync(const Model::DescribeGatewaysTagsRequest& request, const DescribeGatewaysTagsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeGatewaysTagsOutcomeCallable describeGatewaysTagsCallable(const Model::DescribeGatewaysTagsRequest& request) const; DescribeKmsKeyOutcome describeKmsKey(const Model::DescribeKmsKeyRequest &request)const; void describeKmsKeyAsync(const Model::DescribeKmsKeyRequest& request, const DescribeKmsKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeKmsKeyOutcomeCallable describeKmsKeyCallable(const Model::DescribeKmsKeyRequest& request) const; DescribeMqttConfigOutcome describeMqttConfig(const Model::DescribeMqttConfigRequest &request)const; void describeMqttConfigAsync(const Model::DescribeMqttConfigRequest& request, const DescribeMqttConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeMqttConfigOutcomeCallable describeMqttConfigCallable(const Model::DescribeMqttConfigRequest& request) const; DescribeOssBucketInfoOutcome describeOssBucketInfo(const Model::DescribeOssBucketInfoRequest &request)const; void describeOssBucketInfoAsync(const Model::DescribeOssBucketInfoRequest& request, const DescribeOssBucketInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeOssBucketInfoOutcomeCallable describeOssBucketInfoCallable(const Model::DescribeOssBucketInfoRequest& request) const; DescribeOssBucketsOutcome describeOssBuckets(const Model::DescribeOssBucketsRequest &request)const; void describeOssBucketsAsync(const Model::DescribeOssBucketsRequest& request, const DescribeOssBucketsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeOssBucketsOutcomeCallable describeOssBucketsCallable(const Model::DescribeOssBucketsRequest& request) const; DescribePayAsYouGoPriceOutcome describePayAsYouGoPrice(const Model::DescribePayAsYouGoPriceRequest &request)const; void describePayAsYouGoPriceAsync(const Model::DescribePayAsYouGoPriceRequest& request, const DescribePayAsYouGoPriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribePayAsYouGoPriceOutcomeCallable describePayAsYouGoPriceCallable(const Model::DescribePayAsYouGoPriceRequest& request) const; DescribeRegionsOutcome describeRegions(const Model::DescribeRegionsRequest &request)const; void describeRegionsAsync(const Model::DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeRegionsOutcomeCallable describeRegionsCallable(const Model::DescribeRegionsRequest& request) const; DescribeSharesBucketInfoForExpressSyncOutcome describeSharesBucketInfoForExpressSync(const Model::DescribeSharesBucketInfoForExpressSyncRequest &request)const; void describeSharesBucketInfoForExpressSyncAsync(const Model::DescribeSharesBucketInfoForExpressSyncRequest& request, const DescribeSharesBucketInfoForExpressSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeSharesBucketInfoForExpressSyncOutcomeCallable describeSharesBucketInfoForExpressSyncCallable(const Model::DescribeSharesBucketInfoForExpressSyncRequest& request) const; DescribeStorageBundleOutcome describeStorageBundle(const Model::DescribeStorageBundleRequest &request)const; void describeStorageBundleAsync(const Model::DescribeStorageBundleRequest& request, const DescribeStorageBundleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeStorageBundleOutcomeCallable describeStorageBundleCallable(const Model::DescribeStorageBundleRequest& request) const; DescribeStorageBundlesOutcome describeStorageBundles(const Model::DescribeStorageBundlesRequest &request)const; void describeStorageBundlesAsync(const Model::DescribeStorageBundlesRequest& request, const DescribeStorageBundlesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeStorageBundlesOutcomeCallable describeStorageBundlesCallable(const Model::DescribeStorageBundlesRequest& request) const; DescribeSubscriptionPriceOutcome describeSubscriptionPrice(const Model::DescribeSubscriptionPriceRequest &request)const; void describeSubscriptionPriceAsync(const Model::DescribeSubscriptionPriceRequest& request, const DescribeSubscriptionPriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeSubscriptionPriceOutcomeCallable describeSubscriptionPriceCallable(const Model::DescribeSubscriptionPriceRequest& request) const; DescribeTasksOutcome describeTasks(const Model::DescribeTasksRequest &request)const; void describeTasksAsync(const Model::DescribeTasksRequest& request, const DescribeTasksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeTasksOutcomeCallable describeTasksCallable(const Model::DescribeTasksRequest& request) const; DescribeUserBusinessStatusOutcome describeUserBusinessStatus(const Model::DescribeUserBusinessStatusRequest &request)const; void describeUserBusinessStatusAsync(const Model::DescribeUserBusinessStatusRequest& request, const DescribeUserBusinessStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeUserBusinessStatusOutcomeCallable describeUserBusinessStatusCallable(const Model::DescribeUserBusinessStatusRequest& request) const; DescribeVSwitchesOutcome describeVSwitches(const Model::DescribeVSwitchesRequest &request)const; void describeVSwitchesAsync(const Model::DescribeVSwitchesRequest& request, const DescribeVSwitchesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeVSwitchesOutcomeCallable describeVSwitchesCallable(const Model::DescribeVSwitchesRequest& request) const; DescribeVpcsOutcome describeVpcs(const Model::DescribeVpcsRequest &request)const; void describeVpcsAsync(const Model::DescribeVpcsRequest& request, const DescribeVpcsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeVpcsOutcomeCallable describeVpcsCallable(const Model::DescribeVpcsRequest& request) const; DescribeZonesOutcome describeZones(const Model::DescribeZonesRequest &request)const; void describeZonesAsync(const Model::DescribeZonesRequest& request, const DescribeZonesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DescribeZonesOutcomeCallable describeZonesCallable(const Model::DescribeZonesRequest& request) const; DisableGatewayLoggingOutcome disableGatewayLogging(const Model::DisableGatewayLoggingRequest &request)const; void disableGatewayLoggingAsync(const Model::DisableGatewayLoggingRequest& request, const DisableGatewayLoggingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DisableGatewayLoggingOutcomeCallable disableGatewayLoggingCallable(const Model::DisableGatewayLoggingRequest& request) const; DisableGatewayNFSVersionOutcome disableGatewayNFSVersion(const Model::DisableGatewayNFSVersionRequest &request)const; void disableGatewayNFSVersionAsync(const Model::DisableGatewayNFSVersionRequest& request, const DisableGatewayNFSVersionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; DisableGatewayNFSVersionOutcomeCallable disableGatewayNFSVersionCallable(const Model::DisableGatewayNFSVersionRequest& request) const; EnableGatewayIpv6Outcome enableGatewayIpv6(const Model::EnableGatewayIpv6Request &request)const; void enableGatewayIpv6Async(const Model::EnableGatewayIpv6Request& request, const EnableGatewayIpv6AsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; EnableGatewayIpv6OutcomeCallable enableGatewayIpv6Callable(const Model::EnableGatewayIpv6Request& request) const; EnableGatewayLoggingOutcome enableGatewayLogging(const Model::EnableGatewayLoggingRequest &request)const; void enableGatewayLoggingAsync(const Model::EnableGatewayLoggingRequest& request, const EnableGatewayLoggingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; EnableGatewayLoggingOutcomeCallable enableGatewayLoggingCallable(const Model::EnableGatewayLoggingRequest& request) const; ExpandCacheDiskOutcome expandCacheDisk(const Model::ExpandCacheDiskRequest &request)const; void expandCacheDiskAsync(const Model::ExpandCacheDiskRequest& request, const ExpandCacheDiskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ExpandCacheDiskOutcomeCallable expandCacheDiskCallable(const Model::ExpandCacheDiskRequest& request) const; ExpandGatewayNetworkBandwidthOutcome expandGatewayNetworkBandwidth(const Model::ExpandGatewayNetworkBandwidthRequest &request)const; void expandGatewayNetworkBandwidthAsync(const Model::ExpandGatewayNetworkBandwidthRequest& request, const ExpandGatewayNetworkBandwidthAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ExpandGatewayNetworkBandwidthOutcomeCallable expandGatewayNetworkBandwidthCallable(const Model::ExpandGatewayNetworkBandwidthRequest& request) const; GenerateGatewayTokenOutcome generateGatewayToken(const Model::GenerateGatewayTokenRequest &request)const; void generateGatewayTokenAsync(const Model::GenerateGatewayTokenRequest& request, const GenerateGatewayTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; GenerateGatewayTokenOutcomeCallable generateGatewayTokenCallable(const Model::GenerateGatewayTokenRequest& request) const; GenerateMqttTokenOutcome generateMqttToken(const Model::GenerateMqttTokenRequest &request)const; void generateMqttTokenAsync(const Model::GenerateMqttTokenRequest& request, const GenerateMqttTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; GenerateMqttTokenOutcomeCallable generateMqttTokenCallable(const Model::GenerateMqttTokenRequest& request) const; GenerateStsTokenOutcome generateStsToken(const Model::GenerateStsTokenRequest &request)const; void generateStsTokenAsync(const Model::GenerateStsTokenRequest& request, const GenerateStsTokenAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; GenerateStsTokenOutcomeCallable generateStsTokenCallable(const Model::GenerateStsTokenRequest& request) const; ListTagResourcesOutcome listTagResources(const Model::ListTagResourcesRequest &request)const; void listTagResourcesAsync(const Model::ListTagResourcesRequest& request, const ListTagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ListTagResourcesOutcomeCallable listTagResourcesCallable(const Model::ListTagResourcesRequest& request) const; ModifyGatewayOutcome modifyGateway(const Model::ModifyGatewayRequest &request)const; void modifyGatewayAsync(const Model::ModifyGatewayRequest& request, const ModifyGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ModifyGatewayOutcomeCallable modifyGatewayCallable(const Model::ModifyGatewayRequest& request) const; ModifyGatewayBlockVolumeOutcome modifyGatewayBlockVolume(const Model::ModifyGatewayBlockVolumeRequest &request)const; void modifyGatewayBlockVolumeAsync(const Model::ModifyGatewayBlockVolumeRequest& request, const ModifyGatewayBlockVolumeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ModifyGatewayBlockVolumeOutcomeCallable modifyGatewayBlockVolumeCallable(const Model::ModifyGatewayBlockVolumeRequest& request) const; ModifyGatewayClassOutcome modifyGatewayClass(const Model::ModifyGatewayClassRequest &request)const; void modifyGatewayClassAsync(const Model::ModifyGatewayClassRequest& request, const ModifyGatewayClassAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ModifyGatewayClassOutcomeCallable modifyGatewayClassCallable(const Model::ModifyGatewayClassRequest& request) const; ModifyGatewayFileShareOutcome modifyGatewayFileShare(const Model::ModifyGatewayFileShareRequest &request)const; void modifyGatewayFileShareAsync(const Model::ModifyGatewayFileShareRequest& request, const ModifyGatewayFileShareAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ModifyGatewayFileShareOutcomeCallable modifyGatewayFileShareCallable(const Model::ModifyGatewayFileShareRequest& request) const; ModifyGatewayFileShareWatermarkOutcome modifyGatewayFileShareWatermark(const Model::ModifyGatewayFileShareWatermarkRequest &request)const; void modifyGatewayFileShareWatermarkAsync(const Model::ModifyGatewayFileShareWatermarkRequest& request, const ModifyGatewayFileShareWatermarkAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ModifyGatewayFileShareWatermarkOutcomeCallable modifyGatewayFileShareWatermarkCallable(const Model::ModifyGatewayFileShareWatermarkRequest& request) const; ModifyStorageBundleOutcome modifyStorageBundle(const Model::ModifyStorageBundleRequest &request)const; void modifyStorageBundleAsync(const Model::ModifyStorageBundleRequest& request, const ModifyStorageBundleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ModifyStorageBundleOutcomeCallable modifyStorageBundleCallable(const Model::ModifyStorageBundleRequest& request) const; OpenSgwServiceOutcome openSgwService(const Model::OpenSgwServiceRequest &request)const; void openSgwServiceAsync(const Model::OpenSgwServiceRequest& request, const OpenSgwServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; OpenSgwServiceOutcomeCallable openSgwServiceCallable(const Model::OpenSgwServiceRequest& request) const; OperateGatewayOutcome operateGateway(const Model::OperateGatewayRequest &request)const; void operateGatewayAsync(const Model::OperateGatewayRequest& request, const OperateGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; OperateGatewayOutcomeCallable operateGatewayCallable(const Model::OperateGatewayRequest& request) const; ReleaseServiceOutcome releaseService(const Model::ReleaseServiceRequest &request)const; void releaseServiceAsync(const Model::ReleaseServiceRequest& request, const ReleaseServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ReleaseServiceOutcomeCallable releaseServiceCallable(const Model::ReleaseServiceRequest& request) const; RemoveSharesFromExpressSyncOutcome removeSharesFromExpressSync(const Model::RemoveSharesFromExpressSyncRequest &request)const; void removeSharesFromExpressSyncAsync(const Model::RemoveSharesFromExpressSyncRequest& request, const RemoveSharesFromExpressSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; RemoveSharesFromExpressSyncOutcomeCallable removeSharesFromExpressSyncCallable(const Model::RemoveSharesFromExpressSyncRequest& request) const; RemoveTagsFromGatewayOutcome removeTagsFromGateway(const Model::RemoveTagsFromGatewayRequest &request)const; void removeTagsFromGatewayAsync(const Model::RemoveTagsFromGatewayRequest& request, const RemoveTagsFromGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; RemoveTagsFromGatewayOutcomeCallable removeTagsFromGatewayCallable(const Model::RemoveTagsFromGatewayRequest& request) const; ReportBlockVolumesOutcome reportBlockVolumes(const Model::ReportBlockVolumesRequest &request)const; void reportBlockVolumesAsync(const Model::ReportBlockVolumesRequest& request, const ReportBlockVolumesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ReportBlockVolumesOutcomeCallable reportBlockVolumesCallable(const Model::ReportBlockVolumesRequest& request) const; ReportFileSharesOutcome reportFileShares(const Model::ReportFileSharesRequest &request)const; void reportFileSharesAsync(const Model::ReportFileSharesRequest& request, const ReportFileSharesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ReportFileSharesOutcomeCallable reportFileSharesCallable(const Model::ReportFileSharesRequest& request) const; ReportGatewayInfoOutcome reportGatewayInfo(const Model::ReportGatewayInfoRequest &request)const; void reportGatewayInfoAsync(const Model::ReportGatewayInfoRequest& request, const ReportGatewayInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ReportGatewayInfoOutcomeCallable reportGatewayInfoCallable(const Model::ReportGatewayInfoRequest& request) const; ReportGatewayUsageOutcome reportGatewayUsage(const Model::ReportGatewayUsageRequest &request)const; void reportGatewayUsageAsync(const Model::ReportGatewayUsageRequest& request, const ReportGatewayUsageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ReportGatewayUsageOutcomeCallable reportGatewayUsageCallable(const Model::ReportGatewayUsageRequest& request) const; ResetGatewayPasswordOutcome resetGatewayPassword(const Model::ResetGatewayPasswordRequest &request)const; void resetGatewayPasswordAsync(const Model::ResetGatewayPasswordRequest& request, const ResetGatewayPasswordAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ResetGatewayPasswordOutcomeCallable resetGatewayPasswordCallable(const Model::ResetGatewayPasswordRequest& request) const; RestartFileSharesOutcome restartFileShares(const Model::RestartFileSharesRequest &request)const; void restartFileSharesAsync(const Model::RestartFileSharesRequest& request, const RestartFileSharesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; RestartFileSharesOutcomeCallable restartFileSharesCallable(const Model::RestartFileSharesRequest& request) const; SetGatewayADInfoOutcome setGatewayADInfo(const Model::SetGatewayADInfoRequest &request)const; void setGatewayADInfoAsync(const Model::SetGatewayADInfoRequest& request, const SetGatewayADInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; SetGatewayADInfoOutcomeCallable setGatewayADInfoCallable(const Model::SetGatewayADInfoRequest& request) const; SetGatewayDNSOutcome setGatewayDNS(const Model::SetGatewayDNSRequest &request)const; void setGatewayDNSAsync(const Model::SetGatewayDNSRequest& request, const SetGatewayDNSAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; SetGatewayDNSOutcomeCallable setGatewayDNSCallable(const Model::SetGatewayDNSRequest& request) const; SetGatewayLDAPInfoOutcome setGatewayLDAPInfo(const Model::SetGatewayLDAPInfoRequest &request)const; void setGatewayLDAPInfoAsync(const Model::SetGatewayLDAPInfoRequest& request, const SetGatewayLDAPInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; SetGatewayLDAPInfoOutcomeCallable setGatewayLDAPInfoCallable(const Model::SetGatewayLDAPInfoRequest& request) const; SwitchCSGClientsReverseSyncConfigurationOutcome switchCSGClientsReverseSyncConfiguration(const Model::SwitchCSGClientsReverseSyncConfigurationRequest &request)const; void switchCSGClientsReverseSyncConfigurationAsync(const Model::SwitchCSGClientsReverseSyncConfigurationRequest& request, const SwitchCSGClientsReverseSyncConfigurationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; SwitchCSGClientsReverseSyncConfigurationOutcomeCallable switchCSGClientsReverseSyncConfigurationCallable(const Model::SwitchCSGClientsReverseSyncConfigurationRequest& request) const; SwitchGatewayExpirationPolicyOutcome switchGatewayExpirationPolicy(const Model::SwitchGatewayExpirationPolicyRequest &request)const; void switchGatewayExpirationPolicyAsync(const Model::SwitchGatewayExpirationPolicyRequest& request, const SwitchGatewayExpirationPolicyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; SwitchGatewayExpirationPolicyOutcomeCallable switchGatewayExpirationPolicyCallable(const Model::SwitchGatewayExpirationPolicyRequest& request) const; SwitchToSubscriptionOutcome switchToSubscription(const Model::SwitchToSubscriptionRequest &request)const; void switchToSubscriptionAsync(const Model::SwitchToSubscriptionRequest& request, const SwitchToSubscriptionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; SwitchToSubscriptionOutcomeCallable switchToSubscriptionCallable(const Model::SwitchToSubscriptionRequest& request) const; TagResourcesOutcome tagResources(const Model::TagResourcesRequest &request)const; void tagResourcesAsync(const Model::TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; TagResourcesOutcomeCallable tagResourcesCallable(const Model::TagResourcesRequest& request) const; TriggerGatewayRemoteSyncOutcome triggerGatewayRemoteSync(const Model::TriggerGatewayRemoteSyncRequest &request)const; void triggerGatewayRemoteSyncAsync(const Model::TriggerGatewayRemoteSyncRequest& request, const TriggerGatewayRemoteSyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; TriggerGatewayRemoteSyncOutcomeCallable triggerGatewayRemoteSyncCallable(const Model::TriggerGatewayRemoteSyncRequest& request) const; UntagResourcesOutcome untagResources(const Model::UntagResourcesRequest &request)const; void untagResourcesAsync(const Model::UntagResourcesRequest& request, const UntagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; UntagResourcesOutcomeCallable untagResourcesCallable(const Model::UntagResourcesRequest& request) const; UpdateGatewayBlockVolumeOutcome updateGatewayBlockVolume(const Model::UpdateGatewayBlockVolumeRequest &request)const; void updateGatewayBlockVolumeAsync(const Model::UpdateGatewayBlockVolumeRequest& request, const UpdateGatewayBlockVolumeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; UpdateGatewayBlockVolumeOutcomeCallable updateGatewayBlockVolumeCallable(const Model::UpdateGatewayBlockVolumeRequest& request) const; UpdateGatewayFileShareOutcome updateGatewayFileShare(const Model::UpdateGatewayFileShareRequest &request)const; void updateGatewayFileShareAsync(const Model::UpdateGatewayFileShareRequest& request, const UpdateGatewayFileShareAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; UpdateGatewayFileShareOutcomeCallable updateGatewayFileShareCallable(const Model::UpdateGatewayFileShareRequest& request) const; UpgradeGatewayOutcome upgradeGateway(const Model::UpgradeGatewayRequest &request)const; void upgradeGatewayAsync(const Model::UpgradeGatewayRequest& request, const UpgradeGatewayAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; UpgradeGatewayOutcomeCallable upgradeGatewayCallable(const Model::UpgradeGatewayRequest& request) const; UploadCSGClientLogOutcome uploadCSGClientLog(const Model::UploadCSGClientLogRequest &request)const; void uploadCSGClientLogAsync(const Model::UploadCSGClientLogRequest& request, const UploadCSGClientLogAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; UploadCSGClientLogOutcomeCallable uploadCSGClientLogCallable(const Model::UploadCSGClientLogRequest& request) const; UploadGatewayLogOutcome uploadGatewayLog(const Model::UploadGatewayLogRequest &request)const; void uploadGatewayLogAsync(const Model::UploadGatewayLogRequest& request, const UploadGatewayLogAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; UploadGatewayLogOutcomeCallable uploadGatewayLogCallable(const Model::UploadGatewayLogRequest& request) const; ValidateExpressSyncConfigOutcome validateExpressSyncConfig(const Model::ValidateExpressSyncConfigRequest &request)const; void validateExpressSyncConfigAsync(const Model::ValidateExpressSyncConfigRequest& request, const ValidateExpressSyncConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ValidateExpressSyncConfigOutcomeCallable validateExpressSyncConfigCallable(const Model::ValidateExpressSyncConfigRequest& request) const; ValidateGatewayNameOutcome validateGatewayName(const Model::ValidateGatewayNameRequest &request)const; void validateGatewayNameAsync(const Model::ValidateGatewayNameRequest& request, const ValidateGatewayNameAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; ValidateGatewayNameOutcomeCallable validateGatewayNameCallable(const Model::ValidateGatewayNameRequest& request) const; private: std::shared_ptr<EndpointProvider> endpointProvider_; }; } } #endif // !ALIBABACLOUD_SGW_SGWCLIENT_H_
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
54c0b251b58200c36cc91d6bbf9f64debe8a8105
2a146fb66483406f209af37f99b0d82d83f571ad
/src/VDJgermline.hpp
96dd2426353736a07908fc53c33a94694397a240
[]
no_license
waffle-iron/linearham
55e681ca67cf1617aa2c462115750b8c4e551e52
4e74f796a0efe5f31e71ede41a6dca749f9399cf
refs/heads/master
2020-12-24T10:55:26.268525
2016-10-24T18:54:13
2016-10-24T18:54:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
967
hpp
#ifndef LINEARHAM_VDJGERMLINE_ #define LINEARHAM_VDJGERMLINE_ #include "NPadding.hpp" #include "NTInsertion.hpp" #include "germline.hpp" /// @file VDJgermline.hpp /// @brief Headers for the V, D, and J germline classes. namespace linearham { /// @brief An abstraction used to represent a V germline gene. class VGermline : public Germline, public NPadding { public: VGermline(){}; VGermline(YAML::Node root) : Germline(root), NPadding(root){}; }; /// @brief An abstraction used to represent a D germline gene. class DGermline : public Germline, public NTInsertion { public: DGermline(){}; DGermline(YAML::Node root) : Germline(root), NTInsertion(root){}; }; /// @brief An abstraction used to represent a J germline gene. class JGermline : public Germline, public NTInsertion, public NPadding { public: JGermline(){}; JGermline(YAML::Node root) : Germline(root), NTInsertion(root), NPadding(root){}; }; } #endif // LINEARHAM_VDJGERMLINE_
[ "matsen@fredhutch.org" ]
matsen@fredhutch.org
5d66986475f4d2d52d0cb1f791cab6f889f63065
8e459a3d4a667ed4c93ca33cf170371be57e4e5b
/ManuscriptTests/BinarizeTest/KabirBinarization/BinarizerKabir.h
1d10fb38f5fc7295bac0f8860ab3108ba5139066
[]
no_license
amitzohar/greyscale_extractor
b22fca3d249bbf96cde71b88d01c7818826e42c6
af0edef7fa0f6ea941aab29c9eacaf4b46e64567
refs/heads/master
2021-01-12T06:38:06.082377
2017-03-01T15:13:04
2017-03-01T15:13:04
77,399,329
0
0
null
null
null
null
UTF-8
C++
false
false
1,272
h
/* * File: BinarizerKabir.h * Author: user * * Created on June 17, 2015, 10:43 AM */ #ifndef _BINARIZER_KABIR_H #define _BINARIZER_KABIR_H #include <ImageBinarizer.h> #include <DImage.h> class BinarizerKabir : public ImageBinarizer{ protected: int _strokeWidth; int _k; Mat _structuralContrast, _grayLevel , _meanStrokeWidth; Mat _featureSpace; Mat _binaryNiblack; Mat _labels; Mat _partitionBinary; public: BinarizerKabir(); BinarizerKabir(const BinarizerKabir& orig); BinarizerKabir(int new_SW,int _K); DImage* binarize(); virtual ~BinarizerKabir(); void setStrokeWidth(int StrokeWidth); void setK(int K); private: void featureExtraction(); void calculateMeanStrokeWidth(); void calculateFeatureSpace(); void partitionFeatureSpace(); void runNiBlackAlgorithm(); void partitionClassification(long partition_count[]); Mat pixelClassification(long* countPartition); void printArea(long countPartition[]); void printAreaBinary(long countPartition[]); void printAreaBinaryNiblack(long countPartition[]); }; #endif /* BINARIZERKABIR_H */
[ "amit.zhr@gmail.com" ]
amit.zhr@gmail.com
20cc2f26507f17ed5433eaed4863d7e9d1c42bcd
4570ba080cbc8372ba756ed29c48a729ab613c35
/src/common/iter.h
600b32656ad14171fededcd39a067004acfb4720
[ "MIT" ]
permissive
neivv/teippi
d34d671e096b5a25756e2d7d7a7b057bdbf88bbb
05c006c2f74ad11285c39d37135aed03d1fb8806
refs/heads/master
2021-01-17T03:16:00.322406
2018-01-30T10:12:55
2018-01-30T10:26:45
40,534,128
12
5
null
2015-09-20T09:48:46
2015-08-11T09:44:20
C++
UTF-8
C++
false
false
1,075
h
#ifndef ITER_H #define ITER_H #include <algorithm> #include "optional.h" namespace Common { template <class Self, class Item> class Iterator { public: class internal_iterator { public: internal_iterator(Self *p) : parent(p), value(parent->next()) {} internal_iterator() {} bool operator==(const internal_iterator &other) const { return !value.used && !other.value.used; } bool operator!=(const internal_iterator &other) const { return !(*this == other); } internal_iterator &operator++() { value = parent->next(); return *this; } const Item &operator*() { return value.value; } private: Self *parent; Optional<Item> value; }; internal_iterator begin() { return internal_iterator(static_cast<Self *>(this)); } internal_iterator end() { return internal_iterator(); } }; template <class Iter> bool Empty(Iter &&it) { return it.begin() == it.end(); } } #endif /* ITER_H */
[ "ittevien@gmail.com" ]
ittevien@gmail.com
66c21b149fdd12a82a857ff5e4b44910daf713fe
07c3e4c4f82056e76285c81f14ea0fbb263ed906
/Re-Abyss/app/components/Cycle/DevPortal/Master.hpp
5e02fb0c2a78b386776d4ab7afa59188f5b19543
[]
no_license
tyanmahou/Re-Abyss
f030841ca395c6b7ca6f9debe4d0de8a8c0036b5
bd36687ddabad0627941dbe9b299b3c715114240
refs/heads/master
2023-08-02T22:23:43.867123
2023-08-02T14:20:26
2023-08-02T14:20:26
199,132,051
9
1
null
2021-11-22T20:46:39
2019-07-27T07:28:34
C++
UTF-8
C++
false
false
1,221
hpp
#pragma once #if ABYSS_DEVELOP #include <abyss/modules/GameObject/IComponent.hpp> #include <abyss/modules/Cycle/base/IListener.hpp> #include <Siv3D/Fwd.hpp> namespace abyss::Cycle::DevPortal { /// <summary> /// マスター観測者 /// </summary> class IMasterObserver { public: virtual ~IMasterObserver() = default; virtual bool onGameStart() = 0; virtual bool onExperiment() = 0; }; /// <summary> /// 上位命令クラス /// </summary> class Master final: public IComponent, public IListener { enum class Notify : s3d::int8 { None, GameStart, Experiment, }; public: Master(IMasterObserver* observer); bool listen() override; bool gameStart(); bool experiment(); private: bool notify(Notify notify); private: Notify m_notify = Notify::None; IMasterObserver* m_observer = nullptr; std::function<bool()> m_notifyEvent; }; } namespace abyss { template<> struct ComponentTree<Cycle::DevPortal::Master> { using Base = MultiComponents<Cycle::IListener>; }; } #endif
[ "tyanmahou@gmail.com" ]
tyanmahou@gmail.com
9653e0b6cc6df21e3b078b229b306e9cff84108f
96f8fb7fb764026ede7e927d8b4768b8b6f44abb
/01_Code/12_MFC/Day17/codes/MFCClient/MFCClientDlg.h
ab4bd9f023f0aac982af75926b55853848066695
[]
no_license
isongbo/MyCode
a513beaa8f43bc751aab5217314615c728ba771e
eb2330b1dbae9032ba5ad8ccd65b68375219e451
refs/heads/master
2021-01-10T09:48:53.587674
2016-01-15T10:21:04
2016-01-15T10:21:04
49,700,737
2
1
null
null
null
null
UTF-8
C++
false
false
1,354
h
// MFCClientDlg.h : header file // #if !defined(AFX_MFCCLIENTDLG_H__CB403295_E855_4FAF_A64A_4F03776C0E8A__INCLUDED_) #define AFX_MFCCLIENTDLG_H__CB403295_E855_4FAF_A64A_4F03776C0E8A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CMFCClientDlg dialog class CMFCClientDlg : public CDialog { // Construction public: CMFCClientDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CMFCClientDlg) enum { IDD = IDD_MFCCLIENT_DIALOG }; // NOTE: the ClassWizard will add data members here //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMFCClientDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: HICON m_hIcon; // Generated message map functions //{{AFX_MSG(CMFCClientDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); afx_msg void OnSendFile(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MFCCLIENTDLG_H__CB403295_E855_4FAF_A64A_4F03776C0E8A__INCLUDED_)
[ "syt-aini@126.com" ]
syt-aini@126.com
8272c7c551e3d7411422cad7c4ff29ca30378e35
3e5782ed696b256b2977fcbfb8c9369933a5151f
/100_149/103_Binary_Tree_Zigzag_Level_Order_Traversal/main.cpp
572208f10719017044009f5326adcf32f420b706
[]
no_license
fengjiachen/leetcode
b1f7b01e0ee312e7643d8a46bc0f8db33cf71b00
e226c67f7e6d8faef0b42da9139c99f3694071fc
refs/heads/master
2022-11-28T14:16:08.144354
2020-08-01T11:37:44
2020-08-01T11:37:44
190,188,181
0
0
null
null
null
null
UTF-8
C++
false
false
1,986
cpp
// Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). // For example: // Given binary tree [3,9,20,null,null,15,7], // 3 // / \ // 9 20 // / \ // 15 7 // return its zigzag level order traversal as: // [ // [3], // [20,9], // [15,7] // ] #include <iostream> #include <vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; vector<vector<int>> zigzagLevelOrder(TreeNode *root) { vector<vector<int>> ans; if (root == NULL) return ans; vector<TreeNode *> stack; stack.push_back(root); while (!stack.empty()) { vector<TreeNode *> temp; vector<int> level; while (!stack.empty()) { TreeNode *t = stack.back(); stack.pop_back(); level.push_back(t->val); if ((int)ans.size() % 2 == 0) { if (t->left != NULL) temp.push_back(t->left); if (t->right != NULL) temp.push_back(t->right); } else { if (t->right != NULL) temp.push_back(t->right); if (t->left != NULL) temp.push_back(t->left); } } ans.push_back(level); stack = temp; } return ans; } int main() { TreeNode *root = new TreeNode(3); root->left = new TreeNode(9); root->right = new TreeNode(20); root->right->left = new TreeNode(15); root->right->right = new TreeNode(7); vector<vector<int>> ans = zigzagLevelOrder(root); for (int i = 0; i < (int)ans.size(); i++) { for (int j = 0; j < (int)ans[i].size(); j++) { cout << ans[i][j] << " "; } cout << endl; } }
[ "503386220@qq.com" ]
503386220@qq.com
06aeb80b92d69da5af0f9742f1f780456b1c0ceb
8ebe232a679e01311f8cfafd38ecf81d867d49c1
/RandomService.cpp
b3d306c2ab96dd007001a1c1e981a714e4df3026
[]
no_license
agapow/multilocus
c6181f871d5b1c07fc4372dc4babdd03bad6887e
944d098b3790a41f2a09c68ab1c3077e7ceb821d
refs/heads/master
2021-06-03T11:49:00.524189
2015-09-03T14:50:27
2015-09-03T14:50:27
40,901,532
0
1
null
2021-05-15T15:37:09
2015-08-17T14:30:07
C++
WINDOWS-1252
C++
false
false
10,739
cpp
/************************************************************************** RandomService.cpp - encapsulated pseudo-random number generator Credits: - From SIBIL, the Silwood Biocomputing Library. - By Paul-Michael Agapow, 2003, Dept. Biology, University College London, London WC1E 6BT, UNITED KINGDOM. - <mail://mesa@agapow.net> <http://www.agapow.net/software/mesa/> - From public domain code by Ray Gardner, based on "RandomService Number Generators: Good Ones Are Hard to Find", Park & Miller (1988) CACM 31:10 and "Two Fast Implementations of the 'Minimal Standard' RandomService Number Generator", Carta (1990) CACM 33:1. Chi squared test from Sedgewick (1990) "Algorithms in C" p517. About: - A psuedo-random number generator intended to provide various random types, in various distributions over various ranges. As a service, it provides a fat interface with many functions. Where a generator function (STL-wise) is needed, i.e. a class that makes only randoms of a given distribution, instead use RandomGenerator and all its progeny. - This can serve as the base class for a family of RNGs, with the others needing only to define their basic "randomness" generator, Generator() and perhaps InitSeed() and SetSeed(). - Implemented as a linear congruential generator, where f(z) = 16807 z mod (2 ** 31 - 1). Uses L. Schrage's method to avoid overflow problems. - The names "Float" and "Whole" are used to avoid implying incorrect limitations to the random functions, and also to divide them into two broad classes: those that take and return decimal/real numbers and those that use whole/integer numbers. Changes: - 99.8.1: Modified from previous Random class. Almost immediately ran into this problem - a call like Uniform (5,10) has to be typecast as long to allow the compiler to resolve the ambiguity of the Uniform (long,long) vs Uniform (double,double). This is not neat. Therefore introduced fxns names UniformWhole and UniformFloat and depreciated the overloaded Uniform() fxns. - 00.1.15: in earlier versions, the seed was set from a time_t, which has precision only down to a second. Thus a series of RNGs instantiated one after the other would produce the same stream of numbers. So the call to automatically init the seed was shifted to a seperate virtual fxn (so it can be overidden in derived classes) and now runs off clock_t. - 00.2.15: SetSeed() was made virtual, so derived classes can do their own checks for bad seed values. - 00.2.16: Also the Test() function has been placed within an #ifdef block (this should happen with all Test() functions) and a chi squared test introduced. Briefly, chi^2 is the sum of the squared frequencies, multiplied by the expected mean frequency, less the number of samples. This figure should be close to possible range / number of different results, and definitely within 2*sqrt(range). Or where N is number of samples, R is the range, Chi^2 = SUM[0<=i<R] (freq_i - N/R)^2 / (N/R). N should be 10 times R. To Do: - incorporate exceptions - allow the arguments in range to be given in either order. Is this a good idea? - write a template metaprogram for speed? In fact, should this be made into a template to avoid the type problem. - should the seed be an unsigned long? **************************************************************************/ // *** INCLUDES #include "RandomService.h" #include <ctime> #include <limits> #include <cmath> using std::time; using std::clock; using std::numeric_limits; using std::time_t; using std::fmod; SBL_NAMESPACE_START // *** CONSTANTS & DEFINES const long kRandMax = 2147483647L; const long kA = 16807; // *** MAIN BODY *********************************************************/ // *** LIFECYCLE *********************************************************/ RandomService::RandomService () { InitSeed(); } RandomService::RandomService ( long iSeed ) { SetSeed(iSeed); } // INIT SEED // This automagically sets the seed on construction. Can be overridden // if desired. // !! Note: we don't know what the type returned by clock() will be, or // the local size of a long. So we coerce everything to the same type // with double() and use the fmod to ensure we don't get overflow on // theDefaultSeed. void RandomService::InitSeed () { long theDefaultSeed = long (fmod (double(clock()), double(numeric_limits<long>::max()))); SetSeed(theDefaultSeed); } // *** ACCESS ************************************************************/ #pragma mark - // SET SEED // Note how seed is bulletproofed against being set to 0. If linear // congruential generators are seeded with 0, the result is Bad. void RandomService::SetSeed ( long iSeed ) { mSeed = iSeed ? (iSeed & kRandMax) : 1; } // *** INTERNALS *********************************************************/ double RandomService::Generate () //: Returns the next raw random number in the range 0 to 1. // This is the basal function for generating "random-ness" and called // (eventually) by all others to generate numbers in the appropriate // intervals. It's one of two functions that can be over-ridden in a // derived class. { /* GOTCHA: note the typecasting to double in the last line. Without this, the return from this function will always be 0, as the result of a long divsion will be a long, and as it is less than 1, becomes 0. */ unsigned long theLo, theHi; theLo = (unsigned long) (kA * (long) (mSeed & 0xFFFF)); theHi = (unsigned long) (kA * (long) ((unsigned long) mSeed >> 16)); theLo += (theHi & 0x7FFF) << 16; if (theLo > kRandMax) { theLo &= kRandMax; ++theLo; } theLo += theHi >> 15; if (theLo > kRandMax) { theLo &= kRandMax; ++theLo; } mSeed = (long) theLo; return (double (mSeed) / double (kRandMax)); } // *** RANDOM NUMBERS ****************************************************/ // *** UNIFORM DISTRIBUTION // To avoid calling ambiguity and the need for typecasting, as detailed // above. #pragma mark - double RandomService::UniformFloat () { return (Uniform ()); } double RandomService::UniformFloat ( double iCeiling ) { return (Uniform (iCeiling)); } double RandomService::UniformFloat ( double iFloor, double iCeiling ) { return (Uniform (iFloor, iCeiling)); } long RandomService::UniformWhole ( long iNumChoices ) { return (Uniform (iNumChoices)); } long RandomService::UniformWhole ( long iFloor, long iCeiling ) { return (Uniform (iFloor, iCeiling)); } // *** OTHER DISTRIBUTIONS // *** NORMAL DISTRIBUTION #pragma mark - double RandomService::NormalFloat () { double theTempRand = Generate () - 0.5; return (theTempRand * Generate ()); } double RandomService::NormalFloat ( double iCeiling ) { return (NormalFloat() * iCeiling); } double RandomService::NormalFloat ( double iFloor, double iCeiling ) { assert (iFloor <= iCeiling); return (NormalFloat (iCeiling - iFloor) + iFloor); } long RandomService::NormalWhole ( long iNumChoices ) { return long (NormalFloat() * iNumChoices); } long RandomService::NormalWhole ( long iFloor, long iCeiling ) { assert (iFloor <= iCeiling); return (NormalWhole (iCeiling - iFloor + 1) + iFloor); } // *** DEPRECATED FUNCTIONS *********************************************/ #pragma mark - // UNIFORM () // Returns a double from the interval 0 -> 1. While this function is the // same as Generate() we have this as a seperate function in case the // substructure changes later. double RandomService::Uniform () { return (Generate ()); } // UNIFORM (double) // Returns a double from the interval 0 -> iCeiling. double RandomService::Uniform ( double iCeiling ) { return (Generate() * iCeiling); } // UNIFORM (double,double) // Returns a double from the interval iFloor -> iCeiling. Assumes // (although it is probably a breakable assumption) that iFloor is // less than iCeiling. double RandomService::Uniform ( double iFloor, double iCeiling ) { assert (iFloor <= iCeiling); return (Uniform (iCeiling - iFloor) + iFloor); } // UNIFORM (long) // Returns a long from the interval 0 -> (iNumChoices-1) inclusive. // To put it another way, the parameter says how many possible choices // there are and one is returned, numbering from zero up. long RandomService::Uniform ( long iNumChoices ) { double theFloatRand = Uniform(); long theLongRand = long (theFloatRand * double(iNumChoices)); return (theLongRand); } // UNIFORM (long,long) // Returns a long from the interval iFloor -> iCeiling inclusive. long RandomService::Uniform ( long iFloor, long iCeiling ) { assert (iFloor <= iCeiling); return (Uniform (iCeiling - iFloor + 1) + iFloor); } // *** TEST FUNCTIONS ****************************************************/ #ifdef SBL_DBG #include <iostream> //#include <iomanip> #include <vector.h> void ChiSqTest (RandomService* iThisObj, UInt iReps, UInt iRange); template <typename element_t> void TestPrintVector (vector<element_t>& iVector) { for (UInt i = 0; i < iVector.size(); i++) cout << iVector[i] << " "; cout << endl; } void RandomService::Test() { DBG_MSG("*** Testing RandomService class"); DBG_MSG("After seeding with 1 & 10K reps, seed == 1043618065"); SetSeed(1); for (int i = 0; i < 10000; ++i) (void) Generate(); DBG_MSG("After 10,000 reps, the seed is " << mSeed); InitSeed(); DBG_MSG("Testing Uniform(5,10): longs 5-10 inclusive"); for (int i = 0; i < 20; ++i) { vector<long> theResults; for (int j = 0; j < 5; j++) theResults.push_back(Uniform((long) 5,10)); DBG_ANON_VECTOR(theResults, 5); } DBG_MSG(""); DBG_MSG("Testing Uniform(5.0,10.0): floats 5.0-10.0 exclusive"); for (int i = 0; i < 10; ++i) { vector<double> theResults; for (int j = 0; j < 5; j++) theResults.push_back(Uniform((double) 5.0,10.0)); DBG_ANON_VECTOR(theResults, 8); } DBG_MSG(""); ChiSqTest (this, 1000, 100); DBG_MSG("*** Finished testing RandomService class"); } // see comments in header void ChiSqTest (RandomService* iThisObj, UInt iReps, UInt iRange) { DBG_MSG("Chi squared test:") // generate a vector of random number frequencies vector<int> theFreqs(iRange,0); for (UInt i = 0; i < iReps; i++) theFreqs[iThisObj->UniformWhole(iRange)]++; // calculate distribution int theSumSqs = 0; for (UInt i = 0; i < theFreqs.size(); i++) theSumSqs += theFreqs[i] * theFreqs[i]; float theChiSq = double(iRange * theSumSqs) / double(iReps) - double(iReps); DBG_MSG("reps=" << iReps << "; r=" << iRange << "±" << (2.0*std::sqrt(double(iRange))) << "; Chi^2=" << theChiSq); } #else void RandomService::Test() {} #endif SBL_NAMESPACE_STOP // *** END ***************************************************************/
[ "paul@agapow.net" ]
paul@agapow.net
95f42fad0255851065d8394a7df7fc02586ee35d
3716a56c3dbce569f0ce67d97868ba712019a56d
/Lab 8/Threads/Input.h
5eb1eb08fddd5fa92d1c2633337abd93d9e170f2
[]
no_license
AoifePowders/GamesEngineering2
4f1d5b8010f2172b8ffe2f343f3c6a987317729b
a2786f2f92447cfeacae43fd970edb83eb4f2014
refs/heads/master
2020-07-30T18:53:53.892734
2020-01-31T11:05:17
2020-01-31T11:05:17
210,320,035
0
0
null
null
null
null
UTF-8
C++
false
false
203
h
#pragma once class Input { public: void update(sf::Vector2f& position); }; void Input::update(sf::Vector2f& position) { std::cout << "Input Thread" << std::endl; position.x += 1; position.y += 1; }
[ "c00218374@itcarlow.ie" ]
c00218374@itcarlow.ie
0dccb9b85dc4e256912abbf6a814372dbc8c0d01
6787e14ece2d76f52bde6022aaefdafc9df19727
/MyRobot.h
7c3e42415fd2c6f9264c902d74dbb62a43d034ec
[]
no_license
TakanoriOnuma/BattingGame
01cf51fecb5dccdebbc956cee3d9e579387076b5
5d63b6c7a52b2c8a54e62f7199f79ff9aecb9953
refs/heads/master
2021-01-22T09:32:31.142024
2013-07-16T15:05:52
2013-07-16T15:05:52
null
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
1,374
h
#ifndef ___Class_MyRobot #define ___Class_MyRobot #include "DrawableObject.h" #include "IAnimation.h" class MyBox; class ArmLeg; class MyRobot : public DrawableObject, public IAnimation{ /* ロボットの状態 */ enum class Condition; Condition condition; // 自分の状態 static const int WALKING_FRAME = 50; // 歩く動作に必要なフレーム数 static const int RUNNING_FRAME = 40; // 走る動作に必要なフレーム数 Vector3d vec; // 移行状態で移動する量 int direction; // 方向(1か-1で方向を切り替える) void setRectBox(); protected: // --- デザインパターン State --- // class State; // Stateクラス State* state; // --- Stateクラスのサブクラスを前方宣言 --- // class Standing; class Walking; class Running; int frame; // 現在のフレーム数 struct BodyParts; // 体の部位の構造体 BodyParts* bodyParts; // 体のパーツを持つ virtual void draw() const; void _run_init(); // 走る具体的な初期化 void _run(); // 走る具体的な運動 public: using DrawableObject::draw; MyRobot(double x = 0.0, double y = 0.0, double z = 0.0); virtual ~MyRobot(); virtual void update() override; const BodyParts& getBodyParts() const{ return *bodyParts; } void stand(); void run(); void sit(); void jump(); void walk(); }; #endif
[ "ohnhistory@yahoo.co.jp" ]
ohnhistory@yahoo.co.jp
a79d7575aa9370931c6cfc068ee76b3c03389f52
9503111534c8439a4f12c21ac3a31c661a5c378d
/OS/LJF.cpp
f651071545b2bab8105bdef2e4424da792fbe7e8
[]
no_license
Sai-deepak/OS-Simulator
3af1a710422be2fa593d7cbfbea57d7e54a7644a
7f2b5e89b2bc9328f6bdce80c4cc0745df30b009
refs/heads/main
2023-04-06T11:59:28.325234
2021-04-23T06:50:49
2021-04-23T06:50:49
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,580
cpp
// LONGEST JOB FIRST (LJF) #include <bits/stdc++.h> using namespace std; class process { // making a class of name process public: // each process has attributes: process id, arrival time (AT), burst time (BT), // completion time (CT), turn around time (TAT), Waiting Time (WT) int id, AT, BT; int CT, TAT, WT; process(int id, int AT, int BT) { this->id = id; this->AT = AT; this->BT = BT; } }; // this is a custom sort function to sort the processes on basis of arrival time and process ids bool sort_by_arrival_time(process p1, process p2) { // if arrival times are different, sort on the basis of arrival times if (p1.AT != p2.AT) return p1.AT < p2.AT; // else sort on the basis of the process id number, always unique else return p1.id < p2.id; } int32_t main() { // Take input from user about the processes int n; cout << "Enter number of processes for LJF: "; cin >> n; vector<process> P; cout << "Enter the process id, arrival time, burst time of each process for each of the " << n << " processes: " << endl; for (int i = 0; i < n; i++) { int process_id, arrival_time, burst_time; cout << "Enter the process id, arrival time, burst time: "; cin >> process_id >> arrival_time >> burst_time; P.emplace_back(process(process_id, arrival_time, burst_time)); } // sort the processes on the basis on burst times for FCFS (First Come First Serve) sort(P.begin(), P.end(), sort_by_arrival_time); map<int, int> index_of_process_with_id; for (int i = 0; i < P.size(); i++) { index_of_process_with_id[P[i].id] = i; } // this set holds the next process to run priority_queue<pair<int, int>> next_process_to_execute; int i = 0; for (int current_time = 0; current_time < 1000;) { while (i < P.size() && P[i].AT <= current_time) { next_process_to_execute.push({P[i].BT, P[i].id}); i++; } if (!next_process_to_execute.empty()) { // Calculate and update values for each of CT, TAT, WT for each process int next_process = next_process_to_execute.top().second; next_process_to_execute.pop(); int ind = index_of_process_with_id[next_process]; P[ind].CT = current_time + P[ind].BT; P[ind].TAT = P[ind].CT - P[ind].AT; P[ind].WT = P[ind].TAT - P[ind].BT; current_time += P[ind].BT; } else { current_time += 1; } if (current_time > 100) break; } // printing the values chart having all times of all processes cout << "\nProcess Id\t AT\t BT\t CT\t TAT\tWT\n"; for (int i = 0; i < n; i++) { cout << P[i].id << "\t\t " << P[i].AT << "\t " << P[i].BT << "\t " << P[i].CT << "\t " << P[i].TAT << "\t " << P[i].WT << endl; } // calculating average TAT and WT double avg_TAT = 0, avg_WT = 0; for (int i = 0; i < n; i++) { avg_TAT += P[i].TAT; avg_WT += P[i].WT; } avg_TAT /= n; avg_WT /= n; cout << endl; cout << "\n------------------------------------------------------------------------------\n"; // Printing out final average values of TAT and WT cout << "The average TAT is: " << avg_TAT << endl; cout << "The average WT is : " << avg_WT << endl; cout << "------------------------------------------------------------------------------\n\n"; }
[ "noreply@github.com" ]
noreply@github.com
f13f81554b1dbbf9715d802045bd913d3111391f
3c8e0c8f1296ccc506b2a5f5ac3b709af71f22b6
/online-judges/menshikov/12A.cpp
2c37a3c5807756de1e2f553f36405877d4b9223a
[]
no_license
jnikhilreddy/acm-conventions
f32c93317917ce9e8dfa944994b80771ecd5409b
5e510637873a48a47581afa3398bbc892cc5e31c
refs/heads/master
2021-05-30T12:28:23.012629
2015-12-10T14:33:17
2015-12-10T14:33:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,113
cpp
#define VERBOSE #define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <fstream> #include <bitset> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #ifndef _DEBUG # undef VERBOSE #endif #ifdef NDEBUG #define VERBOSE #endif using namespace std; #pragma comment(linker, "/STACK:256000000") #define eps 1e-8 #define inf (1000 * 1000 * 1000) #define linf (4LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000) #define sqr(x) ((x) * (x)) #define eq(x, y) (((x) > (y) ? (x) - (y) : (y) - (x)) <= eps) #define sz(x) static_cast<int>((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define mp make_pair #define mt make_tuple #define pb push_back #define forn(i, n) for(int i = 0; i < (n); ++i) struct __{__(){ios_base::sync_with_stdio(false);cin.tie(NULL);}}_; template<typename I> inline void in(I l,I r) {while(l!=r)cin>>*l,++l;} template<typename I> inline void out(I l,I r,char D=' ') {if(l!=r){cout<<*l;while(++l!=r)cout<<D<<*l;}cout<<'\n';} struct debug_t { template <typename T> debug_t& operator<<(const T& value) { # ifdef VERBOSE cout << value; # endif return *this; } } debug; // just in vs2013, I'll get it after win 8.1) //void dbg_out(){debug<<'\n';} //template <typename T, typename... Args> //void dbg_out(const T& value, const Args&... args) //{debug<<value;dbg_out(args...);} //#define dbg(x) #x" = ",x,"; " typedef unsigned uint; typedef long long llong; typedef unsigned long long ullong; typedef long double ldouble; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<double> vd; typedef vector<vd> vvd; int add_mod(int a, int b, int mod = 10) {return (a+b)%mod;} void mul_matr(vvi& a, vvi& b) { static vvi t(3,vi(3)); forn(i,3) forn(j,3) { t[i][j] = 0; forn(k,3) t[i][j] = add_mod(t[i][j], a[i][k] * b[k][j]); } a.assign(all(t)); } void pow_matr(vvi& a, llong p) { vvi res(3,vi(3,0)); res[0][0] = res[1][1] = res[2][2] = 1; while( p ) { if( p & 1 ) mul_matr(res,a); mul_matr(a,a); p>>=1; } a.assign(all(res)); } int main() { //freopen(TASK".in", "r", stdin); //freopen(TASK".out", "w", stdout); #ifdef RALOR_PROJECT freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); #endif //freopen("info.txt", "r", stdin); //freopen("info.txt", "w", stdout); int d1,d2,d3; llong N; while( cin >> d1 >> d2 >> d3 >> N ) { vvi r(3,vi(3,0)); r[0][1] = r[1][2] = 1; r[2][0] = r[2][1] = r[2][2] = 1; if( N == 1 ) { cout << d1 << "\n"; continue; } if( N == 2 ) { cout << d2 << "\n"; continue; } if( N == 3 ) { cout << d3 << "\n"; continue; } pow_matr(r,N-3); cout << add_mod(r[2][0] * d1, add_mod(r[2][1] * d2, r[2][2] * d3)) << "\n"; } return 0; }
[ "zakharov.k.l@yandex.ru" ]
zakharov.k.l@yandex.ru
99634164bbf8c21e80850681b061dde6ed180f6e
659d99d090479506b63b374831a049dba5d70fcf
/xray-svn-trunk/xrCore/_plane.h
1f0260889614f7e5cac0792a1f7715f6e3aac154
[]
no_license
ssijonson/Rengen_Luch
a9312fed06dd08c7de19f36e5fd5e476881beb85
9bd0ff54408a890d4bdac1c493d67ce26b964555
refs/heads/main
2023-05-03T13:09:58.983176
2021-05-19T10:04:47
2021-05-19T10:04:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,663
h
#ifndef _PLANE #define _PLANE template <class T> class _plane { public: typedef T TYPE; typedef _plane<T> Self; typedef Self& SelfRef; typedef const Self& SelfCRef; public: _vector3<T> n; T d; public: Self() { null(); } Self(_vector3<T> t, T D) { n = t; d = D; }; Self(T nx, T ny = (T)0, T nz = (T)0, T D = (T)0) { n.set(nx, ny, nz); d = D; } IC void null() { n.null(); d = T(0); }; IC SelfRef set (Self &P) { n.set (P.n); d = P.d; return *this; } IC BOOL similar (Self &P, T eps_n=EPS, T eps_d=EPS) { return (n.similar(P.n,eps_n)&&(_abs(d-P.d)<eps_d)); } ICF SelfRef build (const _vector3<T> &v1, const _vector3<T> &v2, const _vector3<T> &v3) { _vector3<T> t1,t2; n.crossproduct(t1.sub(v1,v2), t2.sub(v1,v3)).normalize(); d = -n.dotproduct(v1); return *this; } ICF SelfRef build_precise (const _vector3<T> &v1, const _vector3<T> &v2, const _vector3<T> &v3) { _vector3<T> t1,t2; n.crossproduct(t1.sub(v1,v2), t2.sub(v1,v3)); exact_normalize(n); d = -n.dotproduct(v1); return *this; } ICF SelfRef build(const _vector3<T> &_p, const _vector3<T> &_n) { d = - n.normalize(_n).dotproduct(_p); return *this; } ICF SelfRef build_unit_normal(const _vector3<T> &_p, const _vector3<T> &_n) { VERIFY (fsimilar(_n.magnitude(),1,EPS)); d = - n.set(_n).dotproduct(_p); return *this; } IC SelfCRef project(_vector3<T> &pdest, _vector3<T> const& psrc) const { pdest.mad (psrc,n,-classify(psrc)); return *this; } IC SelfRef project(_vector3<T> &pdest, _vector3<T> const& psrc) { pdest.mad (psrc,n,-classify(psrc)); return *this; } ICF T classify(const _vector3<T> &v) const { return n.dotproduct(v)+d; } IC SelfRef normalize() { T denom = 1.f / n.magnitude(); n.mul(denom); d*=denom; return *this; } IC T distance (const _vector3<T> &v) { return _abs(classify(v)); } IC BOOL intersectRayDist(const _vector3<T>& P, const _vector3<T>& D, T& dist) { T numer = classify(P); T denom = n.dotproduct(D); if (_abs(denom)<EPS_S) // normal is orthogonal to vector3, cant intersect return FALSE; dist = -(numer / denom); return ((dist>0.f)||fis_zero(dist)); } ICF BOOL intersectRayPoint(const _vector3<T>& P, const _vector3<T>& D, _vector3<T>& dest) { T numer = classify(P); T denom = n.dotproduct(D); if (_abs(denom)<EPS_S) return FALSE; // normal is orthogonal to vector3, cant intersect else { float dist = -(numer / denom); dest.mad (P,D,dist); return ((dist>0.f)||fis_zero(dist)); } } IC BOOL intersect ( const _vector3<T>& u, const _vector3<T>& v, // segment _vector3<T>& isect) // intersection point { T denom,dist; _vector3<T> t; t.sub(v,u); denom = n.dotproduct(t); if (_abs(denom) < EPS) return false; // they are parallel dist = -(n.dotproduct(u) + d) / denom; if (dist < -EPS || dist > 1+EPS) return false; isect.mad(u,t,dist); return true; } IC BOOL intersect_2 ( const _vector3<T>& u, const _vector3<T>& v, // segment _vector3<T>& isect) // intersection point { T dist1, dist2; _vector3<T> t; dist1 = n.dotproduct(u)+d; dist2 = n.dotproduct(v)+d; if (dist1*dist2<0.0f) return false; t.sub (v,u); isect.mad (u,t,dist1/_abs(dist1-dist2)); return true; } IC SelfRef transform(_matrix<T>& M) { // rotate the normal M.transform_dir (n); // slide the offset d -= M.c.dotproduct (n); return *this; } }; typedef _plane<float> Fplane; typedef _plane<double> Dplane; template <class T> BOOL _valid (const _plane<T>& s) { return _valid(s.n) && _valid(s.d); } #endif
[ "16670637+KRodinn@users.noreply.github.com" ]
16670637+KRodinn@users.noreply.github.com
7d34d9631fd2ba63f1c4f0a67d911c4e7c5575cf
5685e8aa5ff66d8f8d8c2de264001a0d69d0dc6e
/Graph.hpp
355fdc917d1404d65a24a7521757ef32befaa663
[]
no_license
Vaphen/AutomatedGraphAlign
d7d810133c21aaf034dd567793f4860755ba55f8
8133ba6fb2493772a253ce77eb56cd99fd53aaa8
refs/heads/master
2021-01-22T12:53:47.322723
2017-09-09T11:49:02
2017-09-09T11:49:02
102,358,274
0
0
null
null
null
null
UTF-8
C++
false
false
4,591
hpp
#ifndef __GRAPH_H_ #define __GRAPH_H_ #include <vector> #include <initializer_list> #include <algorithm> #include <memory> #include "Node.hpp" #include "Edge.hpp" template<typename NODEVAL, typename EDGEVAL, bool isDirected = false, template<typename> typename NODETYPE = Node, template<typename, class, bool> typename EDGETYPE = Edge> class Graph { using NODE = NODETYPE<NODEVAL>; using EDGE = EDGETYPE<EDGEVAL, NODE, isDirected>; // Vectors containing pointers to all nodes and edges of this graph std::vector<std::shared_ptr<NODE> > nodes; std::vector<std::shared_ptr<EDGE> > edges; public: // default constructor Graph<NODEVAL, EDGEVAL, isDirected, NODETYPE, EDGETYPE>() = default; /** * @brief Add a new node with a given value to the graph. * @param value is the value of the node * @return a pointer to the new node */ std::shared_ptr<NODE> addNode(NODEVAL value) { this->nodes.emplace_back(new NODE(value)); return this->nodes.back(); } /** * @brief Add a new node with a given value and adjacent nodes to the graph. * @param value is the value of the node * @param adjacentNodes an initializer list containing pointers to adjacent nodes * @return a pointer to the new node */ std::shared_ptr<NODE> addNode(NODEVAL value, std::initializer_list<std::shared_ptr<NODE>> adjacentNodes) { std::shared_ptr<NODE> newNode(new NODE(value, adjacentNodes)); this->nodes.push_back(newNode); if(!isDirected) { for(auto adjacentNode : adjacentNodes) { adjacentNode->addAdjacentNode(newNode); } } for(auto adjacentNode : adjacentNodes) { edges.emplace_back(new EDGE(newNode, adjacentNode)); } return newNode; } /** * @brief Add an existing node to the graph * @param node a pointer to the node that should be added * @return false if the node is already a part of the graph, else true. */ bool addNode(std::shared_ptr<NODE> node) { auto isExistantIt = std::find_if(nodes.begin(), nodes.end(), [node](std::shared_ptr<NODE> p) { return (*node == *p); }); if(isExistantIt == nodes.end()) { this->nodes.push_back(node); return true; } return false; } /** * @brief Add a new edge between two given nodes if not existant * @param n1 is a pointer to the target node * @param n2 is a pointer to the destination node * @param directed must be true if the edge should be directed, else false * @return a pointer to the edge */ std::shared_ptr<EDGE> addEdge(std::shared_ptr<NODE> n1, std::shared_ptr<NODE> n2, bool directed) { std::shared_ptr<EDGE> edge(new EDGE(n1, n2)); // check if the edge is already existant // TODO: consider directed parameter auto isExistantIt = std::find_if(edges.begin(), edges.end(), [edge](std::shared_ptr<EDGE> p) { return (*edge == *p); }); if(isExistantIt == edges.end()) { edges.push_back(edge); isExistantIt = edges.end(); --isExistantIt; } return *isExistantIt; } /** * @brief Add a new, undirected edge between two given nodes if not existent * @param n1 is a pointer to the target node * @param n2 is a pointer to the destination node * @return a pointer to the edge */ std::shared_ptr<NODE> addEdge(std::shared_ptr<NODE> n1, std::shared_ptr<NODE> n2) { return addEdge(n1, n2, false); } /** * @brief Get all nodes of the graph * @return a vector containing pointers to all nodes of the graph */ std::vector<std::shared_ptr<NODE>> getNodes() const { return nodes; } /** * @brief Get all edges of the graph * @return a vector containing pointers to all edges of the graph */ std::vector<std::shared_ptr<EDGE> > getEdges() const { return edges; } /** \brief Check if a given node is contained in the graph * \param node a pointer to the node that should be checked * \return bool true if the node is contained in the graph, else false * */ bool contains(std::shared_ptr<NODE> node) { return std::find(nodes.begin(), nodes.end(), node) != nodes.end(); } /** \brief Remove a given node from the graph. * \param delnode a pointer to the node that should be deleted. * \return true if the node was existent in the graph and removed successful, else false. */ bool removeNode(std::shared_ptr<NODE> delnode) { auto it = std::find(nodes.begin(), nodes.end(), delnode); if(it != nodes.end()) { nodes.erase(it); for(auto node : nodes) { node->removeAdjacentNode(delnode); } return true; } return false; } }; #endif
[ "info@disputamus.de" ]
info@disputamus.de
9c51d49855545753b70addbd0ef27d6ece14578f
624c0d08538c773d54ca980cacef0e8781b0f1bf
/process/fdstream.hpp
d90bf47adf5b52c1b3e47b8a19cf389a03f71fab
[]
no_license
kiron1/process
6772114db43e6941b8f57e75d343534278ae4b3f
ca80ca308b829e5e90cb4035d70c9b5ab0748adb
refs/heads/main
2023-05-10T15:33:50.031874
2021-05-16T12:21:57
2021-06-09T09:34:31
367,857,626
0
0
null
null
null
null
UTF-8
C++
false
false
558
hpp
#pragma once #include "process/fdbuf.hpp" #include <ostream> namespace process { /// Output stream of a POSIX file descriptor. class fdostream : public std::ostream { public: explicit fdostream(int fd) : std::ostream(0), buf(fd) { rdbuf(&buf); } void close() { buf.close(); } private: fdbuf buf; }; /// Input stream of a POSIX file descriptor. class fdistream : public std::istream { public: explicit fdistream(int fd) : std::istream(0), buf(fd) { rdbuf(&buf); } void close() { buf.close(); } private: fdbuf buf; }; } // namespace process
[ "kiron1@gmail.com" ]
kiron1@gmail.com
7208fe7944f9542d36853ecca6688f6c58d10cbd
4dc1762bce44964ad2ef265b6d06af120c36f663
/include/NeuroMetrics/metrics.hxx
582c2bffa341137cd9a553652de03e249b608a2e
[]
no_license
constantinpape/NeuroMetrics
b0956a215f6d186ff7f212f0b050265ff9a843e2
064bda5f839ff7cdecc845f1d59a7b22e2c4c4ba
refs/heads/master
2020-12-24T06:44:47.615384
2019-06-03T19:48:05
2019-06-03T19:48:05
58,743,437
0
0
null
null
null
null
UTF-8
C++
false
false
10,809
hxx
#pragma once #include <vector> #include <iterator> #include <cmath> #include <stdexcept> #include <andres/marray.hxx> #include "NeuroMetrics/tools/for_each_coordinate.hxx" #include "NeuroMetrics/tools/parallel_max_element.hxx" namespace neurometrics { // bundle all metrics that can be computed from the contingency table // -> need to calculate it only once // TODO ignore label 0 for gt is hardcoded, make it accessible! template<unsigned DIM, class T> class NeuroMetrics { public: typedef andres::Marray<double> ContingencyTable; // constructor NeuroMetrics(); // interface // compute contingency table void computeContingecyTable(const andres::View<T> &, const andres::View<T> &); // parallel version, not debugged yet! hence not exposed to python void computeContingecyTable(const andres::View<T> &, const andres::View<T> &, const int); // rand measures // implementations adapted from // https://github.com/fiji/Trainable_Segmentation/blob/master/src/main/java/trainableSegmentation/metrics/RandError.java // adaptedRandIndexStats3DN2 double randIndex(); double randPrecision(); double randRecall(); double randScore(); // vi measures // implentations adapted from: // https://github.com/fiji/Trainable_Segmentation/blob/master/src/main/java/trainableSegmentation/metrics/VariationOfInformation.java // foregroundRestrictedFscore double variationOfInformation(); double viPrecision(); double viRecall(); double viScore(); private: // compute rand primitives void computeRandPrimitives(); // compute vi primitives void computeViPrimitives(); // flags to keep track of things that were already computed bool hasContingencyTable; bool hasRandPrimitives; bool hasViPrimitives; // contigency table and stuff size_t n; ContingencyTable contingencyTable; std::vector<double> rowSum; std::vector<double> colSum; // rand primitives double randA; // quadratic sum of row sums double randB; // quadratic sum of col sums double randAB;// quadratic sum of contingency table entries // vi primitives double viA; double viB; double viAB; }; // implementation template<unsigned DIM, class T> NeuroMetrics<DIM,T>::NeuroMetrics() : hasContingencyTable(false), hasRandPrimitives(false), hasViPrimitives(false), n(0), contingencyTable(), rowSum(), colSum(), randA(0), randB(0), randAB(0), viA(0), viB(0), viAB(0) {} template<unsigned DIM, class T> void NeuroMetrics<DIM,T>::computeContingecyTable( const andres::View<T> & segA, const andres::View<T> & segB ) { typedef std::array<int64_t,DIM> Coord; n = 1; Coord shape; for(size_t d = 0; d < DIM; ++d) { shape[d] = segA.shape(d); n *= shape[d]; } size_t nLabelsA = *( std::max_element( segA.begin(), segA.end() ) ) + 1; size_t nLabelsB = *( std::max_element( segB.begin(), segB.end() ) ) + 1; // init the contingency matrix size_t contingencyShape[] = {nLabelsA,nLabelsB}; contingencyTable.resize(contingencyShape, contingencyShape+2, 0.); // compute the contingency matrix tools::forEachCoordinate(shape, [&](const Coord & coord){ T labelA = segA(coord.begin()); T labelB = segB(coord.begin()); ++contingencyTable(labelA,labelB); }); // compute the sum of rows rowSum.assign( contingencyTable.shape(0), 0.); for( size_t i = 1; i < rowSum.size(); ++i ) { for( size_t j = 0; j < contingencyTable.shape(1); ++j ) { rowSum[i] += contingencyTable(i,j); } } // compute the sum of cols colSum.assign(contingencyTable.shape(1), 0.); for( size_t j = 1; j < colSum.size(); ++j ) { for( size_t i = 1; i < contingencyTable.shape(0); ++i ) { colSum[j] += contingencyTable(i,j); } } hasContingencyTable = true; } template<unsigned DIM, class T> void NeuroMetrics<DIM,T>::computeContingecyTable( const andres::View<T> & segA, const andres::View<T> & segB, const int numberOfThreads ) { typedef std::array<int64_t,DIM> Coord; n = 1; Coord shape; for(size_t d = 0; d < DIM; ++d) { shape[d] = segA.shape(d); n *= shape[d]; } auto popt = tools::ParallelOptions(numberOfThreads); tools::ThreadPool threadpool(popt); size_t actualNumThreads = threadpool.nThreads(); // max element is super slow here for some reason... T nLabelsA = tools::parallelMax<DIM>(segA, threadpool)+1; T nLabelsB = tools::parallelMax<DIM>(segB, threadpool)+1; // init the contingency matrix size_t contingencyShape[] = {nLabelsA,nLabelsB}; contingencyTable.resize(contingencyShape, contingencyShape+2, 0.); // parallel std::vector<ContingencyTable> cTableThreadVec(actualNumThreads); tools::parallel_foreach(threadpool, actualNumThreads,[&](int tid, int i){ cTableThreadVec[tid].resize(contingencyShape, contingencyShape+2, 0.); }); auto checkCoord = [&](const Coord & coordinate) { for(int d = 0; d < DIM; ++d) { if( coordinate[d] < 0 || coordinate[d] > shape[d]) { std::cout << "DIM " << d << " out of range with " << coordinate[d] << std::endl; throw std::runtime_error("Coordinate out of range"); } } }; tools::parallelForEachCoordinate(threadpool, shape, [&](const int tid, const Coord & coord){ checkCoord(coord); auto & cTable = cTableThreadVec[tid]; T labelA = segA(coord.begin()); T labelB = segB(coord.begin()); ++cTable(labelA,labelB); }); std::cout << "After Ctable" << std::endl; for(int tid = 0; tid < actualNumThreads; ++tid) contingencyTable += cTableThreadVec[tid]; std::cout << "After merge" << std::endl; // compute the sum of rows rowSum.assign( contingencyTable.shape(0), 0.); for( size_t i = 1; i < rowSum.size(); ++i ) { for( size_t j = 0; j < contingencyTable.shape(1); ++j ) { rowSum[i] += contingencyTable(i,j); } } // compute the sum of cols colSum.assign(contingencyTable.shape(1), 0.); for( size_t j = 1; j < colSum.size(); ++j ) { for( size_t i = 1; i < contingencyTable.shape(0); ++i ) { colSum[j] += contingencyTable(i,j); } } hasContingencyTable = true; } template<unsigned DIM, class T> void NeuroMetrics<DIM,T>::computeRandPrimitives() { double aux = 0.; for( size_t i = 1; i < contingencyTable.shape(0) ; i++) { aux += contingencyTable(i,0); } // sum of square of rows for( size_t i = 0; i < rowSum.size(); i++ ) { randA += rowSum[i] * rowSum[i]; } // sum of square of cols for( size_t j = 0; j < colSum.size(); j++ ) { randB += colSum[j] * colSum[j]; } randB += aux / n; for( size_t i = 1; i < contingencyTable.shape(0); i++ ) { for( size_t j = 1; j < contingencyTable.shape(1); j++ ) { randAB += contingencyTable(i,j) * contingencyTable(i,j); } } randAB += aux / n; hasRandPrimitives = true; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::randIndex() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); if (!hasRandPrimitives) computeRandPrimitives(); return 1. - (randA + randB - 2.*randAB) / (n*n); } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::randPrecision() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); if (!hasRandPrimitives) computeRandPrimitives(); return randAB / randB; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::randRecall() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); if (!hasRandPrimitives) computeRandPrimitives(); return randAB / randA; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::randScore() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); double prec = randPrecision(); double rec = randRecall(); return 2.0 * prec * rec / (prec + rec ); } template<unsigned DIM, class T> void NeuroMetrics<DIM,T>::computeViPrimitives() { double aux = 0.; for( size_t i = 1; i < contingencyTable.shape(0) ; i++) { aux += contingencyTable(i,0); } aux /= n; // sum of square of rows for( size_t i = 0; i < rowSum.size(); i++ ) { if( (rowSum[i] / n) != 0) viA += (rowSum[i] / n) * log( (rowSum[i] / n) ); } // sum of square of cols for( size_t j = 0; j < colSum.size(); j++ ) { if( (colSum[j] / n) != 0) viB += (colSum[j] / n) * log( (colSum[j] / n) ); } viB -= aux * log(n); for( size_t i = 1; i < contingencyTable.shape(0); i++ ) { for( size_t j = 1; j < contingencyTable.shape(1); j++ ) { if( (contingencyTable(i,j) / n) != 0) viAB += (contingencyTable(i,j) / n) * log(contingencyTable(i,j) / n); } } viAB -= aux / log(n); hasViPrimitives = true; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::variationOfInformation() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); if(!hasViPrimitives) computeViPrimitives(); return viA + viB - 2. * viAB; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::viPrecision() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); if(!hasViPrimitives) computeViPrimitives(); if(viA == 0.) { return 0.; } if(viB == 0.) { return 1.; } return ( viA + viB - viAB) / viA; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::viRecall() { if(!hasContingencyTable) throw std::runtime_error("Need to call computeContingencyTable first"); if(!hasViPrimitives) computeViPrimitives(); if(viA == 0.) { return 1.; } if(viB == 0.) { return 0.; } return (viB + viA - viAB) / viB; } template<unsigned DIM, class T> double NeuroMetrics<DIM,T>::viScore() { double prec = viPrecision(); double rec = viRecall(); return 2. * prec * rec / (prec + rec); } } // namespace neurometrics
[ "constantin.pape@iwr.uni-heidelberg.de" ]
constantin.pape@iwr.uni-heidelberg.de
4f66934b6efecad877ea90e5b344b769134597bf
e763b855be527d69fb2e824dfb693d09e59cdacb
/aws-cpp-sdk-mq/source/model/Configuration.cpp
6fa465025260322e8bf9f86450c8976c8a35ba3f
[ "MIT", "Apache-2.0", "JSON" ]
permissive
34234344543255455465/aws-sdk-cpp
47de2d7bde504273a43c99188b544e497f743850
1d04ff6389a0ca24361523c58671ad0b2cde56f5
refs/heads/master
2023-06-10T16:15:54.618966
2018-05-07T23:32:08
2018-05-07T23:32:08
132,632,360
1
0
Apache-2.0
2023-06-01T23:20:47
2018-05-08T15:56:35
C++
UTF-8
C++
false
false
3,312
cpp
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/mq/model/Configuration.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace MQ { namespace Model { Configuration::Configuration() : m_arnHasBeenSet(false), m_descriptionHasBeenSet(false), m_engineType(EngineType::NOT_SET), m_engineTypeHasBeenSet(false), m_engineVersionHasBeenSet(false), m_idHasBeenSet(false), m_latestRevisionHasBeenSet(false), m_nameHasBeenSet(false) { } Configuration::Configuration(const JsonValue& jsonValue) : m_arnHasBeenSet(false), m_descriptionHasBeenSet(false), m_engineType(EngineType::NOT_SET), m_engineTypeHasBeenSet(false), m_engineVersionHasBeenSet(false), m_idHasBeenSet(false), m_latestRevisionHasBeenSet(false), m_nameHasBeenSet(false) { *this = jsonValue; } Configuration& Configuration::operator =(const JsonValue& jsonValue) { if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("engineType")) { m_engineType = EngineTypeMapper::GetEngineTypeForName(jsonValue.GetString("engineType")); m_engineTypeHasBeenSet = true; } if(jsonValue.ValueExists("engineVersion")) { m_engineVersion = jsonValue.GetString("engineVersion"); m_engineVersionHasBeenSet = true; } if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("latestRevision")) { m_latestRevision = jsonValue.GetObject("latestRevision"); m_latestRevisionHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } return *this; } JsonValue Configuration::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_engineTypeHasBeenSet) { payload.WithString("engineType", EngineTypeMapper::GetNameForEngineType(m_engineType)); } if(m_engineVersionHasBeenSet) { payload.WithString("engineVersion", m_engineVersion); } if(m_idHasBeenSet) { payload.WithString("id", m_id); } if(m_latestRevisionHasBeenSet) { payload.WithObject("latestRevision", m_latestRevision.Jsonize()); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } return payload; } } // namespace Model } // namespace MQ } // namespace Aws
[ "henso@amazon.com" ]
henso@amazon.com
c6ed21621cce9af8845db92fd475f3fb50bc1279
db5ec47646ab57b54afff1bd29e3245544517f99
/asst4_lenssim/src/camera.cpp
79799af94591e68f5e7d46b796c6295a8d7a93b9
[]
no_license
rmilman/GraphicsProjects
2d610bd54dbe213136213406f1d806d0a16b999d
73206c178c142068746cfb77938b83a5e07efc0a
refs/heads/master
2021-01-19T01:59:08.033495
2017-03-20T19:52:55
2017-03-20T19:52:55
84,398,999
1
0
null
null
null
null
UTF-8
C++
false
false
5,383
cpp
#include "camera.h" #include <iostream> #include <sstream> #include <fstream> #include "CGL/misc.h" #include "CGL/vector3D.h" using namespace std; namespace CGL { using Collada::CameraInfo; void Camera::configure(const CameraInfo& info, size_t screenW, size_t screenH) { this->screenW = screenW; this->screenH = screenH; nClip = info.nClip; fClip = info.fClip; hFov = info.hFov; vFov = info.vFov; double ar1 = tan(radians(hFov) / 2) / tan(radians(vFov) / 2); ar = static_cast<double>(screenW) / screenH; if (ar1 < ar) { // hFov is too small hFov = 2 * degrees(atan(tan(radians(vFov) / 2) * ar)); } else if (ar1 > ar) { // vFov is too small vFov = 2 * degrees(atan(tan(radians(hFov) / 2) / ar)); } screenDist = ((double) screenH) / (2.0 * tan(radians(vFov) / 2)); } void Camera::place(const Vector3D& targetPos, const double phi, const double theta, const double r, const double minR, const double maxR) { double r_ = min(max(r, minR), maxR); double phi_ = (sin(phi) == 0) ? (phi + EPS_F) : phi; this->targetPos = targetPos; this->phi = phi_; this->theta = theta; this->r = r_; this->minR = minR; this->maxR = maxR; compute_position(); } void Camera::copy_placement(const Camera& other) { pos = other.pos; targetPos = other.targetPos; phi = other.phi; theta = other.theta; minR = other.minR; maxR = other.maxR; c2w = other.c2w; nClip = other.nClip; fClip = other.fClip; } void Camera::set_screen_size(const size_t screenW, const size_t screenH) { this->screenW = screenW; this->screenH = screenH; ar = 1.0 * screenW / screenH; hFov = 2 * degrees(atan(((double) screenW) / (2 * screenDist))); vFov = 2 * degrees(atan(((double) screenH) / (2 * screenDist))); } void Camera::move_by(const double dx, const double dy, const double d) { const double scaleFactor = d / screenDist; const Vector3D& displacement = c2w[0] * (dx * scaleFactor) + c2w[1] * (dy * scaleFactor); pos += displacement; targetPos += displacement; } void Camera::move_forward(const double dist) { double newR = min(max(r - dist, minR), maxR); pos = targetPos + ((pos - targetPos) * (newR / r)); r = newR; } void Camera::rotate_by(const double dPhi, const double dTheta) { phi = clamp(phi + dPhi, 0.0, (double) PI); theta += dTheta; compute_position(); } void Camera::compute_position() { double sinPhi = sin(phi); if (sinPhi == 0) { phi += EPS_F; sinPhi = sin(phi); } const Vector3D dirToCamera(r * sinPhi * sin(theta), r * cos(phi), r * sinPhi * cos(theta)); pos = targetPos + dirToCamera; Vector3D upVec(0, sinPhi > 0 ? 1 : -1, 0); Vector3D screenXDir = cross(upVec, dirToCamera); screenXDir.normalize(); Vector3D screenYDir = cross(dirToCamera, screenXDir); screenYDir.normalize(); c2w[0] = screenXDir; c2w[1] = screenYDir; c2w[2] = dirToCamera.unit(); // camera's view direction is the // opposite of of dirToCamera, so // directly using dirToCamera as // column 2 of the matrix takes [0 0 -1] // to the world space view direction } // double hFov, vFov, ar, nClip, fClip; // // Current position and target point (the point the camera is looking at). // Vector3D pos, targetPos; // // Orientation relative to target, and min & max distance from the target. // double phi, theta, r, minR, maxR; // // camera-to-world rotation matrix (note: also need to translate a // // camera-space point by 'pos' to perform a full camera-to-world // // transform) // Matrix3x3 c2w; // // Info about screen to render to; it corresponds to the camera's full field // // of view at some distance. // size_t screenW, screenH; // double screenDist; void Camera::dump_settings(string filename) { ofstream file(filename); file << hFov << " " << vFov << " " << ar << " " << nClip << " " << fClip << endl; for (int i = 0; i < 3; ++i) file << pos[i] << " "; for (int i = 0; i < 3; ++i) file << targetPos[i] << " "; file << endl; file << phi << " " << theta << " " << r << " " << minR << " " << maxR << endl; for (int i = 0; i < 9; ++i) file << c2w(i/3, i%3) << " "; file << endl; file << screenW << " " << screenH << " " << screenDist << endl; cout << "[Camera] Dumped settings to " << filename << endl; } void Camera::load_settings(string filename) { ifstream file(filename); file >> hFov >> vFov >> ar >> nClip >> fClip; for (int i = 0; i < 3; ++i) file >> pos[i]; for (int i = 0; i < 3; ++i) file >> targetPos[i]; file >> phi >> theta >> r >> minR >> maxR; for (int i = 0; i < 9; ++i) file >> c2w(i/3, i%3); file >> screenW >> screenH >> screenDist; cout << "[Camera] Loaded settings from " << filename << endl; } Ray Camera::generate_ray(double x, double y) const { // Part 1, Task 2: // compute position of the input sensor sample coordinate on the // canonical sensor plane one unit away from the pinhole. // Note: hFov and vFov are in degrees. // x = 2*(x-.5); y = 2*(y-.5); Ray r(pos,(c2w*Vector3D(x*tan(radians(hFov)*.5),y*tan(radians(vFov)*.5),-1)).unit()); r.min_t = nClip; r.max_t = fClip; return r; } } // namespace CGL
[ "becca.milman@berkeley.edu" ]
becca.milman@berkeley.edu
a3b26a5b43b2f8e22fa09bd9268dce2789d88f88
d3b64795e67df62340c6a7f08c9e1400574afca5
/src/epicell.hh
58810cffc0be49995f2af52f4e241f9d1064997f
[]
no_license
cndesantana/epicell
2531ba6e4f9b8250bb5353dc3ba5d56517e42f1a
11d6acbdad657f70549997b7f11d7acf1e95a6ee
refs/heads/master
2020-12-23T20:59:58.593868
2016-07-05T12:40:53
2016-07-05T12:40:53
62,635,417
0
0
null
null
null
null
UTF-8
C++
false
false
304
hh
#include <core/headers.hh> #include <dataAnalysis/headers.hh> #include <libraryInterfaces/headers.hh> #include <signaling/headers.hh> #include <cellTypes/headers.hh> #include <environment/headers.hh> // #include <mathematics/headers.hh> // #include <io/headers.hh> // #include <dataAnalysis/headers.hh>
[ "charles.desantana@eawag.ch" ]
charles.desantana@eawag.ch
e8969f3c3a5cb17109c503fcb87aaa51dbaa28dc
a5f5283abf4dec1584e0fa4465f212db8b72a82b
/GPU_SupportVectorMachine_Unmanaged/GPU_SupportVectorMachine_Unmanaged/IParser.h
8bcdecf24ffc2ec7bd3ee9309c4f91063ae2a615
[]
no_license
nagyistoce/thesis-gpgpu-svm-computeshader
d4e636f32c0f5064c97cea08cc92d7f8ba8b47a3
4c1e115a57d55d118e1616f2d55f4860d8d39f97
refs/heads/master
2020-06-05T04:05:08.136384
2012-04-02T09:12:08
2012-04-02T09:12:08
32,892,551
0
0
null
null
null
null
UTF-8
C++
false
false
367
h
#pragma once #include "DataDocument.h" namespace SVM_Framework{ class IParser{ public: virtual DataDocumentPtr parse(boost::filesystem::path path) = 0; protected: void beginParsing(boost::filesystem::path path); void endParsing(); unsigned int m_size; char* m_buffer; }; } typedef boost::shared_ptr<SVM_Framework::IParser> IParserPtr;
[ "Karl.Jansson.84@gmail.com@9bcb4955-51cf-ebff-d268-37ef13eebb7c" ]
Karl.Jansson.84@gmail.com@9bcb4955-51cf-ebff-d268-37ef13eebb7c
19ab47a3c95b8567c65b7000a2c66b18ff4c5dcf
2e430b1beef62388c6119014739dac047f533673
/Root/TupleMaker.cxx
8b9ce7eb1beb414aa71609168c53025aa0e3e5fe
[]
no_license
gerbaudo/susynt-ss3l
4b0c610df599e57a9000ffe243dcba6aea73fa8d
6667354f583cdfc36b2e82d41772ee493f4c5400
refs/heads/master
2020-04-10T01:41:39.106464
2015-12-07T16:09:10
2015-12-07T16:09:10
41,103,496
0
1
null
null
null
null
UTF-8
C++
false
false
6,360
cxx
#include "susynt-ss3l/TupleMaker.h" #include "SusyNtuple/SusyNt.h" #include "TDirectory.h" #include "TFile.h" #include "TTree.h" #include <algorithm> // transform #include <functional> // unary_function #include <iostream> #include <iterator> // back_inserter #include <sstream> using ss3l::TupleMaker; using ss3l::FourMom; using ss3l::WeightVariations; using Susy::Lepton; using Susy::Jet; using std::cout; using std::endl; using std::string; //---------------------------------------------------------- TupleMaker::TupleMaker(const std::string &outFilename, const std::string &treename, bool delayInit): file_(0), tree_(0) { if(!delayInit) init(outFilename, treename); } //---------------------------------------------------------- TupleMaker::~TupleMaker() { close(); } //---------------------------------------------------------- // util functions to convert Lepton, Jet -> FourMom FourMom lepton2FourMom (const Lepton *l) { return ( l && l->isMu() ? FourMom().setMu(*l) : l && l->isEle() ? FourMom().setEl(*l) : FourMom()); } FourMom jet2FourMom (const Jet *j) { return (j ? FourMom().setJet(*j) : FourMom()); } //---------------------------------------------------------- //---------------------------------------------------------- bool TupleMaker::fill(const double weight, const unsigned int run, const unsigned int event, const Susy::Lepton &l0, const Susy::Lepton &l1, const Susy::Met &met) { bool someBytesWritten(false); if(tree_) { eventPars_.setWeight(weight).setRun(run).setEvent(event); l0.isMu() ? l0_.setMu(l0) : l0_.setEl(l0); l1.isMu() ? l1_.setMu(l1) : l1_.setEl(l1); met_.setMet(met); someBytesWritten = (tree_->Fill()>0); } return someBytesWritten; } //---------------------------------------------------------- bool TupleMaker::fill(const double weight, const unsigned int run, const unsigned int event, const Susy::Lepton &l0, const Susy::Lepton &l1, const Susy::Met &met, const JetVector &jets) { bool someBytesWritten(false); if(tree_) { eventPars_.setWeight(weight).setRun(run).setEvent(event); l0.isMu() ? l0_.setMu(l0) : l0_.setEl(l0); l1.isMu() ? l1_.setMu(l1) : l1_.setEl(l1); met_.setMetCorr(met); jets_.clear(); lowptLepts_.clear(); std::transform(jets.begin(), jets.end(), std::back_inserter(jets_), jet2FourMom); someBytesWritten = (tree_->Fill()>0); } return someBytesWritten; } //---------------------------------------------------------- bool TupleMaker::fill(const double weight, const unsigned int run, const unsigned int event, const Susy::Lepton &l0, const Susy::Lepton &l1, const Susy::Met &met, const LeptonVector &otherLeptons, const JetVector &jets) { // note to self: to avoid duplication between the two fill // methods, one would need to fill the idividual branches, which // is an even more painful solution. bool someBytesWritten(false); if(tree_) { eventPars_.setWeight(weight).setRun(run).setEvent(event); l0.isMu() ? l0_.setMu(l0) : l0_.setEl(l0); l1.isMu() ? l1_.setMu(l1) : l1_.setEl(l1); met_.setMetCorr(met); jets_.clear(); lowptLepts_.clear(); const LeptonVector &olps = otherLeptons; std::transform(jets.begin(), jets.end(), std::back_inserter(jets_), jet2FourMom); std::transform(olps.begin(), olps.end(), std::back_inserter(lowptLepts_), lepton2FourMom); someBytesWritten = (tree_->Fill()>0); } return someBytesWritten; } //---------------------------------------------------------- bool TupleMaker::init(const std::string &outFilename, const std::string &treename) { if(file_ && file_->IsOpen() && tree_) { cout<<"TupleMaker::init: already initialized"<<endl; return false; } else return (initFile(outFilename) && initTree(treename)); } //---------------------------------------------------------- bool TupleMaker::initFile(const std::string &outFilename) { file_ = TFile::Open(outFilename.c_str(), "recreate"); if(!file_) cout<<"TupleMaker::initFile('"<<outFilename<<"') : failed to create file"<<endl; return (file_ && file_->IsOpen()); } //---------------------------------------------------------- bool TupleMaker::initTree(const std::string &treename) { bool initialized(false); TDirectory *startingDir = gDirectory; if(file_) { file_->cd(); string title("TupleMaker tree"); tree_ = new TTree(treename.c_str(), title.c_str()); tree_->SetDirectory(file_); initTreeBranches(); initialized = true; } else { cout<<"TupleMaker::initTree: invalid file, failed to create tree"<<endl; } if(startingDir) startingDir->cd(); // root is easily confused by pwd; cd back to where we were return initialized; } //---------------------------------------------------------- bool TupleMaker::initTreeBranches() { bool initialized(false); if(tree_) { tree_->Branch("l0", &l0_); tree_->Branch("l1", &l1_); tree_->Branch("met", &met_); tree_->Branch("jets", &jets_); tree_->Branch("lepts", &lowptLepts_); tree_->Branch("pars", &eventPars_); tree_->Branch("relWeights", &weightVariations_); } else { cout<<"TupleMaker::initTreeBranches : invalid tree, failed to init branches"<<endl; } return initialized; } //---------------------------------------------------------- bool TupleMaker::close() { bool closed(false); if(file_) { file_->cd(); file_->Write(); file_->Close(); file_->Delete(); file_ = 0; closed = true; } return closed; } //---------------------------------------------------------- std::string TupleMaker::filename() const { return file_->GetName(); } std::string TupleMaker::treename() const { return tree_->GetName(); } //---------------------------------------------------------- std::string TupleMaker::summary() const { std::ostringstream oss; oss<<file_->GetName()<<": "<<tree_->GetEntries()<<" entries"; return oss.str(); } //----------------------------------------------------------
[ "davide.gerbaudo@gmail.com" ]
davide.gerbaudo@gmail.com
eadbeee9843e050045617507a0e77ee5e453d3fe
4b0c57dddf8bd98c021e0967b5d94563d15372e1
/OptimizeEPD/interface/PhysicsProcessForOpt.hh
97b91f37f9749b8f07f91c1acc4599d8e5930cb6
[]
no_license
aperloff/TAMUWW
fea6ed0066f3f2cef4d44c525ee843c6234460ba
c18e4b7822076bf74ee919509a6bd1f3cf780e11
refs/heads/master
2021-01-21T14:12:34.813887
2018-07-23T04:59:40
2018-07-23T04:59:40
10,922,954
0
1
null
null
null
null
UTF-8
C++
false
false
990
hh
#ifndef PHYSICSPROCESSFOROPT_HH #define PHYSICSPROCESSFOROPT_HH #include "TAMUWW/SpecialTools/interface/PhysicsProcessMemory.hh" #include "TAMUWW/SpecialTools/interface/Defs.hh" #include "TAMUWW/MEPATNtuple/interface/ProbsForEPD.hh" #include "TAMUWW/MEPATNtuple/interface/MicroNtuple.hh" #include "TH1.h" class PhysicsProcessForOpt : public PhysicsProcessMemory { public: // Default C'tors PhysicsProcessForOpt(const PhysicsProcessMemory & ); void setProjectionsForOpt(); void fillNormEPDHisto(TH1* histo, DEFS::TagCat tagcat, double mhiggs, const ProbsForEPD & meProbs); void setEPDFunction(double (*userEPDFunc) (const ProbsForEPD &)); protected: //user defined function to return an epd double (*userEPDFunc) (const ProbsForEPD &); //this is the default user defined function static double defaultEPDFunc(const ProbsForEPD &){ return 0; } std::map <unsigned int, bool> failed_entries_map; };//class PhysicsProcessForOpt #endif
[ "" ]
3bd45652417e6345ef6d0d0083f190d68a85df99
e7be2ee48f952308f5672240c2c833d718d9d431
/Juliet_Test_Suite_v1.3_for_C_Cpp/C/testcases/CWE563_Unused_Variable/CWE563_Unused_Variable__unused_uninit_variable_int64_t_82_bad.cpp
45dc4c28e3e1be3ab00fdd10d6b674bc5c9c6603
[]
no_license
buihuynhduc/tooltest
5146c44cd1b7bc36b3b2912232ff8a881269f998
b3bb7a6436b3ab7170078860d6bcb7d386762b5e
refs/heads/master
2020-08-27T20:46:53.725182
2019-10-25T05:42:36
2019-10-25T05:42:36
217,485,049
1
0
null
null
null
null
UTF-8
C++
false
false
927
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE563_Unused_Variable__unused_uninit_variable_int64_t_82_bad.cpp Label Definition File: CWE563_Unused_Variable__unused_uninit_variable.label.xml Template File: source-sinks-82_bad.tmpl.cpp */ /* * @description * CWE: 563 Unused Variable * BadSource: Initialize data * Sinks: * GoodSink: Initialize, then use data * BadSink : Do nothing * Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer * * */ #ifndef OMITBAD #include "std_testcase.h" #include "CWE563_Unused_Variable__unused_uninit_variable_int64_t_82.h" namespace CWE563_Unused_Variable__unused_uninit_variable_int64_t_82 { void CWE563_Unused_Variable__unused_uninit_variable_int64_t_82_bad::action(int64_t data) { /* FLAW: Do not use the variable */ /* do nothing */ ; /* empty statement needed for some flow variants */ } } #endif /* OMITBAD */
[ "43197106+buihuynhduc@users.noreply.github.com" ]
43197106+buihuynhduc@users.noreply.github.com
b020e1f4b7aa51c43a4953d9688683483e6bdf3b
c2e49db1315323daeb8bd96335058afc10fa2d0d
/Ващук Олександр/Chapter 2/2.4.23.2 Bitwise palindromes/main.cpp
f506ca6ebd5d48d7f5df40b78d20ed292f773d18
[]
no_license
CyberSecurity-hackk/103-CyberSec
df1939d8dca024f2f9c559d04f9d175dab781960
3643365084d274e9ac2ea38560b7e0e3a055fa6b
refs/heads/main
2023-02-04T03:54:37.039106
2020-12-26T07:16:11
2020-12-26T07:16:11
308,091,391
0
0
null
2020-10-28T17:52:27
2020-10-28T17:25:45
null
UTF-8
C++
false
false
417
cpp
#include <iostream> using namespace std; int main(void) { unsigned short int val; bool ispalindrome = true; cout << "value = "; cin >> val; for(int i=0;i<16&&ispalindrome;i++) { ispalindrome=(((val>>i)&1) == ((val>>15-i)&1)); } if(ispalindrome) cout << val << " is a bitwise palindrome" << endl; else cout << val << " is not a bitwise palindrome" << endl; return 0; }
[ "noreply@github.com" ]
noreply@github.com
fd230e1c3aa86bdf869372fbb2535eaac5ace0e9
520b75c144414d2af5a655e592fa65787ee89aaa
/AtCoder/ABC/020/B.cpp
a30e83d54d233f71be57d1615cc51b060c318727
[]
no_license
arrows-1011/CPro
4ac069683c672ba685534444412aa2e28026879d
2e1a9242b2433851f495468e455ee854a8c4dac7
refs/heads/master
2020-04-12T09:36:40.846130
2017-06-10T08:02:10
2017-06-10T08:02:10
46,426,455
1
1
null
null
null
null
UTF-8
C++
false
false
194
cpp
#include <bits/stdc++.h> using namespace std; int main(){ string a,b; cin >> a >> b; a += b; stringstream ss(a); int c; ss >> c; cout << c*2 << endl; return 0; }
[ "s1210207@gmail.com" ]
s1210207@gmail.com
c37b0e5c6bb724562c3f1cdf7f659c26192b51d8
84b4587657963c1b034aacc0141ba3918703eae2
/apps/MCF/mcf_rxmesh.h
37c2354772963e0594004781a683cca1dca7672f
[ "BSD-2-Clause" ]
permissive
Grobiel/RXMesh
7e70fad47f8d664087d8469b6ba3e249e16bd2c7
4b74907cf59abe74eb77225e8c1d1e350f3c4e7c
refs/heads/main
2023-09-03T01:12:41.376007
2021-10-06T12:31:47
2021-10-06T12:31:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,108
h
#pragma once #include <cuda_profiler_api.h> #include "mcf_rxmesh_kernel.cuh" #include "rxmesh/rxmesh_attribute.h" #include "rxmesh/rxmesh_static.h" #include "rxmesh/util/report.h" #include "rxmesh/util/timer.h" #include "rxmesh/util/vector.h" template <typename T, uint32_t patchSize> void mcf_rxmesh(RXMESH::RXMeshStatic<patchSize>& rxmesh_static, const std::vector<std::vector<T>>& Verts, const RXMESH::RXMeshAttribute<T>& ground_truth) { using namespace RXMESH; constexpr uint32_t blockThreads = 256; // Report Report report("MCF_RXMesh"); report.command_line(Arg.argc, Arg.argv); report.device(); report.system(); report.model_data(Arg.obj_file_name, rxmesh_static); report.add_member("method", std::string("RXMesh")); std::string order = "default"; if (Arg.shuffle) { order = "shuffle"; } else if (Arg.sort) { order = "sorted"; } report.add_member("input_order", order); report.add_member("time_step", Arg.time_step); report.add_member("cg_tolerance", Arg.cg_tolerance); report.add_member("use_uniform_laplace", Arg.use_uniform_laplace); report.add_member("max_num_cg_iter", Arg.max_num_cg_iter); report.add_member("blockThreads", blockThreads); ASSERT_TRUE(rxmesh_static.is_closed()) << "mcf_rxmesh only takes watertight/closed mesh without boundaries"; // Different attributes used throughout the application RXMeshAttribute<T> input_coord; input_coord.set_name("coord"); input_coord.init(Verts.size(), 3u, RXMESH::LOCATION_ALL); for (uint32_t i = 0; i < Verts.size(); ++i) { for (uint32_t j = 0; j < Verts[i].size(); ++j) { input_coord(i, j) = Verts[i][j]; } } input_coord.change_layout(RXMESH::HOST); input_coord.move(RXMESH::HOST, RXMESH::DEVICE); // S in CG RXMeshAttribute<T> S; S.set_name("S"); S.init(rxmesh_static.get_num_vertices(), 3u, RXMESH::DEVICE, RXMESH::SoA); S.reset(0.0, RXMESH::DEVICE); // P in CG RXMeshAttribute<T> P; P.set_name("P"); P.init(rxmesh_static.get_num_vertices(), 3u, RXMESH::DEVICE, RXMESH::SoA); P.reset(0.0, RXMESH::DEVICE); // R in CG RXMeshAttribute<T> R; R.set_name("P"); R.init(rxmesh_static.get_num_vertices(), 3u, RXMESH::DEVICE, RXMESH::SoA); R.reset(0.0, RXMESH::DEVICE); // B in CG RXMeshAttribute<T> B; B.set_name("B"); B.init(rxmesh_static.get_num_vertices(), 3u, RXMESH::DEVICE, RXMESH::SoA); B.reset(0.0, RXMESH::DEVICE); // X in CG RXMeshAttribute<T> X; X.set_name("X"); X.init(rxmesh_static.get_num_vertices(), 3u, RXMESH::LOCATION_ALL, RXMESH::SoA); X.copy(input_coord, RXMESH::HOST, RXMESH::DEVICE); // RXMesh launch box LaunchBox<blockThreads> launch_box; rxmesh_static.prepare_launch_box(RXMESH::Op::VV, launch_box, false, true); // init kernel to initialize RHS (B) init_B<T, blockThreads> <<<launch_box.blocks, blockThreads, launch_box.smem_bytes_dyn>>>( rxmesh_static.get_context(), X, B, Arg.use_uniform_laplace); // CG scalars Vector<3, T> alpha(T(0)), beta(T(0)), delta_new(T(0)), delta_old(T(0)), ones(T(1)); GPUTimer timer; timer.start(); // s = Ax mcf_matvec<T, blockThreads> <<<launch_box.blocks, blockThreads, launch_box.smem_bytes_dyn>>>( rxmesh_static.get_context(), input_coord, X, S, Arg.use_uniform_laplace, Arg.time_step); // r = b - s = b - Ax // p=r const uint32_t num_blocks = DIVIDE_UP(rxmesh_static.get_num_vertices(), blockThreads); init_PR<T><<<num_blocks, blockThreads>>>(rxmesh_static.get_num_vertices(), B, S, R, P); // delta_new = <r,r> R.reduce(delta_new, RXMESH::NORM2); const Vector<3, T> delta_0(delta_new); uint32_t num_cg_iter_taken = 0; while (num_cg_iter_taken < Arg.max_num_cg_iter) { // s = Ap mcf_matvec<T, blockThreads> <<<launch_box.blocks, blockThreads, launch_box.smem_bytes_dyn>>>( rxmesh_static.get_context(), input_coord, P, S, Arg.use_uniform_laplace, Arg.time_step); // alpha = delta_new / <s,p> S.reduce(alpha, RXMESH::DOT, &P); alpha = delta_new / alpha; // x = x + alpha*p X.axpy(P, alpha, ones); // r = r - alpha*s R.axpy(S, -alpha, ones); // delta_old = delta_new CUDA_ERROR(cudaStreamSynchronize(0)); delta_old = delta_new; // delta_new = <r,r> R.reduce(delta_new, RXMESH::NORM2); CUDA_ERROR(cudaStreamSynchronize(0)); // exit if error is getting too low across three coordinates if (delta_new[0] < Arg.cg_tolerance * Arg.cg_tolerance * delta_0[0] && delta_new[1] < Arg.cg_tolerance * Arg.cg_tolerance * delta_0[1] && delta_new[2] < Arg.cg_tolerance * Arg.cg_tolerance * delta_0[2]) { break; } // beta = delta_new/delta_old beta = delta_new / delta_old; // p = beta*p + r P.axpy(R, ones, beta); ++num_cg_iter_taken; CUDA_ERROR(cudaStreamSynchronize(0)); } timer.stop(); CUDA_ERROR(cudaDeviceSynchronize()); CUDA_ERROR(cudaGetLastError()); CUDA_ERROR(cudaProfilerStop()); RXMESH_TRACE( "mcf_rxmesh() took {} (ms) and {} iterations (i.e., {} ms/iter) ", timer.elapsed_millis(), num_cg_iter_taken, timer.elapsed_millis() / float(num_cg_iter_taken)); // move output to host X.move(RXMESH::DEVICE, RXMESH::HOST); // output to obj // rxmesh_static.exportOBJ("mcf_rxmesh.obj", // [&X](uint32_t i, uint32_t j) { return X(i, j); }); // Verify bool passed = true; const T tol = 0.001; for (uint32_t v = 0; v < X.get_num_mesh_elements(); ++v) { if (std::fabs(X(v, 0) - ground_truth(v, 0)) > tol * std::fabs(ground_truth(v, 0)) || std::fabs(X(v, 1) - ground_truth(v, 1)) > tol * std::fabs(ground_truth(v, 1)) || std::fabs(X(v, 2) - ground_truth(v, 2)) > tol * std::fabs(ground_truth(v, 2))) { passed = false; break; } } EXPECT_TRUE(passed); // Release allocation X.release(); B.release(); S.release(); R.release(); P.release(); input_coord.release(); // Finalize report report.add_member("start_residual", to_string(delta_0)); report.add_member("end_residual", to_string(delta_new)); report.add_member("num_cg_iter_taken", num_cg_iter_taken); report.add_member("total_time (ms)", timer.elapsed_millis()); TestData td; td.test_name = "MCF"; td.time_ms.push_back(timer.elapsed_millis() / float(num_cg_iter_taken)); td.passed.push_back(passed); report.add_test(td); report.write(Arg.output_folder + "/rxmesh", "MCF_RXMesh_" + extract_file_name(Arg.obj_file_name)); }
[ "eng.a.hassen@gmail.com" ]
eng.a.hassen@gmail.com
21e085a6121d001f5a0afcbe45cc1858b1c42def
2e43ae68653678a1f03de784de972a40bd2c8d7e
/src/cartographer_ros/cartographer_ros/cartographer_ros/kitti_trajectory_from_pbstream.cc
2b965f42cbc12fd53023abf6a6995bedd3e739de
[ "Apache-2.0" ]
permissive
Arslan-Z/dlio
c9a9c051f9c1dab82692504f27837816f3a5c9a1
5e6b0180c82bd1bed8ff5aaeb8ef2f686d2f65d9
refs/heads/master
2023-07-14T08:29:06.731314
2021-09-06T02:47:16
2021-09-06T02:47:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,276
cc
/* * Copyright 2017 The Cartographer Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <map> #include <vector> #include <string> #include <fstream> #include <sstream> #include "cartographer/io/proto_stream.h" #include "cartographer/io/proto_stream_deserializer.h" #include "cartographer/io/submap_painter.h" #include "cartographer/mapping/2d/probability_grid.h" #include "cartographer/mapping/2d/submap_2d.h" #include "cartographer/mapping/3d/submap_3d.h" #include "cartographer/mapping/proto/pose_graph.pb.h" #include "cartographer/mapping/proto/serialization.pb.h" #include "cartographer/mapping/proto/submap.pb.h" #include "cartographer/mapping/proto/trajectory_builder_options.pb.h" #include "cartographer_ros/ros_map.h" #include "cartographer_ros/submap.h" #include "gflags/gflags.h" #include "glog/logging.h" DEFINE_string(pbstream_filename, "", "Filename of a pbstream to save a kitti trahectory from."); DEFINE_string(calib_file_dir, "", "Dir of the calibration file."); DEFINE_string(traj_filestem, "traj", "Stem of the output file."); namespace cartographer_ros { namespace { using namespace std; void Split(const string& s, vector<string>& tokens, const char& delim = ' ') { tokens.clear(); size_t lastPos = s.find_first_not_of(delim, 0); size_t pos = s.find(delim, lastPos); while (lastPos != string::npos) { tokens.emplace_back(s.substr(lastPos, pos - lastPos)); lastPos = s.find_first_not_of(delim, pos); pos = s.find(delim, lastPos); } } void ReadTransform(const std::string& calib_file, Eigen::Matrix4d& T){ std::ifstream ifs(calib_file); if(!ifs.is_open()){ LOG(ERROR)<<"Open calib file failed!"; return; } std::string line; std::vector<std::string> substrs = {}; Eigen::Matrix3d R; Eigen::Vector3d t; while(getline(ifs, line)){ if(line.empty()) continue; if(line.at(0) == 'R'){ Split(line, substrs); if(substrs.size() != 10){ LOG(ERROR)<<"R has invalid size, check it!"; return; } for(int i = 1; i < 10; i++){ istringstream os(substrs[i]); double d; os >> d; R.row((i-1)/3)[(i-1)%3] = d; } }else if(line.at(0) == 'T'){ Split(line, substrs); if(substrs.size() != 4){ LOG(ERROR)<<"T has invalid size, check it!"; return; } for(int i = 1; i < 4; i++){ istringstream os(substrs[i]); double d; os >> d; t[i-1] = d; } } } ifs.close(); T.block(0,0,3,3) = R; T.block(0,3,3,1) = t; T.block(3,0,1,4) << 0,0,0,1; } void Run(const std::string& pbstream_filename, const std::string& calib_file_dir, const std::string& traj_filestem) { ::cartographer::io::ProtoStreamReader reader(pbstream_filename); ::cartographer::io::ProtoStreamDeserializer deserializer(&reader); std::string calib_imu_to_velo = calib_file_dir+"/calib_imu_to_velo.txt"; std::string calib_velo_to_cam = calib_file_dir+"/calib_velo_to_cam.txt"; Eigen::Matrix4d T_imu_to_velo, T_velo_to_cam; ReadTransform(calib_imu_to_velo, T_imu_to_velo); ReadTransform(calib_velo_to_cam, T_velo_to_cam); Eigen::Matrix4d H, H_init, T, Pose_imu; H = Eigen::Matrix4d::Identity(); T = Eigen::Matrix4d::Identity(); H_init = Eigen::Matrix4d::Identity(); Pose_imu = Eigen::Matrix4d::Identity(); // Eigen::AngleAxisd rotation_vector(-3.5 * M_PI / 180.0 , Eigen::Vector3d(0,0,1)); // Eigen::Matrix3d R_init = rotation_vector.matrix(); // H_init.block(0,0,3,3) = R_init; bool init_flag = true; T = T_velo_to_cam * T_imu_to_velo;// //真值是以相机坐标系为基准的,x:水平向右; y:竖直向下;z:水平向前 // T << 0,0,1,0, // -1,0,0,0, // 0,-1,0,0, // 0,0,0,1; /********************************************/ std::ofstream ofs(traj_filestem+".txt"); if(!ofs.is_open()) { LOG(ERROR)<<"Open kitti file failed!"; return; } ofs.setf(std::ios::scientific, std::ios::floatfield); ofs.precision(6); LOG(INFO) << "Loading trajectory nodes from serialized data."; ::cartographer::mapping::proto::SerializedData proto; const auto& pose_graph = deserializer.pose_graph(); for(const auto&traj: pose_graph.trajectory()){ for(const auto& node: traj.node()){ const ::cartographer::transform::Rigid3d global_pose = ::cartographer::transform::ToRigid3(node.pose()); Eigen::Matrix3d R = global_pose.rotation().toRotationMatrix(); Eigen::Vector3d t = global_pose.translation(); // if (init_flag == true){ // H_init.block(0,0,3,3) = R; // H_init.block(0,3,3,1) = t; // H_init.block(3,0,1,4) << 0,0,0,1; // init_flag = false; // } Pose_imu.block(0,0,3,3) = R; Pose_imu.block(0,3,3,1) = t; Pose_imu.block(3,0,1,4) << 0,0,0,1; H = T * H_init.inverse() * Pose_imu; for(int i = 0; i < 3; ++i){ for(int j = 0; j < 4; ++j){ if(i==2 && j==3) ofs << H.row(i)[j] << "\n" ; else ofs << H.row(i)[j] << " " ; } } } } // CHECK(reader.eof()); ofs.close(); LOG(INFO) << "Exported trajectory poses to kitti format."; } } // namespace } // namespace cartographer_ros int main(int argc, char** argv) { FLAGS_alsologtostderr = true; google::InitGoogleLogging(argv[0]); google::ParseCommandLineFlags(&argc, &argv, true); CHECK(!FLAGS_pbstream_filename.empty()) << "-pbstream_filename is missing."; CHECK(!FLAGS_calib_file_dir.empty()) << "-calib_file_dir is missing."; CHECK(!FLAGS_traj_filestem.empty()) << "-traj_filestem is missing."; ::cartographer_ros::Run( FLAGS_pbstream_filename, FLAGS_calib_file_dir, FLAGS_traj_filestem); }
[ "13162551729@163.com" ]
13162551729@163.com
18400b0d09326221461ea44aefbd02343e70cc0d
b3bdfe660b706f8ab6c1d11c9923e49ef9d0ac92
/CryptoSample/ShamirSecretSharing/ntl/NTL/GF2.h
48a98effc146d51e75fdaf8d6a8bd9b8f17443ea
[]
no_license
95krasovsky/SecretSharingSchemes
ee88451e945f019def1cb7c6a38e09040693f4d7
48da1f43742db9e39cd05cc0e0459b4e4b1d466d
refs/heads/master
2020-12-24T18:51:00.567236
2016-05-16T11:01:03
2016-05-16T11:01:03
58,579,186
0
0
null
null
null
null
UTF-8
C++
false
false
9,853
h
#ifndef NTL_GF2__H #define NTL_GF2__H #include <ZZ.h> #include <vector.h> NTL_OPEN_NNS // Context, Bak, and Push types, just for consistency. // They don't do anything class GF2Context { public: GF2Context() {} explicit GF2Context(long p) { if (p != 2) LogicError("GF2Context with p != 2"); } void save() {} void restore() const {} }; class GF2Bak { public: void save(); void restore(); private: GF2Bak(const GF2Bak&); // disabled void operator=(const GF2Bak&); // disabled }; class GF2Push { GF2Push(const GF2Push&); // disabled void operator=(const GF2Push&); // disabled public: GF2Push() { } explicit GF2Push(const GF2Context& context) { } explicit GF2Push(long p) { if (p != 2) LogicError("GF2Push with p != 2"); } }; class GF2X; // forward declaration class GF2 { public: typedef long rep_type; typedef GF2Context context_type; typedef GF2Bak bak_type; typedef GF2Push push_type; typedef GF2X poly_type; unsigned long _GF2__rep; GF2() : _GF2__rep(0) { } GF2(const GF2& a) : _GF2__rep(a._GF2__rep) { } explicit GF2(long a) : _GF2__rep(0) { *this = a; } GF2(INIT_VAL_TYPE, long a) : _GF2__rep(a & 1) { } GF2(INIT_LOOP_HOLE_TYPE, unsigned long a) : _GF2__rep(a) { } ~GF2() { } GF2& operator=(const GF2& a) { _GF2__rep = a._GF2__rep; return *this; } GF2& operator=(long a) { _GF2__rep = a & 1; return *this; } static long modulus() { return 2; } static GF2 zero() { return GF2(); } // for consistency GF2(INIT_NO_ALLOC_TYPE) : _GF2__rep(0) { } GF2(INIT_ALLOC_TYPE) : _GF2__rep(0) { } void allocate() { } void swap(GF2& x) { GF2 t; t = *this; *this = x; x = t; } }; class ref_GF2 { public: unsigned long *_ref_GF2__ptr; long _ref_GF2__pos; ref_GF2() : _ref_GF2__ptr(0), _ref_GF2__pos(0) { } ref_GF2(const ref_GF2& a) : _ref_GF2__ptr(a._ref_GF2__ptr), _ref_GF2__pos(a._ref_GF2__pos) { } ref_GF2(GF2& a) : _ref_GF2__ptr(&a._GF2__rep), _ref_GF2__pos(0) { } ref_GF2(INIT_LOOP_HOLE_TYPE, unsigned long *ptr, long pos) : _ref_GF2__ptr(ptr), _ref_GF2__pos(pos) { } operator const GF2() const { return GF2(INIT_LOOP_HOLE, (*_ref_GF2__ptr >> _ref_GF2__pos) & 1); } ~ref_GF2() { } ref_GF2 operator=(const ref_GF2& a) { unsigned long rval = (*a._ref_GF2__ptr >> a._ref_GF2__pos) & 1; unsigned long lval = *_ref_GF2__ptr; lval = (lval & ~(1UL << _ref_GF2__pos)) | (rval << _ref_GF2__pos); *_ref_GF2__ptr = lval; return *this; } ref_GF2 operator=(const GF2& a) { unsigned long rval = (a._GF2__rep) & 1; unsigned long lval = *_ref_GF2__ptr; lval = (lval & ~(1UL << _ref_GF2__pos)) | (rval << _ref_GF2__pos); *_ref_GF2__ptr = lval; return *this; } ref_GF2 operator=(long a) { unsigned long rval = a & 1; unsigned long lval = *_ref_GF2__ptr; lval = (lval & ~(1UL << _ref_GF2__pos)) | (rval << _ref_GF2__pos); *_ref_GF2__ptr = lval; return *this; } void swap(ref_GF2 x) { GF2 t; t = *this; *this = x; x = t; } }; // functions inline long rep(GF2 a) { return a._GF2__rep; } inline long IsZero(GF2 a) { return a._GF2__rep == 0; } inline long IsOne(GF2 a) { return a._GF2__rep == 1; } inline GF2 to_GF2(long a) { return GF2(INIT_VAL, a); } inline GF2 to_GF2(const ZZ& a) { return GF2(INIT_LOOP_HOLE, IsOdd(a)); } inline GF2 operator+(GF2 a, GF2 b) { return GF2(INIT_LOOP_HOLE, a._GF2__rep ^ b._GF2__rep); } inline GF2 operator+(GF2 a, long b) { return a + to_GF2(b); } inline GF2 operator+(long a, GF2 b) { return to_GF2(a) + b; } inline GF2 operator-(GF2 a, GF2 b) { return a + b; } inline GF2 operator-(GF2 a, long b) { return a + b; } inline GF2 operator-(long a, GF2 b) { return a + b; } inline GF2 operator-(GF2 a) { return a; } inline GF2 sqr(GF2 a) { return a; } inline GF2 operator*(GF2 a, GF2 b) { return GF2(INIT_LOOP_HOLE, a._GF2__rep & b._GF2__rep); } inline GF2 operator*(GF2 a, long b) { return a * to_GF2(b); } inline GF2 operator*(long a, GF2 b) { return to_GF2(a) * b; } inline GF2 operator/(GF2 a, GF2 b) { if (IsZero(b)) ArithmeticError("GF2: division by zero"); return a; } inline GF2 operator/(GF2 a, long b) { return a / to_GF2(b); } inline GF2 operator/(long a, GF2 b) { return to_GF2(a) / b; } inline GF2 inv(GF2 a) { return 1 / a; } inline long operator==(GF2 a, GF2 b) { return a._GF2__rep == b._GF2__rep; } inline long operator==(GF2 a, long b) { return a == to_GF2(b); } inline long operator==(long a, GF2 b) { return to_GF2(a) == b; } inline long operator!=(GF2 a, GF2 b) { return !(a == b); } inline long operator!=(GF2 a, long b) { return !(a == b); } inline long operator!=(long a, GF2 b) { return !(a == b); } GF2 power(GF2 a, long e); inline GF2 random_GF2() { return GF2(INIT_LOOP_HOLE, RandomBnd(2)); } // procedural versions inline GF2& operator+=(GF2& x, GF2 b) { return x = x + b; } inline GF2& operator+=(GF2& x, long b) { return x = x + b; } inline GF2& operator-=(GF2& x, GF2 b) { return x = x - b; } inline GF2& operator-=(GF2& x, long b) { return x = x - b; } inline GF2& operator++(GF2& x) { return x = x + 1; } inline void operator++(GF2& x, int) { x = x + 1; } inline GF2& operator--(GF2& x) { return x = x - 1; } inline void operator--(GF2& x, int) { x = x - 1; } inline GF2& operator*=(GF2& x, GF2 b) { return x = x * b; } inline GF2& operator*=(GF2& x, long b) { return x = x * b; } inline GF2& operator/=(GF2& x, GF2 b) { return x = x / b; } inline GF2& operator/=(GF2& x, long b) { return x = x / b; } inline void conv(GF2& x, long a) { x = to_GF2(a); } inline void conv(GF2& x, const ZZ& a) { x = to_GF2(a); } inline void clear(GF2& x) { x = 0; } inline void set(GF2& x) { x = 1; } inline void swap(GF2& x, GF2& y) { x.swap(y); } inline void add(GF2& x, GF2 a, GF2 b) { x = a + b; } inline void sub(GF2& x, GF2 a, GF2 b) { x = a - b; } inline void negate(GF2& x, GF2 a) { x = -a; } inline void add(GF2& x, GF2 a, long b) { x = a + b; } inline void add(GF2& x, long a, GF2 b) { x = a + b; } inline void sub(GF2& x, GF2 a, long b) { x = a - b; } inline void sub(GF2& x, long a, GF2 b) { x = a - b; } inline void mul(GF2& x, GF2 a, GF2 b) { x = a * b; } inline void mul(GF2& x, GF2 a, long b) { x = a * b; } inline void mul(GF2& x, long a, GF2 b) { x = a * b; } inline void sqr(GF2& x, GF2 a) { x = sqr(a); } inline void div(GF2& x, GF2 a, GF2 b) { x = a / b; } inline void div(GF2& x, long a, GF2 b) { x = a / b; } inline void div(GF2& x, GF2 a, long b) { x = a / b; } inline void inv(GF2& x, GF2 a) { x = inv(a); } inline void power(GF2& x, GF2 a, long e) { x = power(a, e); } inline void random(GF2& x) { x = random_GF2(); } // ref_GF2 variants...theoretically, these would // have sufficed, because of the implicit conversion // from GF2& to ref_GF2, but it may be a bit more efficient // to explicitly overload everything. Moreover, // the return types of the += type operators would // not be right. inline ref_GF2 operator+=(ref_GF2 x, GF2 b) { return x = x + b; } inline ref_GF2 operator+=(ref_GF2 x, long b) { return x = x + b; } inline ref_GF2 operator-=(ref_GF2 x, GF2 b) { return x = x - b; } inline ref_GF2 operator-=(ref_GF2 x, long b) { return x = x - b; } inline ref_GF2 operator++(ref_GF2 x) { return x = x + 1; } inline void operator++(ref_GF2 x, int) { x = x + 1; } inline ref_GF2 operator--(ref_GF2 x) { return x = x - 1; } inline void operator--(ref_GF2 x, int) { x = x - 1; } inline ref_GF2 operator*=(ref_GF2 x, GF2 b) { return x = x * b; } inline ref_GF2 operator*=(ref_GF2 x, long b) { return x = x * b; } inline ref_GF2 operator/=(ref_GF2 x, GF2 b) { return x = x / b; } inline ref_GF2 operator/=(ref_GF2 x, long b) { return x = x / b; } inline void conv(ref_GF2 x, long a) { x = to_GF2(a); } inline void conv(ref_GF2 x, const ZZ& a) { x = to_GF2(a); } inline void clear(ref_GF2 x) { x = 0; } inline void set(ref_GF2 x) { x = 1; } inline void swap(ref_GF2 x, ref_GF2 y) { x.swap(y); } inline void add(ref_GF2 x, GF2 a, GF2 b) { x = a + b; } inline void sub(ref_GF2 x, GF2 a, GF2 b) { x = a - b; } inline void negate(ref_GF2 x, GF2 a) { x = -a; } inline void add(ref_GF2 x, GF2 a, long b) { x = a + b; } inline void add(ref_GF2 x, long a, GF2 b) { x = a + b; } inline void sub(ref_GF2 x, GF2 a, long b) { x = a - b; } inline void sub(ref_GF2 x, long a, GF2 b) { x = a - b; } inline void mul(ref_GF2 x, GF2 a, GF2 b) { x = a * b; } inline void mul(ref_GF2 x, GF2 a, long b) { x = a * b; } inline void mul(ref_GF2 x, long a, GF2 b) { x = a * b; } inline void sqr(ref_GF2 x, GF2 a) { x = sqr(a); } inline void div(ref_GF2 x, GF2 a, GF2 b) { x = a / b; } inline void div(ref_GF2 x, long a, GF2 b) { x = a / b; } inline void div(ref_GF2 x, GF2 a, long b) { x = a / b; } inline void inv(ref_GF2 x, GF2 a) { x = inv(a); } inline void power(ref_GF2 x, GF2 a, long e) { x = power(a, e); } inline void random(ref_GF2 x) { x = random_GF2(); } // I/O...for input, we only provide the ref_GF2 variant NTL_SNS ostream& operator<<(NTL_SNS ostream& s, GF2 a); NTL_SNS istream& operator>>(NTL_SNS istream& s, ref_GF2 x); /* additional legacy conversions for v6 conversion regime */ inline void conv(int& x, GF2 a) { conv(x, rep(a)); } inline void conv(unsigned int& x, GF2 a) { conv(x, rep(a)); } inline void conv(long& x, GF2 a) { conv(x, rep(a)); } inline void conv(unsigned long& x, GF2 a) { conv(x, rep(a)); } inline void conv(ZZ& x, GF2 a) { conv(x, rep(a)); } inline void conv(GF2& x, GF2 a) { x = a; } inline void conv(ref_GF2 x, GF2 a) { x = a; } /* ------------------------------------- */ // Finally, we declare an specialization Vec<GF2>: template<> class Vec<GF2>; NTL_CLOSE_NNS #endif
[ "95krasovsky@gmail.com" ]
95krasovsky@gmail.com
255d1a9541b0f3b58b9206c9eba680ddd1d5f4bd
52be191f9f16bc279793123f8518ee89a8af877e
/ch.10/10.13/ex.cc
5ed785ccaff12620dc77821bf12fde4238a1d5a2
[]
no_license
liwenkui/exercise_cpp
eb53dde797645093389c2608f9b45f42cbfa2c8c
d6d3149300e9abd59dc4a86137b7e6d55ee57fa0
refs/heads/master
2021-01-11T03:04:19.996140
2017-02-01T08:16:58
2017-02-01T08:16:58
70,882,679
0
0
null
null
null
null
UTF-8
C++
false
false
416
cc
#include <algorithm> #include <string> #include <iostream> #include <list> using namespace std; bool larger(string const &str) { return str.size() - 5; } int main() { list<string> str{"hello", "hello1", "hello22"}; auto end_true = partition(str.begin(), str.end(), larger); str.erase(end_true, str.end()); for (auto const elem : str) cout << elem << " "; cout << endl; return 0; }
[ "liwenkui0229@icloud.com" ]
liwenkui0229@icloud.com
3c7840b292224663e9051a3b40435b2943e8797c
88c0e520e2389e676fea559f944109e1ee7e157b
/include/Windows.Networking.XboxLive.2_4bc8ceb3.h
acfb536c34fa130b9a3a77c8be972ded0ffa97b3
[]
no_license
jchoi2022/NtFuzz-HeaderData
fb4ecbd5399f4fac6a4982a0fb516dd7f9368118
6adc3d339e6cac072cde6cfef07eccafbc6b204c
refs/heads/main
2023-08-03T02:26:10.666986
2021-09-17T13:35:26
2021-09-17T13:35:26
407,547,359
4
0
null
null
null
null
UTF-8
C++
false
false
4,021
h
#include "winrt/impl/Windows.Networking.1.h" #include "winrt/impl/Windows.Storage.Streams.1.h" #include "winrt/impl/Windows.Networking.XboxLive.1.h" WINRT_EXPORT namespace winrt::Windows::Networking::XboxLive { } namespace winrt::impl { } WINRT_EXPORT namespace winrt::Windows::Networking::XboxLive { struct WINRT_EBO XboxLiveDeviceAddress : Windows::Networking::XboxLive::IXboxLiveDeviceAddress { XboxLiveDeviceAddress(std::nullptr_t) noexcept {} static Windows::Networking::XboxLive::XboxLiveDeviceAddress CreateFromSnapshotBase64(param::hstring const& base64); static Windows::Networking::XboxLive::XboxLiveDeviceAddress CreateFromSnapshotBuffer(Windows::Storage::Streams::IBuffer const& buffer); static Windows::Networking::XboxLive::XboxLiveDeviceAddress CreateFromSnapshotBytes(array_view<uint8_t const> buffer); static Windows::Networking::XboxLive::XboxLiveDeviceAddress GetLocal(); static uint32_t MaxSnapshotBytesSize(); }; struct WINRT_EBO XboxLiveEndpointPair : Windows::Networking::XboxLive::IXboxLiveEndpointPair { XboxLiveEndpointPair(std::nullptr_t) noexcept {} static Windows::Networking::XboxLive::XboxLiveEndpointPair FindEndpointPairBySocketAddressBytes(array_view<uint8_t const> localSocketAddress, array_view<uint8_t const> remoteSocketAddress); static Windows::Networking::XboxLive::XboxLiveEndpointPair FindEndpointPairByHostNamesAndPorts(Windows::Networking::HostName const& localHostName, param::hstring const& localPort, Windows::Networking::HostName const& remoteHostName, param::hstring const& remotePort); }; struct WINRT_EBO XboxLiveEndpointPairCreationResult : Windows::Networking::XboxLive::IXboxLiveEndpointPairCreationResult { XboxLiveEndpointPairCreationResult(std::nullptr_t) noexcept {} }; struct WINRT_EBO XboxLiveEndpointPairStateChangedEventArgs : Windows::Networking::XboxLive::IXboxLiveEndpointPairStateChangedEventArgs { XboxLiveEndpointPairStateChangedEventArgs(std::nullptr_t) noexcept {} }; struct WINRT_EBO XboxLiveEndpointPairTemplate : Windows::Networking::XboxLive::IXboxLiveEndpointPairTemplate { XboxLiveEndpointPairTemplate(std::nullptr_t) noexcept {} static Windows::Networking::XboxLive::XboxLiveEndpointPairTemplate GetTemplateByName(param::hstring const& name); static Windows::Foundation::Collections::IVectorView<Windows::Networking::XboxLive::XboxLiveEndpointPairTemplate> Templates(); }; struct WINRT_EBO XboxLiveInboundEndpointPairCreatedEventArgs : Windows::Networking::XboxLive::IXboxLiveInboundEndpointPairCreatedEventArgs { XboxLiveInboundEndpointPairCreatedEventArgs(std::nullptr_t) noexcept {} }; struct WINRT_EBO XboxLiveQualityOfServiceMeasurement : Windows::Networking::XboxLive::IXboxLiveQualityOfServiceMeasurement { XboxLiveQualityOfServiceMeasurement(std::nullptr_t) noexcept {} XboxLiveQualityOfServiceMeasurement(); static void PublishPrivatePayloadBytes(array_view<uint8_t const> payload); static void ClearPrivatePayload(); static uint32_t MaxSimultaneousProbeConnections(); static void MaxSimultaneousProbeConnections(uint32_t value); static bool IsSystemOutboundBandwidthConstrained(); static void IsSystemOutboundBandwidthConstrained(bool value); static bool IsSystemInboundBandwidthConstrained(); static void IsSystemInboundBandwidthConstrained(bool value); static Windows::Storage::Streams::IBuffer PublishedPrivatePayload(); static void PublishedPrivatePayload(Windows::Storage::Streams::IBuffer const& value); static uint32_t MaxPrivatePayloadSize(); }; struct WINRT_EBO XboxLiveQualityOfServiceMetricResult : Windows::Networking::XboxLive::IXboxLiveQualityOfServiceMetricResult { XboxLiveQualityOfServiceMetricResult(std::nullptr_t) noexcept {} }; struct WINRT_EBO XboxLiveQualityOfServicePrivatePayloadResult : Windows::Networking::XboxLive::IXboxLiveQualityOfServicePrivatePayloadResult { XboxLiveQualityOfServicePrivatePayloadResult(std::nullptr_t) noexcept {} }; }
[ "jschoi.2022@gmail.com" ]
jschoi.2022@gmail.com
a01991419340486c60229b89f8247e3e8a6cf56a
ac227cc22d5f5364e5d029a2cef83816a6954590
/applications/physbam/physbam-lib/Public_Library/PhysBAM_Solids/PhysBAM_Solids/Fracture/PAINTED_GRAIN_BOUNDARIES.h
0ba79de4ff09ce1c1a3323ec92c886703b450462
[ "BSD-3-Clause" ]
permissive
schinmayee/nimbus
597185bc8bac91a2480466cebc8b337f5d96bd2e
170cd15e24a7a88243a6ea80aabadc0fc0e6e177
refs/heads/master
2020-03-11T11:42:39.262834
2018-04-18T01:28:23
2018-04-18T01:28:23
129,976,755
0
0
BSD-3-Clause
2018-04-17T23:33:23
2018-04-17T23:33:23
null
UTF-8
C++
false
false
8,379
h
//##################################################################### // Copyright 2007, Frank Losasso. // This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt. //##################################################################### // Class PAINTED_GRAIN_BOUNDARIES //##################################################################### #ifndef __PAINTED_GRAIN_BOUNDARIES__ #define __PAINTED_GRAIN_BOUNDARIES__ #include <PhysBAM_Tools/Arrays_Computations/ARRAY_MIN_MAX.h> #include <PhysBAM_Tools/Data_Structures/HASHTABLE.h> #include <PhysBAM_Tools/Data_Structures/HASHTABLE_ITERATOR.h> #include <PhysBAM_Tools/Log/LOG.h> #include <PhysBAM_Tools/Math_Tools/min.h> #include <PhysBAM_Solids/PhysBAM_Deformables/Particles/PARTICLES.h> #include <PhysBAM_Solids/PhysBAM_Solids/Fracture/FRACTURE_CALLBACKS.h> #include <PhysBAM_Solids/PhysBAM_Solids/Fracture/FRACTURE_GRAIN_BOUNDARIES.h> #include <PhysBAM_Solids/PhysBAM_Solids/Fracture/FRACTURE_OBJECT.h> namespace PhysBAM{ template<class TV,int d> class PAINTED_GRAIN_BOUNDARIES:public FRACTURE_GRAIN_BOUNDARIES<TV,d> { typedef typename TV::SCALAR T; public: int total_number_of_regions; HASHTABLE<VECTOR<int,2>,int> edge_hashtable; ARRAY<VECTOR<T,2> > edge_ratios; ARRAY<VECTOR<T,3> > particle_positions; using FRACTURE_GRAIN_BOUNDARIES<TV,d>::mesh;using FRACTURE_GRAIN_BOUNDARIES<TV,d>::seed_positions;using FRACTURE_GRAIN_BOUNDARIES<TV,d>::seed_weakness_multipliers; using FRACTURE_GRAIN_BOUNDARIES<TV,d>::seed_weakness_multipliers_callback;using FRACTURE_GRAIN_BOUNDARIES<TV,d>::node_smallest_distance;using FRACTURE_GRAIN_BOUNDARIES<TV,d>::is_breakable; using FRACTURE_GRAIN_BOUNDARIES<TV,d>::node_region;using FRACTURE_GRAIN_BOUNDARIES<TV,d>::fracture_callbacks; using FRACTURE_GRAIN_BOUNDARIES<TV,d>::Number_Of_Nodes_In_Region; PAINTED_GRAIN_BOUNDARIES(const PARTICLES<TV>& particles,const SIMPLEX_MESH<d>& mesh_input,const ARRAY<TV>& seed_positions_input,const ARRAY<T>& seed_weakness_multipliers_input,const FRAME<TV> frame, const FRACTURE_CALLBACKS<TV>* fracture_callbacks_input=0) :FRACTURE_GRAIN_BOUNDARIES<TV,d>(particles,mesh_input,seed_positions_input,seed_weakness_multipliers_input,frame,fracture_callbacks_input),total_number_of_regions(0) { particle_positions.Resize(particles.array_collection->Size()); for(int i=1;i<=particles.array_collection->Size();i++) particle_positions(i)=frame*particles.X(i); Calculate_Grain_Boundaries(particles.X,frame,node_smallest_distance,node_region,total_number_of_regions,fracture_callbacks); } void Calculate_Grain_Boundaries(ARRAY_VIEW<const TV> positions,const FRAME<TV> frame,ARRAY<T>& node_smallest_distance,ARRAY<int>& node_region,int& total_number_of_regions, const FRACTURE_CALLBACKS<TV>* fracture_callbacks=0) { assert(fracture_callbacks); // we have to have fracture callbacks for this one to access the field int number_of_positions=positions.Size(); node_smallest_distance.Resize(number_of_positions);node_region.Resize(number_of_positions); fracture_callbacks->Node_Regions(positions,node_region,frame); int max_node_region=ARRAYS_COMPUTATIONS::Max(node_region); ARRAY<int> regions_selected(max_node_region); for(int node=1;node<=number_of_positions;node++){ node_smallest_distance(node) = 1; // this should be fixed regions_selected(node_region(node))=1;} // Consolidate the regions ARRAY<int> region_mapping; for(int region=1;region<=max_node_region;region++) if(regions_selected(region)) { region_mapping.Append(region); regions_selected(region)=region_mapping.m;} total_number_of_regions=region_mapping.m; for(int node=1;node<=number_of_positions;node++) node_region(node)=regions_selected(node_region(node)); // refine the node_smallest_distance int number_of_edge_divisions=10; T divisor=(T)1/(number_of_edge_divisions+1); int number_of_edges=0; for(int tet=1;tet<=mesh.elements.m;tet++){ for(int v1=1;v1<=d;v1++) for(int v2=v1+1;v2<=d+1;v2++){ int vertex1=mesh.elements(tet)[v1],vertex2=mesh.elements(tet)[v2]; if(node_region(vertex1)!=node_region(vertex2)){ // we have a crossover edge VECTOR<int,2> edge=VECTOR<int,2>(vertex1,vertex2).Sorted(); if(!edge_hashtable.Contains(edge)) edge_hashtable.Insert(edge,++number_of_edges);}}} ARRAY<VECTOR<T,3> > edge_divisions(number_of_edges*number_of_edge_divisions); ARRAY<int> edge_division_regions(number_of_edges*number_of_edge_divisions); for(HASHTABLE_ITERATOR<VECTOR<int,2>,int> iterator(edge_hashtable);iterator.Valid();iterator.Next()){ int current_index=(iterator.Data()-1)*number_of_edge_divisions; VECTOR<int,2> edge_vertices=iterator.Key(); for(int division=1;division<=number_of_edge_divisions;division++){ T t=division*divisor; edge_divisions(current_index+division)=positions(edge_vertices.x)*t+positions(edge_vertices.y)*(1-t);}} fracture_callbacks->Node_Regions(edge_divisions,edge_division_regions,frame); edge_ratios.Resize(number_of_edges); for(HASHTABLE_ITERATOR<VECTOR<int,2>,int> iterator(edge_hashtable);iterator.Valid();iterator.Next()){ VECTOR<int,2> edge_vertices=iterator.Key(); VECTOR<T,3> vertex1=positions(edge_vertices.x),vertex2=positions(edge_vertices.y); int region1=node_region(edge_vertices.x),region2=node_region(edge_vertices.y); int region1count=0,region2count=0; int current_index=(iterator.Data()-1)*number_of_edge_divisions; for(int division=1;division<=number_of_edge_divisions;division++){ if(regions_selected(edge_division_regions(current_index+division))==region1) region1count++; if(regions_selected(edge_division_regions(current_index+division))==region2) region2count++;} T vertex1dist=(T)(region1count+(T)1)/(number_of_edge_divisions+(T)2); T vertex2dist=(T)(region2count+(T)1)/(number_of_edge_divisions+(T)2); //{std::stringstream ss;ss<<"vertex1dist: "<<vertex1dist<<", vertex2dist: "<<vertex2dist<<std::endl;LOG::filecout(ss.str());} edge_ratios(iterator.Data())=VECTOR<T,2>(vertex1dist,vertex2dist); node_smallest_distance(edge_vertices.x)=min(node_smallest_distance(edge_vertices.x),vertex1dist); node_smallest_distance(edge_vertices.y)=min(node_smallest_distance(edge_vertices.y),vertex2dist);} } void Phi_For_Region_In_Element(const int element,const int region,VECTOR<T,d+1>& phi) { ARRAY<VECTOR<T,3> > points; for(int v1=1;v1<=d;v1++){// loop through each node int current_node=mesh.elements(element)[v1]; for(int v2=v1+1;v2<=d+1;v2++){ // loop through the opposite nodes if(v2!=v1){ int opposite_node=mesh.elements(element)[v2]; VECTOR<int,2> edge=VECTOR<int,2>(current_node,opposite_node).Sorted(); int edge_index; if(edge_hashtable.Get(edge,edge_index)){ // if the edge is a cut edge, then we want to calculate the point T normalizer=(edge_ratios(edge_index).x+edge_ratios(edge_index).y); VECTOR<T,3> blend_point=edge_ratios(edge_index).y/normalizer*particle_positions(edge.x)+edge_ratios(edge_index).x/normalizer*particle_positions(edge.y); points.Append(blend_point);}}}} assert(points.m>=3); PLANE<T> cut_plane(points(1),points(2),points(3)); for(int v=1;v<=d+1;v++){ int current_node=mesh.elements(element)[v]; phi[v]=fabs(cut_plane.Signed_Distance(particle_positions(current_node))); if(node_region(current_node)==region) phi[v]=-phi[v];} } int Number_Of_Regions() {return total_number_of_regions;} //##################################################################### }; } #endif
[ "quhang@stanford.edu" ]
quhang@stanford.edu
69d86da10a5f425f275e7f23c524c055915d37a5
0017c2513b58f1c4912443a15bfa35dbf4f697ca
/third_party/amo/amo/tribool.hpp
3c86a1cd1d7754bb801955e11aa07e85ead1a2a6
[ "BSD-2-Clause" ]
permissive
yang123vc/NCUI
d1977396421a98f9be83d614cfffe1497db8d1b0
a3b315ebf97d9903766efdafa42c24d4212d5ad6
refs/heads/master
2020-04-28T09:30:22.627744
2018-11-20T15:23:36
2018-11-20T15:23:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
185
hpp
#ifndef AMO_TRIBOOL_HPP__ #define AMO_TRIBOOL_HPP__ #include <amo/config.hpp> namespace amo { using boost::tribool; using boost::indeterminate; } #endif // AMO_TRIBOOL_HPP__
[ "amoylel@hotmail.com" ]
amoylel@hotmail.com
a3fa653e74294bf44a45010cec0d5256f0f66a5e
ad273708d98b1f73b3855cc4317bca2e56456d15
/aws-cpp-sdk-devicefarm/include/aws/devicefarm/DeviceFarmEndpoint.h
90bda0d2c559c85c1a14159dea11e92cad3069eb
[ "MIT", "Apache-2.0", "JSON" ]
permissive
novaquark/aws-sdk-cpp
b390f2e29f86f629f9efcf41c4990169b91f4f47
a0969508545bec9ae2864c9e1e2bb9aff109f90c
refs/heads/master
2022-08-28T18:28:12.742810
2020-05-27T15:46:18
2020-05-27T15:46:18
267,351,721
1
0
Apache-2.0
2020-05-27T15:08:16
2020-05-27T15:08:15
null
UTF-8
C++
false
false
965
h
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/devicefarm/DeviceFarm_EXPORTS.h> #include <aws/core/Region.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace DeviceFarm { namespace DeviceFarmEndpoint { AWS_DEVICEFARM_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false); } // namespace DeviceFarmEndpoint } // namespace DeviceFarm } // namespace Aws
[ "henso@amazon.com" ]
henso@amazon.com
d2a728baa2c0f72338760633ce2c97a51a982f17
04fb8dc950e6ad70d127a6292d2807cab1e1dada
/os.cpp
7552cea29158ec09427e3a47ef6fab05f73cd320
[]
no_license
krishnakkb/OS-PRO-DEMAND-PAGED-MEMORY
2f0fb9570d6758401983c090003a776916ddbaea
77c496644510bf97383396f19849df54afe863b0
refs/heads/master
2020-05-03T14:24:50.776546
2019-04-11T16:10:51
2019-04-11T16:10:51
178,676,908
0
1
null
null
null
null
UTF-8
C++
false
false
551
cpp
#include<iostream> #include<math.h> #include<conio.h> using namespace std; int main() { float pagefault_empty=8*pow(10,-3); float pagefault_modified=20*pow(10,-3); float MAT=100*pow(10,-9); float modified_time=0.70; float MApagefault=200*pow(10,-9); float pagefault_rate; // EAT<=(1-p)Memory_access_time + p(page_fault_over_head) float x=modified_time*pagefault_modified+(1-modified_time)*pagefault_empty; pagefault_rate=(MApagefault-MAT)/(x-MAT); cout<<" Maximum accaepatble page fault_rate rate is "<<pagefault_rate; }
[ "noreply@github.com" ]
noreply@github.com
a0acb070dd122fffb5de7713644ad823f66acf15
c926a145a28d7fcfb1727d2d68e61e1e3c4ffb45
/browser/gui.cpp
9dbb16dace8335507d2eb94f188bcc039be46885
[ "BSD-2-Clause" ]
permissive
ArthurSonzogni/hastur
7fa2a013e5ea8515bf669cbfdbf30f09b6337e92
87feb16e447f83f2c211020a7b83e66cf0794b3c
refs/heads/master
2023-05-05T09:04:50.266484
2021-05-16T07:52:02
2021-05-18T15:56:55
367,632,141
0
1
BSD-2-Clause
2021-05-15T12:57:48
2021-05-15T12:57:47
null
UTF-8
C++
false
false
2,519
cpp
#include "http/get.h" #include "html/parse.h" #include <fmt/format.h> #include <imgui.h> #include <imgui-SFML.h> #include <SFML/Graphics/RenderWindow.hpp> #include <SFML/System/Clock.hpp> #include <SFML/Window/Event.hpp> #include <spdlog/spdlog.h> int main() { sf::RenderWindow window{sf::VideoMode(640, 480), "gui"}; window.setFramerateLimit(60); ImGui::SFML::Init(window); char url_buf[255]{"example.com"}; sf::Clock clock; http::Response response{}; std::vector<dom::Node> dom{}; std::string dom_str{}; std::string err_str{}; while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { ImGui::SFML::ProcessEvent(event); if (event.type == sf::Event::Closed) { window.close(); } } ImGui::SFML::Update(window, clock.restart()); ImGui::Begin("Navigation"); if (ImGui::InputText( "Url", url_buf, sizeof(url_buf), ImGuiInputTextFlags_EnterReturnsTrue)) { response = http::get(url_buf); dom_str.clear(); switch (response.err) { case http::Error::Ok: { dom = html::parse(response.body); for (const auto &node : dom) { dom_str += dom::to_string(node); dom_str += '\n'; } break; } case http::Error::Unresolved: { err_str = fmt::format("Unable to resolve endpoint for '{}'", url_buf); spdlog::error(err_str); break; } case http::Error::Unhandled: { err_str = fmt::format("Unhandled protocol for '{}'", url_buf); spdlog::error(err_str); break; } } } if (response.err != http::Error::Ok) { ImGui::Text("%s", err_str.c_str()); } ImGui::End(); ImGui::Begin("HTTP Response"); if (ImGui::CollapsingHeader("Header")) { ImGui::Text("%s", response.header.c_str()); } if (ImGui::CollapsingHeader("Body")) { ImGui::Text("%s", response.body.c_str()); } ImGui::End(); ImGui::Begin("DOM"); ImGui::Text("%s", dom_str.c_str()); ImGui::End(); window.clear(); ImGui::SFML::Render(window); window.display(); } ImGui::SFML::Shutdown(); }
[ "dev@robinlinden.eu" ]
dev@robinlinden.eu
cc5ad59182257b14a27f68bd4f162ded4a2327b8
9e10cb8430058a76321543914a421a5bd5a28b3c
/Contoller/HTTPServer/Assessment5_Controller/HTTPServer/Handler/FsHandler.cpp
4f2b4a08658956e1d7bf46405b1946211fe5443c
[]
no_license
akashpayne/java-assessments-and-learning
446134ad571b6d2022fad1e4513e67afc0d9bddd
bc89dd8aca1a3adaa44de88d6ec991b77b4e708d
refs/heads/master
2021-01-01T20:31:41.888904
2017-08-04T11:38:45
2017-08-04T11:38:45
98,881,338
0
0
null
null
null
null
UTF-8
C++
false
false
3,463
cpp
/* FsHandler.cpp */ #include "mbed.h" #include "FsHandler.h" #define DEBUG #include "hl_debug.h" static int matchstrings(const char* one, const char* two) { int m = 0; for (m = 0; m < min(strlen(one), strlen(two)) ; m++) { if (one[m] != two[m]) return m; } return m; } std::map<const char*, const char*> HTTPFsRequestHandler::m_fsMap; HTTPFsRequestHandler::HTTPFsRequestHandler(const char* rootPath, const char* localPath, HTTPConnection::HTTPMessage& Msg, TCPSocketConnection& Tcp) : HTTPRequestHandler(Msg, Tcp) { m_rootPath = rootPath; m_localPath = localPath; string myPath = m_rootPath + m_localPath; // Now replace the virtual root path with a mounted device path std::map<const char*, const char*>::iterator it; const char *bestMatch = NULL; const char *bestMatchExchange = NULL; int match_ind = -1; for (it = m_fsMap.begin() ; it != m_fsMap.end() ; it++) { // find best match (if the given logical path is containted in the root int s = matchstrings(myPath.c_str(), it->second); INFO("Matching Root %s with handler %s results in %d identical characters\n", myPath.c_str(), it->second, s); if ((s == strlen(it->second)) && (s > match_ind)) { match_ind = s; bestMatch = it->first; bestMatchExchange = it->second; } } if (bestMatch != NULL) { m_rootPath = bestMatch; m_localPath = string(myPath).substr(strlen(bestMatchExchange)); } handleRequest(); } HTTPFsRequestHandler::~HTTPFsRequestHandler() { } int HTTPFsRequestHandler::handleGetRequest() { HTTPHeaders headers; if (m_localPath.length() > 4) getStandardHeaders(headers, m_localPath.substr(m_localPath.length()-4).c_str()); else getStandardHeaders(headers); INFO("Handling Get Request (root = %s, local = %s).", m_rootPath.c_str(), m_localPath.c_str()); int retval = 0; //success std::string reqPath; // Check if we received a directory with the local bath if ((m_localPath.length() == 0) || (m_localPath.substr( m_localPath.length()-1, 1) == "/")) { // yes, we shall append the default page name m_localPath += "index.html"; } reqPath = m_rootPath + m_localPath; INFO("Mapping \"%s\" to \"%s\"", msg.uri.c_str(), reqPath.c_str()); FILE *fp = fopen(reqPath.c_str(), "r"); if (fp != NULL) { char * pBuffer = NULL; int sz = 8192; while( pBuffer == NULL) { sz /= 2; pBuffer = (char*)malloc(sz); if (sz < 128) error ("OutOfMemory"); } // File was found and can be returned // first determine the size fseek(fp, 0, SEEK_END); long size = ftell(fp); fseek(fp, 0, SEEK_SET); startResponse(200, size); while(!feof(fp) && !ferror(fp)) { int cnt = fread(pBuffer, 1, sz , fp); if (cnt < 0) cnt = 0; processResponse(cnt, pBuffer); } delete pBuffer; endResponse(); fclose(fp); } else { retval = 404; ERR("Requested file was not found !"); } return retval; } int HTTPFsRequestHandler::handlePostRequest() { return 404; } int HTTPFsRequestHandler::handlePutRequest() { return 404; }
[ "akashpayne@gmail.com" ]
akashpayne@gmail.com
dab937508fbfac6bf702d93972ec537bf975cb1c
f83e2e28e9b8a19a4b261c83ac3bc38f0aab9b45
/6th sem/fs/pgm6.cpp
7c8475df7d8042aff826c9ee5c9ce86393c40458
[ "MIT" ]
permissive
rohanwe/VTU-IS-LAB-MANUAL
373cc1560d334363929f7aecfdde4aeadca29d3a
4aeafca034d0b32c413c1aabf8a6ce051eeacc1f
refs/heads/master
2020-05-18T19:40:36.519331
2019-03-14T08:54:14
2019-03-14T08:54:14
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,828
cpp
#include<stdio.h> #include<conio.h> #include<string.h> #include<iostream.h> #include<process.h> #include<values.h> #include<fstream.h> #include<stdlib.h> class record { public: char name[20], usn[20], branch[20], ind[5]; } rec[20]; char st_no[5]; int no=0,no1; record re[20]={NULL}; record re1[20]={NULL}; void primsort() { fstream fle1; fle1.open("i.txt",ios::out); for(int i=0;i<no;i++) re[i]=rec[i]; record temp; for(i=0;i<=no-2;i++) for(int j=0;j<=no-2-i;j++) if(strcmp(re[j].usn,re[j+1].usn)>0) { temp=re[j]; re[j]=re[j+1]; re[j+1]=temp; } for(j=0;j<no;j++) { i=0; while(strcmp(re[j].usn,rec[i].usn)!=0) i++; if(strcmp(re[j].usn,rec[i].usn)==0) fle1<<re[j].usn<<"|"<<i<<"\n"; } fle1.close(); } void secsort() { fstream fle2; fle2.open("s.txt",ios::out); for(int i=0;i<no;i++) re1[i]=rec[i]; record temp; for(i=0;i<=no-2;i++) for(int j=0;j<=no-2-i;j++) if(strcmp(re1[j].name,re1[j+1].name)>0) { temp=re1[j]; re1[j]=re1[j+1]; re1[j+1]=temp; } for(j=0;j<no;j++) { fle2<<re1[j].name<<"|"<<re1[j].usn<<"\n"; } fle2.close(); } void pack() { fstream fle1,fle2,fle3; fle2.open("r.txt",ios::out); if(!fle2) { cout<<"Cant open either\n"; getch(); exit(0); } for(int i=0;i<no;i++) { fle2<<i<<"|"<<rec[i].name<<"|"<<rec[i].usn<<"|"<<rec[i].branch<<"\n"; } fle2.close(); primsort(); secsort(); } void unpack() { fstream fle2; fle2.open("r.txt",ios::in); for(int i=0;i<no;i++) { fle2.getline(rec[i].ind,5,'|'); fle2.getline(rec[i].name,20,'|'); fle2.getline(rec[i].usn,20,'|'); fle2.getline(rec[i].branch,20,'\n'); } fle2.close(); } void search() { char name[20],usn[20],branch[20],ind[5]; unpack(); for(int i=0;i<no;i++) if(strcmp(st_no,rec[i].ind)==0) { cout<<"Search success\n"; cout<<"name="<<rec[i].name<<"\tusn="<<rec[i].usn<<"\tbranch="<<rec[i].branch<<"\n"; return; } } void delete_rec(char rt_no[]) { int flag=1; char name[20],usn[20],branch[20]; unpack(); for(int i=0;i<no;i++) if(strcmp(rec[i].usn,rt_no)==0) flag=i; if(flag==-1) { cout<<"Error\n"; getch(); exit(0); } if(flag==no-1) { no--; } else { for(i=flag;i<no;i++) rec[i]=rec[i+1]; no--; } cout<<"Deleted\n"; pack(); return; } void main() { char st_name[20],rt_usn[20],st_usn[20]; fstream fle1,fle2,fle3; char name[20],usn[20],branch[20],ind[5]; int i=0, flag, ch; clrscr(); for(;;) { cout<<"1:add\n2.search\n3.delete\n4.display\n"; cout<<"Enter your choice\n"; cin>>ch; switch(ch) { case 1: cout<<"Enter the details of students\n"; cout<<"name="; cin>>rec[i].name; cout<<"usn="; cin>>rec[i].usn; cout<<"branch="; cin>>rec[i].branch; for(int j=0;j<i;j++) { if(strcmp(rec[i].usn,rec[j].usn)==0) { printf("\n duplicate entry of usn"); break; } } if(j==i) { no++; i++; pack(); } break; case 2: cout<<"Enter the name you want to search\n"; cin>>st_name; fle3.open("s.txt",ios::in); fle1.open("i.txt",ios::in); if(!fle1) { cout<<"Cant open the file\n"; getch(); exit(0); } flag=0; for(j=0;j<no;j++) { fle3.getline(name,20,'|'); fle3.getline(usn,20,'\n'); if(strcmp(st_name,name)==0) { for(int k=0;k<no;k++) { fle1.getline(rt_usn,20,'|'); fle1.getline(st_no,5,'\n'); if(strcmp(usn,rt_usn)==0) { search(); flag=1; // break; } } } } if(!flag) cout<<"Not found\n"; fle3.close(); fle1.close(); break; case 3: cout<<"Enter the usn you want to delete\n"; cin>>usn; fle3.open("s.txt",ios::in); fle1.open("i.txt",ios::in); if(!fle1||!fle3) { cout<<"Cant open the file\n"; getch(); exit(0); } flag=0; for(j=0;j<no;j++) { fle3.getline(name,20,'|'); fle3.getline(st_usn,20,'\n'); if(strcmp(usn,st_usn)==0) { for(int k=0;k<no;k++) { fle1.getline(rt_usn,20,'|'); fle1.getline(st_no,5,'\n'); if(strcmp(rt_usn,usn)==0) { delete_rec(rt_usn); i--; flag=1; } } } } if(!flag) cout<<"Failure\n"; fle1.close(); fle3.close(); break; case 4: for(int k=0;k<no;k++) cout<<"name="<<rec[k].name<<"\tusn="<<rec[k].usn<<"\tbranch="<<rec[k].branch<<"\n"; break; default:exit(0); break; } } }
[ "noreply@github.com" ]
noreply@github.com
b796670ce3af6bd34cdcc2491b15770520195bc5
50c03f22963fa6b98a96d6e4c5a412b5429327ce
/Lines/PaintObject.h
645bec26f538d5ca96436e6ccb35db0219863684
[]
no_license
Diodex/Lines
05bfd03e1e28df249aef735696bf35823d29d72e
002d643022681d3b9f4192d9c75db6066d0e8dd9
refs/heads/master
2021-01-22T09:58:05.089039
2013-12-09T04:03:34
2013-12-09T04:03:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
554
h
#ifndef PAINTOBJECT_H #define PAINTOBJECT_H #include <QtOpenGL> #include <iostream> class PaintObject abstract{ public: virtual void paint() abstract; virtual ~PaintObject(); }; class Desk : public PaintObject{ public: void paint(); }; class GamePoint : public PaintObject{ private: int id; public: static int countofpoint; GamePoint(int x, int y); GamePoint(int x, int y, int color); ~GamePoint(); int active,del,color,x,y; void paint(); void moveup(); void moveleft(); void moveright(); void movedown(); }; #endif //PAINTOBJECT_H
[ "Petrigr@gmail.com" ]
Petrigr@gmail.com
d7b749962df8a407ae3fff0e48f9f950a623c491
d33fb052605cc62a7c0261679415aca909a84b83
/thrift/lib/cpp2/server/Cpp2Worker.cpp
282feafb3141e26387c2a0c5638237d8522e4d94
[ "Apache-2.0" ]
permissive
UIKit0/fbthrift
148bd256b4b1dc54713b36dc113b12e97fe61e56
89a574dc5948419b1f8d0f3c509aa8a5356d46d7
refs/heads/master
2020-12-26T01:28:48.384313
2014-03-15T00:56:22
2014-03-18T17:19:21
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,329
cpp
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "thrift/lib/cpp2/server/Cpp2Worker.h" #include "thrift/lib/cpp2/server/Cpp2Connection.h" #include "thrift/lib/cpp2/server/ThriftServer.h" #include "thrift/lib/cpp/async/TAsyncSocket.h" #include "thrift/lib/cpp/async/TAsyncSSLSocket.h" #include "thrift/lib/cpp/concurrency/Util.h" #include <iostream> #include <sys/socket.h> #include <sys/uio.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <netdb.h> #include <fcntl.h> #include <errno.h> #include <assert.h> #include <glog/logging.h> #include "folly/String.h" DEFINE_int32(pending_interval, 10, "Pending count interval in ms"); namespace apache { namespace thrift { using namespace apache::thrift::server; using namespace apache::thrift::transport; using namespace apache::thrift::async; using std::shared_ptr; using apache::thrift::concurrency::Util; /** * Creates a new connection either by reusing an object off the stack or * by allocating a new one entirely */ std::shared_ptr<Cpp2Connection> Cpp2Worker::createConnection( std::shared_ptr<TAsyncSocket> asyncSocket, const TSocketAddress* addr) { VLOG(4) << "Cpp2Worker: Creating connection for socket " << asyncSocket->getFd(); std::shared_ptr<Cpp2Connection> result( new Cpp2Connection(asyncSocket, addr, this)); activeConnections_.insert(result); scheduleIdleConnectionTimeout(result.get()); VLOG(4) << "created connection for fd " << asyncSocket->getFd(); return result; } void Cpp2Worker::scheduleTimeout( apache::thrift::async::HHWheelTimer::Callback* callback, std::chrono::milliseconds timeout) { timer_->scheduleTimeout(callback, timeout); } void Cpp2Worker::scheduleIdleConnectionTimeout(Cpp2Connection* con) { if (server_->getIdleTimeout() > std::chrono::milliseconds(0)) { scheduleTimeout(con, server_->getIdleTimeout()); } } void Cpp2Worker::connectionAccepted(int fd, const TSocketAddress& clientAddr) noexcept { TAsyncSocket *asyncSock = nullptr; TAsyncSSLSocket *sslSock = nullptr; auto observer = server_->getObserver(); if (server_->maxConnections_ > 0 && (activeConnections_.size() >= server_->maxConnections_ / server_->nWorkers_) ) { if (observer) { observer->connDropped(); } close(fd); return; } if (server_->getSSLContext()) { sslSock = new TAsyncSSLSocket(server_->getSSLContext(), &eventBase_, fd, true); asyncSock = sslSock; } else { asyncSock = new TAsyncSocket(&eventBase_, fd); } asyncSock->setShutdownSocketSet(server_->shutdownSocketSet_.get()); if (sslSock != nullptr) { // The connection may be deleted in sslAccept(). sslSock->sslAccept(this, server_->getIdleTimeout().count()); } else { finishConnectionAccepted(asyncSock); } if (observer) { observer->connAccepted(); } VLOG(4) << "accepted connection for fd " << fd; } void Cpp2Worker::handshakeSuccess(TAsyncSSLSocket *sock) noexcept { VLOG(4) << "Handshake succeeded"; finishConnectionAccepted(sock); } void Cpp2Worker::handshakeError(TAsyncSSLSocket *sock, const TTransportException& ex) noexcept { VLOG(1) << "Cpp2Worker: SSL handshake failed: " << folly::exceptionStr(ex); sock->destroy(); } void Cpp2Worker::finishConnectionAccepted(TAsyncSocket *asyncSocket) { // Create a new Cpp2Connection for this client socket. std::shared_ptr<Cpp2Connection> clientConnection; std::shared_ptr<TAsyncSocket> asyncSocketPtr( asyncSocket, TDelayedDestruction::Destructor()); try { TSocketAddress clientAddr; asyncSocketPtr->getPeerAddress(&clientAddr); clientConnection = createConnection(asyncSocketPtr, &clientAddr); } catch (...) { // Fail fast if we could not create a Cpp2Connection object LOG(ERROR) << "Cpp2Worker: failed to create a new Cpp2Connection: " << folly::exceptionStr(std::current_exception()); return; } // begin i/o on connection clientConnection->start(); } void Cpp2Worker::acceptError(const std::exception& ex) noexcept { // We just log an error message if an accept error occurs. // Most accept errors are transient (e.g., out of file descriptors), so we // will continue trying to accept new connections. LOG(WARNING) << "Cpp2Worker: error accepting connection: " << folly::exceptionStr(ex); } void Cpp2Worker::acceptStopped() noexcept { if (server_->getStopWorkersOnStopListening()) { stopEventBase(); } } void Cpp2Worker::stopEventBase() noexcept { eventBase_.terminateLoopSoon(); } /** * All the work gets done here via callbacks to acceptConnections() and * to the handler functions in TAsyncSocket */ void Cpp2Worker::serve() { try { // Inform the TEventBaseManager that our TEventBase will be used // for this thread. This relies on the fact that Cpp2Worker always // starts in a brand new thread, so nothing else has tried to use the // TEventBaseManager to get an event base for this thread yet. server_->getEventBaseManager()->setEventBase(&eventBase_, false); // Set up HHWheelTimer. It manages connection idle timeout as well as // request timeout. timer_.reset(new HHWheelTimer(&eventBase_)); // No events are registered by default, loopForever. eventBase_.loopForever(); // Inform the TEventBaseManager that our TEventBase is no longer valid. // This prevents iterations over the manager's TEventBases from // including this one, which will soon be destructed. server_->getEventBaseManager()->clearEventBase(); } catch (TException& tx) { LOG(ERROR) << "Cpp2Worker::serve: " << folly::exceptionStr(tx); } } void Cpp2Worker::closeConnection( std::shared_ptr<Cpp2Connection> connection) { activeConnections_.erase(connection); connection->stop(); } void Cpp2Worker::closeConnections() { for (auto& connection : activeConnections_) { connection->stop(); } activeConnections_.clear(); } Cpp2Worker::~Cpp2Worker() { closeConnections(); eventBase_.terminateLoopSoon(); } int Cpp2Worker::pendingCount() { auto now = std::chrono::steady_clock::now(); // Only recalculate once every pending_interval if (pendingTime_ < now) { pendingTime_ = now + std::chrono::milliseconds(FLAGS_pending_interval); pendingCount_ = 0; for (auto& connection : activeConnections_) { if (connection->pending()) { pendingCount_++; } } } return pendingCount_; } int Cpp2Worker::getPendingCount() { return pendingCount_; } }} // apache::thrift
[ "davejwatson@fb.com" ]
davejwatson@fb.com
4e3787ec91acec46976701a45415ef46b693f289
b6fcf4c5c9277c055c42227ef0e1eb358462eb08
/IMU_sample_code.ino
d1e8ca9889f7c851fedf38bd6a6a653657adba98
[]
no_license
alex-dinh/Quadcopter
24b8357f5b787dc4f79a776e5b9ab0bfad67adc1
b2cf609a6b9b8e6f57c153c6ebc21207ce3400ae
refs/heads/master
2021-06-16T11:12:55.063263
2017-05-09T23:20:39
2017-05-09T23:20:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,790
ino
/* This code is a simplified example that prints out all readings from the IMU. * Three types of sensors - accelerometers, gyroscopes, and a magnetometer - * provide 3-axis acceleration data, 3-axis rotational velocity data, * and compass heading data. */ /* Include libraries required for IMU sensor */ #include <Wire.h> #include <SPI.h> #include <SparkFunLSM9DS1.h> LSM9DS1 imu; // Name IMU object "imu" /* Declare Variables used by IMU. Float means the variable can have decimal places */ float roll; float pitch; float heading; float AX; float AY; float AZ; float MX; float MY; float MZ; #define LSM9DS1_M 0x1E #define LSM9DS1_AG 0x6B #define PRINT_CALCULATED // This line is active - the more-useful calculated values will print - see below // #define PRINT_RAW // This line is not active (commented out) #define PRINT_SPEED 250 #define DECLINATION -12 // Irvine, CA declination void setup() { Serial.begin(9600); /* Required settings for IMU communication */ imu.settings.device.commInterface = IMU_MODE_I2C; imu.settings.device.mAddress = LSM9DS1_M; imu.settings.device.agAddress = LSM9DS1_AG; if (!imu.begin()) // This line means "If the IMU does NOT(!) begin, print the following message..." { Serial.println("Failed to communicate with LSM9DS1."); Serial.println("Double-check wiring."); Serial.println("Default settings in this sketch will " \ "work for an out of the box LSM9DS1 " \ "Breakout, but may need to be modified " \ "if the board jumpers are."); while (1); // wait forever } } void loop() { //print gyro values imu.readGyro(); Serial.print("G: "); #ifdef PRINT_CALCULATED // The values calcuated are in units [degrees / second] Serial.print(imu.calcGyro(imu.gx), 2); Serial.print(", "); Serial.print(imu.calcGyro(imu.gy), 2); Serial.print(", "); Serial.print(imu.calcGyro(imu.gz), 2); Serial.println(" deg/s"); #elif defined PRINT_RAW Serial.print(imu.gx); Serial.print(", "); Serial.print(imu.gy); Serial.print(", "); Serial.println(imu.gz); #endif //print accel values imu.readAccel(); Serial.print("A: "); #ifdef PRINT_CALCULATED // The values calculated are in units [g's] where 1g = 9.81 m/s^2 Serial.print(imu.calcAccel(imu.ax), 2); Serial.print(", "); Serial.print(imu.calcAccel(imu.ay), 2); Serial.print(", "); Serial.print(imu.calcAccel(imu.az), 2); Serial.println(" g"); #elif defined PRINT_RAW Serial.print(imu.ax); Serial.print(", "); Serial.print(imu.ay); Serial.print(", "); Serial.println(imu.az); #endif //print mag values imu.readMag(); Serial.print("M: "); #ifdef PRINT_CALCULATED // The values calcuated are in units [gauss] Serial.print(imu.calcMag(imu.mx), 2); Serial.print(", "); Serial.print(imu.calcMag(imu.my), 2); Serial.print(", "); Serial.print(imu.calcMag(imu.mz), 2); Serial.println(" gauss"); #elif defined PRINT_RAW Serial.print(imu.mx); Serial.print(", "); Serial.print(imu.my); Serial.print(", "); Serial.println(imu.mz); #endif //calculate attitude values AX = imu.ax; AY = imu.ay; AZ = imu.az; MX = imu.mx; MY = imu.my; MZ = imu.mz; roll = atan2(AY, AZ); roll *= 180.0 / PI; // Angle of roll [degrees] pitch = atan2(-AX, sqrt(AY * AY + AZ * AZ)); pitch *= 180.0 / PI; // Angle of pitch [degrees] heading = atan2(MY, MX); heading -= DECLINATION * PI / 180; heading *= 180.0 / PI; // Angle of heading [degrees] where 0 deg = 360 deg = North Serial.print(roll,2); Serial.print(", "); Serial.print(pitch,2); Serial.print(", "); Serial.println(heading,2); Serial.println(" "); delay(500); }
[ "noreply@github.com" ]
noreply@github.com
13c11540d98a1b80027b03291c1dd35fbb8fc4ca
fb2a6fe5ec47d91b728f1e1c2efb82c979eae8c2
/src/tdme/engine/subsystems/postprocessing/PostProcessingShaderBlurImplementation.cpp
b9e067899c15f5b7175b421e9c3b906263c3b63c
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
whztt07/tdme2
1b324e40c4613a3ab84238d94d1225cdb317ed3f
3f3dbad4c6db565f934c4f8d73096e975bca9a92
refs/heads/master
2020-06-25T23:54:25.977088
2019-07-22T21:16:51
2019-07-22T21:16:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,598
cpp
#include <string> #include <tdme/engine/Engine.h> #include <tdme/engine/subsystems/postprocessing/PostProcessingShaderBaseImplementation.h> #include <tdme/engine/subsystems/postprocessing/PostProcessingShaderBlurImplementation.h> #include <tdme/engine/subsystems/renderer/Renderer.h> using std::string; using tdme::engine::subsystems::postprocessing::PostProcessingShaderBlurImplementation; using tdme::engine::subsystems::renderer::Renderer; using tdme::engine::Engine; bool PostProcessingShaderBlurImplementation::isSupported(Renderer* renderer) { return renderer->getShaderVersion() == "gl3"; } PostProcessingShaderBlurImplementation::PostProcessingShaderBlurImplementation(Renderer* renderer): PostProcessingShaderBaseImplementation(renderer) { } void PostProcessingShaderBlurImplementation::initialize() { auto shaderVersion = renderer->getShaderVersion(); // fragment shader fragmentShaderId = renderer->loadShader( renderer->SHADER_FRAGMENT_SHADER, "shader/" + shaderVersion + "/postprocessing", "blur_fragmentshader.c", Engine::is4K() == true?"#define HAVE_4K":"" ); if (fragmentShaderId == 0) return; // vertex shader vertexShaderId = renderer->loadShader( renderer->SHADER_VERTEX_SHADER, "shader/" + shaderVersion + "/postprocessing", "blur_vertexshader.c" ); if (vertexShaderId == 0) return; // create, attach and link program programId = renderer->createProgram(); renderer->attachShaderToProgram(programId, vertexShaderId); renderer->attachShaderToProgram(programId, fragmentShaderId); // PostProcessingShaderBaseImplementation::initialize(); }
[ "andreas@drewke.net" ]
andreas@drewke.net
f1ec2715c3607881b8e0d97c0805acc937362c03
902e56e5eb4dcf96da2b8c926c63e9a0cc30bf96
/Sources/Modules/Network/NetworkException.h
6c68bbda3f2166bf2afa3cb07b08bd03e1d5363b
[ "BSD-3-Clause" ]
permissive
benkaraban/anima-games-engine
d4e26c80f1025dcef05418a071c0c9cbd18a5670
8aa7a5368933f1b82c90f24814f1447119346c3b
refs/heads/master
2016-08-04T18:31:46.790039
2015-03-22T08:13:55
2015-03-22T08:13:55
32,633,432
2
0
null
null
null
null
UTF-8
C++
false
false
2,009
h
/* * Copyright (c) 2010, Anima Games, Benjamin Karaban, Laurent Schneider, * Jérémie Comarmond, Didier Colin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef NETWORK_NETWORKEXCEPTION_H_ #define NETWORK_NETWORKEXCEPTION_H_ #include <Core/Exception.h> namespace Network { class LM_API_NET NetworkException : public Core::Exception { public: NetworkException(const String & message) : Core::Exception(message) {}; }; }// Network #endif /*CORE_RTEXCEPTION_H_*/
[ "contact@anima-games.com@bd273c4a-bd8d-77bb-0e36-6aa87360798c" ]
contact@anima-games.com@bd273c4a-bd8d-77bb-0e36-6aa87360798c
e5a2de39e442de35c312db7e586fa0e1993e6f9b
4c25a53fa056be45c7c55bb95c20e5ce24d18df6
/src/core.cpp
5879bde0f5b7b9ac4888a9e7c4a799879c81698c
[ "BSL-1.0" ]
permissive
ohmin839/cxxpznn1
22808492e74b05a3ef8dd675771e80428870455c
220344e90339aba6e72c30ac8837ad0d2464290c
refs/heads/main
2023-06-05T08:17:50.610342
2021-06-24T14:45:21
2021-06-24T14:45:21
372,162,683
0
0
null
null
null
null
UTF-8
C++
false
false
6,854
cpp
#include "cxxpznn1/core.hpp" #include <algorithm> #include <iomanip> #include <iostream> #include <random> namespace cxxpznn1 { // Grid Grid::Grid(unsigned int size, int** grid) { this->size = size; this->grid = grid; } Grid::Grid(const Grid& other) { this->size = other.size; int** grid = new int*[this->size]; for (int i = 0; i < this->size; i++) { grid[i] = new int[this->size]; } for(int i = 0; i < this->size; i++) { for(int j = 0; j < this->size; j++) { grid[i][j] = other.grid[i][j]; } } this->grid = grid; } Grid::~Grid() { for (int i = 0; i < this->size; i++) { delete [] grid[i]; } delete [] grid; } bool Grid::operator==(const Grid& other) { if (this->size != other.size) { return false; } for (int i = 0; i < this->size; i++) { for (int j = 0; j < this->size; j++) { if (this->grid[i][j] != other.grid[i][j]) { return false; } } } return true; } bool Grid::operator!=(const Grid& other) { return !(*this == other); } // Direction std::vector<Direction::V> Direction::all_directions() { std::vector<Direction::V> dirs; dirs.push_back(Direction::V::Up); dirs.push_back(Direction::V::Right); dirs.push_back(Direction::V::Down); dirs.push_back(Direction::V::Left); return dirs; } Direction::V Direction::opposite_direction(Direction::V dir) { return (Direction::V)(-(int)dir); } // Puzzle int** Puzzle::create_initial_grid(unsigned int size) { int** grid = new int*[size+2]; for (int i = 0; i < size+2; i++) { grid[i] = new int[size+2]; } for (int i = 1; i <= size; i++) { for (int j = 1; j <= size; j++) { grid[i][j] = (i-1) * size + j; } } for (int j = 0; j <= size; j++) { grid[0][j] = -1; } for (int i = 0; i <= size; i++) { grid[i][size+1] = -1; } for (int j = size+1; j >= 1 ; j--) { grid[size+1][j] = -1; } for (int i = size+1; i >= 1 ; i--) { grid[i][0] = -1; } grid[size][size] = 0; return grid; } Puzzle::Puzzle(unsigned int size) : Grid(size+2, create_initial_grid(size)) { this->empty_row = size; this->empty_col = size; } Puzzle::~Puzzle() { } bool Puzzle::movable(Direction::V dir) { switch(dir) { case Direction::V::Up: if (grid[this->empty_row+1][this->empty_col] > 0) { return true; } break; case Direction::V::Right: if (grid[this->empty_row][this->empty_col-1] > 0) { return true; } break; case Direction::V::Down: if (grid[this->empty_row-1][this->empty_col] > 0) { return true; } break; case Direction::V::Left: if (grid[this->empty_row][this->empty_col+1] > 0) { return true; } break; default: return false; } return false; } void Puzzle::move(Direction::V dir) { if (!this->movable(dir)) { return; } else { int next_empty_row = this->empty_row; int next_empty_col = this->empty_col; switch(dir) { case Direction::V::Up: next_empty_row++; break; case Direction::V::Right: next_empty_col--; break; case Direction::V::Down: next_empty_row--; break; case Direction::V::Left: next_empty_col++; break; default: break; } this->grid[this->empty_row][this->empty_col] = this->grid[next_empty_row][next_empty_col]; this->grid[next_empty_row][next_empty_col] = 0; this->empty_row = next_empty_row; this->empty_col = next_empty_col; } } std::vector<Direction::V> Puzzle::movable_directions() { std::vector<Direction::V> dirs = Direction::all_directions(); std::vector<Direction::V> out(dirs.size()); std::copy_if(dirs.begin(), dirs.end(), out.begin(), [this](Direction::V dir){ return this->movable(dir); }); // erase-remove idiom out.erase(std::remove(out.begin(), out.end(), Direction::V::Nowhere), out.end()); return out; } Direction::V Puzzle::move_random(Direction::V prev_dir) { std::vector<Direction::V> dirs = this->movable_directions(); if (prev_dir != Direction::V::Nowhere) { Direction::V opps_dir = Direction::opposite_direction(prev_dir); // erase-remove idiom dirs.erase(std::remove(dirs.begin(), dirs.end(), opps_dir), dirs.end()); } int length = dirs.size(); std::random_device rnd; int i = rnd() % length; this->move(dirs[i]); return dirs[i]; } void Puzzle::shuffle(unsigned int shuffles) { Direction::V prev_dir = Direction::V::Nowhere; for (int i = 0; i < shuffles; i++) { prev_dir = move_random(prev_dir); } } bool Puzzle::completed() { Puzzle target(this->size-2); return *this == target; } Grid Puzzle::as_grid() { return *this; } std::ostream &operator<<(std::ostream& out, const Puzzle& pz) { unsigned int size = pz.size-2; int** grid = pz.grid; for (int i = 1; i <= size; i++) { for (int j = 1; j <= size; j++) { if (grid[i][j] != 0) { out << std::setw(3) << grid[i][j]; } else { out << std::setw(3) << " "; } } out << std::endl; } return out; } }
[ "ohmin@example.com" ]
ohmin@example.com
a6ec567f427c910c2776d7e7680d8ddcb6efaaa9
b5881a2a068172e356c308ca469b8670e44c3ea6
/ortools/math_opt/validators/enum_sets.cc
89cc967b73eefecd7b7c6f56964f2875e6e3ea5b
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-unknown-license-reference" ]
permissive
bhoeferlin/or-tools
b675fecece9a788cae58ab87f2ba774b9b307728
dfdcfb58d7228fa0ae6d0182ba9b314c7122519f
refs/heads/master
2022-02-21T16:38:31.999088
2022-02-08T14:27:44
2022-02-08T14:27:44
141,839,304
0
0
Apache-2.0
2020-11-06T17:03:34
2018-07-21T19:08:59
C++
UTF-8
C++
false
false
2,603
cc
// Copyright 2010-2021 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "ortools/math_opt/validators/enum_sets.h" #include <string> #include <tuple> #include <vector> #include "absl/strings/str_cat.h" #include "gtest/gtest.h" #include "ortools/math_opt/result.pb.h" #include "ortools/math_opt/solution.pb.h" #include "ortools/port/proto_utils.h" namespace operations_research { namespace math_opt { // portable. std::vector<FeasibilityStatusProto> AllFeasibilityStatuses() { std::vector<FeasibilityStatusProto> values; for (int f = FeasibilityStatusProto_MIN; f <= FeasibilityStatusProto_MAX; ++f) { if (FeasibilityStatusProto_IsValid(f) && f != FEASIBILITY_STATUS_UNSPECIFIED) { values.push_back(static_cast<FeasibilityStatusProto>(f)); } } return values; } std::vector<SolutionStatusProto> AllSolutionStatuses() { std::vector<SolutionStatusProto> values; for (int f = SolutionStatusProto_MIN; f <= SolutionStatusProto_MAX; ++f) { if (SolutionStatusProto_IsValid(f) && f != SOLUTION_STATUS_UNSPECIFIED) { values.push_back(static_cast<SolutionStatusProto>(f)); } } return values; } void PrintTo(const SolutionStatusProto& proto, std::ostream* os) { *os << ProtoEnumToString(proto); } void PrintTo(const FeasibilityStatusProto& proto, std::ostream* os) { *os << ProtoEnumToString(proto); } void PrintTo(const std::tuple<SolutionStatusProto, SolutionStatusProto>& proto, std::ostream* os) { *os << ProtoEnumToString(std::get<0>(proto)) << "_" << ProtoEnumToString(std::get<1>(proto)); } void PrintTo( const std::tuple<FeasibilityStatusProto, FeasibilityStatusProto>& proto, std::ostream* os) { *os << ProtoEnumToString(std::get<0>(proto)) << "_" << ProtoEnumToString(std::get<1>(proto)); } void PrintTo( const std::tuple<SolutionStatusProto, FeasibilityStatusProto>& proto, std::ostream* os) { *os << ProtoEnumToString(std::get<0>(proto)) << "_" << ProtoEnumToString(std::get<1>(proto)); } } // namespace math_opt } // namespace operations_research
[ "corentinl@google.com" ]
corentinl@google.com
f746b8c63a122e31f7ecc1dbb3d900907cb6b3e2
c85883e9ec631dd2bc68ee85d83e9527d280857f
/Source/SkookumScriptRuntime/Private/Bindings/SkUERemote.cpp
8008ed24168a3faf0a846f42eee78dd326ad1e2b
[]
no_license
FaithStudio/SkookumScript-UnrealEngine
a98760171c5b3151e9d43686adb7d7e50fd9e56d
3da067adfb061e2a7dec2e0d4be29e9991629dc4
refs/heads/master
2021-01-13T04:20:11.898975
2016-12-22T22:52:45
2016-12-22T22:52:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
17,483
cpp
//======================================================================================= // SkookumScript Plugin for Unreal Engine 4 // Copyright (c) 2015 Agog Labs Inc. All rights reserved. // // SkookumScript Remote Client // // Author: Conan Reis //======================================================================================= //======================================================================================= // Includes //======================================================================================= #include "SkUERemote.hpp" #ifdef SKOOKUM_REMOTE_UNREAL #include "SkUERuntime.hpp" #include "Bindings/SkUEBlueprintInterface.hpp" #include "../SkookumScriptRuntimeGenerator.h" #include "AssertionMacros.h" #include "Runtime/Launch/Resources/Version.h" #include "Logging/LogMacros.h" #include "Kismet/GameplayStatics.h" #include "Bindings/SkUEUtils.hpp" //#include <ws2tcpip.h> #include <AgogCore/AMethodArg.hpp> //======================================================================================= // Local Global Structures //======================================================================================= namespace { const int32_t SkUERemote_ide_port = 12357; } // End unnamed namespace //======================================================================================= // SkUERemote Methods //======================================================================================= //--------------------------------------------------------------------------------------- // Constructor // // #Author(s): Conan Reis SkUERemote::SkUERemote(FSkookumScriptRuntimeGenerator * runtime_generator_p) : m_socket_p(nullptr), m_data_idx(ADef_uint32), m_editor_interface_p(nullptr), m_runtime_generator_p(runtime_generator_p) { } //--------------------------------------------------------------------------------------- // Destructor // // #Author(s): Conan Reis SkUERemote::~SkUERemote() { } //--------------------------------------------------------------------------------------- // Processes any remotely received data and call on_cmd_recv() whenever enough data is // accumulated. // // #Author(s): Conan Reis void SkUERemote::process_incoming() { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Connected and data available? uint32 bytes_available; while (is_connected() && m_socket_p->HasPendingData(bytes_available)) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Get datum size & prep datum int32 bytes_read; uint32_t datum_size; if (m_data_idx == ADef_uint32) { // Not working on a partially filled datum so get size of new datum if (bytes_available < sizeof(uint32_t)) { // wait until there is enough data for size return; } // Read datum size from socket m_socket_p->Recv(reinterpret_cast<uint8 *>(&datum_size), sizeof(uint32_t), bytes_read); bytes_available -= sizeof(uint32_t); datum_size -= ADatum_header_size; m_data_in.ensure_size(datum_size, false); m_data_in.set_data_length(datum_size); m_data_idx = 0u; } else { datum_size = m_data_in.get_data_length(); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Begin or resume filling datum uint32_t cmd; uint32_t bytes_to_read; uint8 * buffer_p = m_data_in.get_data_writable(); while (bytes_available || (is_connected() && m_socket_p->HasPendingData(bytes_available))) { bytes_to_read = a_min(bytes_available, datum_size - m_data_idx); // Read datum data from socket m_socket_p->Recv(buffer_p + m_data_idx, bytes_to_read, bytes_read); m_data_idx += bytes_read; bytes_available = 0; // Reset to refresh on next loop if (m_data_idx == datum_size) { // Datum fully received and ready to use m_data_idx = ADef_uint32; // Parse command from IDE A_BYTE_STREAM_IN32(&cmd, &buffer_p); on_cmd_recv(eCommand(cmd), buffer_p, datum_size - 4u); // Exit filling datum while loop & look for new datum break; } // loop back and continue to try filling datum } } // While connected and has data } //--------------------------------------------------------------------------------------- // Get (ANSI) string representation of specified socket IP Address and port // // #Author(s): Conan Reis AString SkUERemote::get_socket_str(const FInternetAddr & addr) { AString str; uint8_t ipv4addr[4]; addr.GetIp(*reinterpret_cast<uint32 *>(ipv4addr)); str.ensure_size(32u); str.format("%u.%u.%u.%u:%u", ipv4addr[3], ipv4addr[2], ipv4addr[1], ipv4addr[0], addr.GetPort()); return str; } //--------------------------------------------------------------------------------------- // Get (ANSI) string representation of current socket IP Address and port // // #Author(s): Conan Reis AString SkUERemote::get_socket_str() { if (!is_connected()) { return "SkookumIDE.RemoteConnection(Disconnected)"; } ISocketSubsystem * socket_system_p = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM); TSharedRef<FInternetAddr> local_addr = socket_system_p->CreateInternetAddr(); m_socket_p->GetAddress(*local_addr); return get_socket_str(*local_addr); } //--------------------------------------------------------------------------------------- // Gets local host IP address using ini file as a guide // // #Author(s): Conan Reis TSharedPtr<FInternetAddr> SkUERemote::get_ip_address_local() { ISocketSubsystem * socket_system_p = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM); bool bind_all_b; TSharedPtr<FInternetAddr> local_addr = socket_system_p->GetLocalHostAddr(*GLog, bind_all_b); return local_addr; } //--------------------------------------------------------------------------------------- TSharedPtr<FInternetAddr> SkUERemote::get_ip_address_ide() { FString ip_file_path; TSharedPtr<FInternetAddr> ip_addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr(); // Check if there's a file named "ide-ip.txt" present in the compiled binary folder // If so, use the ip stored in it to connect to the IDE if (static_cast<SkUERuntime*>(SkUERuntime::ms_singleton_p)->content_file_exists( TEXT("ide-ip.txt"), &ip_file_path)) { FString ip_text; ip_file_path /= TEXT("ide-ip.txt"); if (FFileHelper::LoadFileToString(ip_text, *ip_file_path)) { bool is_valid; ip_addr->SetIp(*ip_text, is_valid); } } else { // "localhost" - Use local machine loop back adapter by default // Note that this is for 127.0.0.1 - the numbers are in network byte order. const uint8_t local_host_ipv4[4] = {1u, 0u, 0u, 127u}; ip_addr->SetIp(*reinterpret_cast<const uint32 *>(local_host_ipv4)); // $Note - CReis localhost is used instead of adapter address by default // Get IP address from network adapter //ip_addr = get_ip_address_local(); // If non-desktop expect SkookumIDE IP address to be specified #if ((PLATFORM_WINDOWS == 0) && (PLATFORM_MAC == 0) && (PLATFORM_LINUX == 0)) A_DPRINT("SkookumIDE Warning!\n" " Did not find ide-ip.txt in the SkookumScript compiled binary folder.\n" " It specifies the SkookumIDE IP address and without it the runtime will not be able\n" " to connect to the SkookumIDE.\n\n" " See 'Specifying the SkookumRuntime IP address' here:\n" " http://skookumscript.com/docs/v3.0/ide/ip-addresses/#specifying-the-skookumruntime-ip-address" ); #endif } ip_addr->SetPort(SkUERemote_ide_port); return ip_addr; } //--------------------------------------------------------------------------------------- // Determines if runtime connected to remote SkookumIDE // // #Author(s): Conan Reis bool SkUERemote::is_connected() const { return this && m_socket_p && (m_socket_p->GetConnectionState() == SCS_Connected); } //--------------------------------------------------------------------------------------- // Set remote connection mode. // // #Author(s): Conan Reis void SkUERemote::set_mode(eSkLocale mode) { if (m_mode != mode) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Stop old mode if (m_socket_p) { SkDebug::print(a_str_format("SkookumScript: Disconnecting... %s\n", get_socket_str().as_cstr()), SkLocale_local); ISocketSubsystem * socket_system_p = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM); if (!m_socket_p->Close()) { SkDebug::print(a_str_format(" error closing socket: %i\n", (int32)socket_system_p->GetLastErrorCode()), SkLocale_local); } // Free the memory the OS allocated for this socket socket_system_p->DestroySocket(m_socket_p); m_socket_p = NULL; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Start new mode SkRemoteBase::set_mode(mode); // $Revisit - CReis Update debug UI of SkookumIDE connection state switch (mode) { case SkLocale_embedded: set_connect_state(ConnectState_disconnected); SkDebug::print("\nSkookumScript: SkookumIDE not connected (off-line)\n\n", SkLocale_local); break; case SkLocale_runtime: { set_connect_state(ConnectState_connecting); m_socket_p = FTcpSocketBuilder(TEXT("SkookumIDE.RemoteConnection")) .AsReusable() .AsBlocking(); bool success = false; if (m_socket_p) { TSharedPtr<FInternetAddr> ip_addr = get_ip_address_ide(); SkDebug::print(a_str_format("SkookumScript: Attempting to connect to remote IDE at %s\n", get_socket_str(*ip_addr).as_cstr()), SkLocale_local); success = m_socket_p->Connect(*ip_addr); } if (!success) { SkDebug::print("\nSkookumScript: Failed attempt to connect with remote IDE!\n\n", SkLocale_local); set_mode(SkLocale_embedded); return; } SkDebug::print(a_str_format("SkookumScript: Connected %s\n", get_socket_str().as_cstr()), SkLocale_local); set_connect_state(ConnectState_authenticating); break; } } } } //--------------------------------------------------------------------------------------- // Sends a command in datum form to the remote IDE // // #Params // datum: command in datum form from a cmd_*() method // // #Modifiers: virtual // #Author(s): Conan Reis void SkUERemote::on_cmd_send(const ADatum & datum) { if (is_connected()) { int32 bytes_sent = 0; // $Note - CReis Assumes that Send() is able to transfer entire datum in 1 pass. m_socket_p->Send(datum.get_buffer(), datum.get_length(), bytes_sent); // Did sending go wrong? if (bytes_sent <= 0) { // Reconnect set_mode(SkLocale_embedded); ensure_connected(5.0); // Try again if (m_socket_p) { m_socket_p->Send(datum.get_buffer(), datum.get_length(), bytes_sent); } } } else { SkDebug::print( "SkookumScript: Remote IDE is not connected - command ignored!\n" "[Connect runtime to SkookumIDE and try again.]\n", SkLocale_local, SkDPrintType_warning); } } //--------------------------------------------------------------------------------------- // Make this editable and tell IDE about it void SkUERemote::on_cmd_make_editable() { SkProjectInfo project_info; FString error_msg(TEXT("Can't make project editable!")); #if WITH_EDITORONLY_DATA if (m_runtime_generator_p) { error_msg = m_runtime_generator_p->make_project_editable(); } #endif if (error_msg.IsEmpty()) { get_project_info(&project_info); SkRuntimeBase::ms_singleton_p->on_binary_hierarchy_path_changed(); } // Send result back cmd_make_editable_reply(FStringToAString(error_msg), project_info); } //--------------------------------------------------------------------------------------- void SkUERemote::on_cmd_freshen_compiled_reply(eCompiledState state) { // Call base class SkRemoteRuntimeBase::on_cmd_freshen_compiled_reply(state); } //--------------------------------------------------------------------------------------- void SkUERemote::on_class_updated(SkClass * class_p) { #if WITH_EDITOR AMethodArg<ISkookumScriptRuntimeEditorInterface, UClass*> editor_on_class_updated_f(m_editor_interface_p, &ISkookumScriptRuntimeEditorInterface::on_class_updated); tSkUEOnClassUpdatedFunc * on_class_updated_f = &editor_on_class_updated_f; #else tSkUEOnClassUpdatedFunc * on_class_updated_f = nullptr; #endif SkUEBlueprintInterface::get()->reexpose_class(class_p, on_class_updated_f); } //--------------------------------------------------------------------------------------- double SkUERemote::get_elapsed_seconds() { return FPlatformTime::Seconds() - GStartTime; } //--------------------------------------------------------------------------------------- void SkUERemote::wait_for_update() { FPlatformProcess::Sleep(.1f); process_incoming(); } //--------------------------------------------------------------------------------------- void SkUERemote::set_editor_interface(ISkookumScriptRuntimeEditorInterface * editor_interface_p) { m_editor_interface_p = editor_interface_p; } //--------------------------------------------------------------------------------------- bool SkUERemote::spawn_remote_ide() { #ifdef A_PLAT_PC //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Look for SkookumIDE in game/project plug-in folder first. FString plugin_root_path(IPluginManager::Get().FindPlugin(TEXT("SkookumScript"))->GetBaseDir()); FString ide_path(plugin_root_path / TEXT("SkookumIDE/SkookumIDE.exe")); // Use path of new Slate IDE if present FString slate_ide_path(plugin_root_path / TEXT("SkookumIDE/Engine/Binaries/Win64/SkookumIDE.exe")); if (FPaths::FileExists(slate_ide_path)) { ide_path = slate_ide_path; } #if (SKOOKUM & SK_DEBUG) // If IDE exists in both plugin and as a debug build, load the IDE with the newer path FString debug_slate_ide_path(FPaths::EngineDir() / TEXT("Binaries/Win64/SkookumIDE-Win64-Debug.exe")); if (FPaths::FileExists(debug_slate_ide_path)) { if (FPaths::FileExists(slate_ide_path)) { FDateTime time_stamp, debug_time_stamp; IFileManager::Get().GetTimeStampPair(*slate_ide_path, *debug_slate_ide_path, time_stamp, debug_time_stamp); if (debug_time_stamp > time_stamp) { ide_path = debug_slate_ide_path; } } else { ide_path = debug_slate_ide_path; } } #endif if (!FPaths::FileExists(ide_path)) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Couldn't find IDE UE_LOG(LogSkookum, Warning, TEXT("Could not run SkookumScript IDE!\n") TEXT("Looked in plugin folder and did not find it:\n") TEXT(" %s\n\n") TEXT("Please ensure SkookumScript IDE app is present.\n"), *ide_path); return false; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Found IDE app - now try to run it. // Path seems to need to be made fully qualified in order to work FPaths::MakePathRelativeTo(ide_path, TEXT("/")); FPlatformProcess::LaunchFileInDefaultExternalApplication(*ide_path); return true; #else return false; #endif } //--------------------------------------------------------------------------------------- void SkUERemote::get_project_info(SkProjectInfo * out_project_info_p) { // Get platform id string out_project_info_p->m_platform_id = FStringToAString(UGameplayStatics::GetPlatformName()); // Get engine id string out_project_info_p->m_engine_id.ensure_size(20); out_project_info_p->m_engine_id.format("UE%d.%d.%d-%s", ENGINE_MAJOR_VERSION, ENGINE_MINOR_VERSION, ENGINE_PATCH_VERSION, BUILT_FROM_CHANGELIST ? "Installed" : "Compiled"); // Get game name out_project_info_p->m_project_name = FStringToAString(FApp::GetGameName()); // Get project paths if any #if WITH_EDITORONLY_DATA if (m_runtime_generator_p) { out_project_info_p->m_project_path = FStringToAString(m_runtime_generator_p->get_project_file_path()); out_project_info_p->m_default_project_path = FStringToAString(m_runtime_generator_p->get_default_project_file_path()); } else #endif { // Is there an Sk project file in the usual location? FString project_path(FPaths::GameDir() / TEXT("Scripts") / TEXT("Skookum-project.ini")); if (FPaths::FileExists(project_path)) { out_project_info_p->m_project_path = FStringToAString(FPaths::ConvertRelativePathToFull(project_path)); } // Is there an Sk default project file in the usual location? FString default_project_path(IPluginManager::Get().FindPlugin(TEXT("SkookumScript"))->GetBaseDir() / TEXT("Scripts") / TEXT("Skookum-project-default.ini")); if (FPaths::FileExists(default_project_path)) { out_project_info_p->m_default_project_path = FStringToAString(FPaths::ConvertRelativePathToFull(default_project_path)); } } } #endif // SKOOKUM_REMOTE_UNREAL
[ "markus@agoglabs.com" ]
markus@agoglabs.com
83ce7ace370c16de0f1f011f3af015aa4d3238c8
836cf25c75ffcced8c1131b5af02fc7289ccdba6
/capturevideothread.h
6ab2c999d6440ea0b642c8b65f984d06f3da9b3f
[]
no_license
Astar-Li/RTMP-push-stream-based-on-Qt-and-FFMPEG
5e28c59cd92199fd874a23175f0103eb82a69814
d94a217911201df449d885560021591456982db3
refs/heads/main
2023-04-26T01:44:01.510161
2021-05-16T13:26:25
2021-05-16T13:26:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,030
h
#ifndef CAPTUREVIDEOTHREAD_H #define CAPTUREVIDEOTHREAD_H #include <QThread> #include <QImage> #include <QMutex> #include "ffmpegheader.h" class CaptureVideoThread : public QThread { Q_OBJECT public: CaptureVideoThread(); ~CaptureVideoThread(); ErrorCode init(QString videoDevName); void deInit(); void startRecord(); void stopRecord(); signals: void sigGetOneImage(QImage img); protected: void run(); private: AVFormatContext *pFormatCtxIn; AVFormatContext *pFormatCtxOut; int i,videoIndex; AVCodecContext *pCodecCtx; AVCodecContext *pCodecCtxh264; AVFrame *pFrame; AVFrame *pFrameYuv; AVFrame *pFrameRGB; uint8_t *out_buffer; uint8_t *rgb_buffer; AVStream* output_stream; struct SwsContext *img_convert_ctx; struct SwsContext *rgbimg_convert_ctx; bool mIsRun; FILE *mYuvFileName; FILE *mH264FileName; char *mOutFileName; QMutex *mMutex; }; #endif // CAPTUREVIDEOTHREAD_H
[ "noreply@github.com" ]
noreply@github.com
ecfcef95d33bc9b6b7200ea990f3140b5d2f6f62
b27505827568a99ef06c978d0a40a20d6e683da2
/create link list.c
6fe7b76dcb939a2dbd9b252ee8b6c612cdb59ff7
[]
no_license
akshitak/DSA-practicals
35856727d352ba21befc38e65dfb739410e1a62b
7d6cae131f7b13c1fcad8369180717e26e84b0b9
refs/heads/master
2020-04-08T04:54:23.250789
2018-11-25T15:26:09
2018-11-25T15:26:09
159,036,950
0
1
null
null
null
null
ISO-8859-7
C++
false
false
1,204
c
#include <stdio.h> #include <conio.h> #include <ctype.h> #define MAX 100 float st[MAX]; int top=–1; void push(float st[], float val); float pop(float st[]); float evaluatePostfixExp(char exp[]); int main() { float val; char exp[100]; printf("\n Enter any postfix expression : "); gets(exp); val = evaluatePostfixExp(exp); printf("\n Value of the postfix expression = %.2f", val); getch(); return 0; } float evaluatePostfixExp(char exp[]) { int i=0; float op1, op2, value; while(exp[i] != '\0') { if(isdigit(exp[i])) push(st, (float)(exp[i]–'0')); else { op2 = pop(st); op1 = pop(st); switch(exp[i]) { case '+': value = op1 + op2; break; case '–': value = op1 – op2; break; case '/': value = op1 / op2; break; case '*': value = op1 * op2; break; case '%': value = (int)op1 % (int)op2; break; } push(st, value); } i++; } return(pop(st)); } void push(float st[], float val) { if(top==MAX–1) printf("\n STACK OVERFLOW"); else { top++; st[top]=val; } } float pop(float st[]) { float val=–1; if(top==–1) printf("\n STACK UNDERFLOW"); else { val=st[top]; top––; } return val; }
[ "2812akshitak@gmail.com" ]
2812akshitak@gmail.com
58c3a61f156be3d37b2575e5d52022e6efc997a2
182845e81e4d7b675e876f01beef704e08cd6ac0
/hpp/iOSDevice64/Debug/uTPLb_RSA_Primitives.hpp
093288f0bb82155082ca60e16cf13e95b43d10c0
[]
no_license
jiehanlin/LockBox3
2d82ec172d7132a48d3c1a390a7e844804910613
d760a891ab3ecff373ae5b34b7bb993a69229d5b
refs/heads/master
2021-01-19T02:23:35.941577
2016-09-26T00:38:48
2016-09-26T00:38:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,003
hpp
// CodeGear C++Builder // Copyright (c) 1995, 2016 by Embarcadero Technologies, Inc. // All rights reserved // (DO NOT EDIT: machine generated header) 'uTPLb_RSA_Primitives.pas' rev: 31.00 (iOS) #ifndef Utplb_rsa_primitivesHPP #define Utplb_rsa_primitivesHPP #pragma delphiheader begin #pragma option push #pragma option -w- // All warnings off #pragma option -Vx // Zero-length empty class member #pragma pack(push,8) #include <System.hpp> #include <SysInit.hpp> #include <uTPLb_HugeCardinal.hpp> #include <System.Classes.hpp> #include <uTPLb_MemoryStreamPool.hpp> #include <uTPLb_StreamCipher.hpp> #include <uTPLb_BlockCipher.hpp> #include <uTPLb_Hash.hpp> //-- user supplied ----------------------------------------------------------- namespace Utplb_rsa_primitives { //-- forward type declarations ----------------------------------------------- //-- type declarations ------------------------------------------------------- enum DECLSPEC_DENUM TLongOpResult : unsigned char { opPass, opFail, opAbort }; struct DECLSPEC_DRECORD Utplb_rsa_primitives__1 { public: System::UnicodeString TPLB3_Version_Low; System::UnicodeString TPLB3_Version_High; }; typedef System::StaticArray<Utplb_rsa_primitives__1, 2> Utplb_rsa_primitives__2; //-- var, const, procedure --------------------------------------------------- extern DELPHI_PACKAGE int RSA_Primitives_AlgorithmVersion; static constexpr System::Int8 V3_0_0_BaseIdx = System::Int8(0x1); extern DELPHI_PACKAGE Utplb_rsa_primitives__2 RSA_Primitives_Algorithm; extern DELPHI_PACKAGE bool UseCRT; extern DELPHI_PACKAGE bool __fastcall I2OSP(Utplb_hugecardinal::THugeCardinal* x, int xLen, System::Classes::TStream* XStream, const Utplb_memorystreampool::_di_IMemoryStreamPool Pool); extern DELPHI_PACKAGE bool __fastcall OS2IP(System::Classes::TStream* XStream, int xLen, Utplb_hugecardinal::THugeCardinal* &x, const Utplb_memorystreampool::_di_IMemoryStreamPool Pool, int MaxBits); extern DELPHI_PACKAGE void __fastcall MGF1(System::Classes::TStream* mgfSeed, unsigned maskLen, System::Classes::TStream* mask); extern DELPHI_PACKAGE int __fastcall RSAES_OAEP_ENCRYPT_MaxByteLen(Utplb_hugecardinal::THugeCardinal* n); extern DELPHI_PACKAGE bool __fastcall RSAES_OAEP_ENCRYPT(Utplb_hugecardinal::THugeCardinal* n, Utplb_hugecardinal::THugeCardinal* e, System::Classes::TMemoryStream* M, System::Classes::TMemoryStream* C); extern DELPHI_PACKAGE bool __fastcall RSAES_OAEP_DECRYPT(Utplb_hugecardinal::THugeCardinal* d, Utplb_hugecardinal::THugeCardinal* n, System::Classes::TStream* C, System::Classes::TStream* M, Utplb_hugecardinal::THugeCardinal* p, Utplb_hugecardinal::THugeCardinal* q, Utplb_hugecardinal::THugeCardinal* dp, Utplb_hugecardinal::THugeCardinal* dq, Utplb_hugecardinal::THugeCardinal* qinv); extern DELPHI_PACKAGE Utplb_streamcipher::TSymetricKey* __fastcall Generate_RSA_SymetricKey(Utplb_hugecardinal::THugeCardinal* n, Utplb_hugecardinal::THugeCardinal* e, System::Classes::TStream* CipherStream, const Utplb_blockcipher::_di_IBlockCipher SymetricCipher); extern DELPHI_PACKAGE Utplb_streamcipher::TSymetricKey* __fastcall Extract_RSA_SymetricKey(Utplb_hugecardinal::THugeCardinal* d, Utplb_hugecardinal::THugeCardinal* n, Utplb_hugecardinal::THugeCardinal* p, Utplb_hugecardinal::THugeCardinal* q, Utplb_hugecardinal::THugeCardinal* dp, Utplb_hugecardinal::THugeCardinal* dq, Utplb_hugecardinal::THugeCardinal* qinv, System::Classes::TStream* CipherStream, const Utplb_blockcipher::_di_IBlockCipher SymetricCipher); extern DELPHI_PACKAGE TLongOpResult __fastcall EMSA_PSS_ENCODE(System::Classes::TStream* M, int emBits, int sLen, System::Classes::TStream* EM, Utplb_hash::TOnHashProgress CheckAbortFunc); extern DELPHI_PACKAGE TLongOpResult __fastcall EMSA_PSS_VERIFY(System::Classes::TStream* M, int emBits, int sLen, System::Classes::TStream* EM, Utplb_hash::TOnHashProgress CheckAbortFunc); extern DELPHI_PACKAGE TLongOpResult __fastcall RSASSA_PSS_SIGN(Utplb_hugecardinal::THugeCardinal* d, Utplb_hugecardinal::THugeCardinal* n, System::Classes::TStream* M, System::Classes::TStream* S, Utplb_hash::TOnHashProgress CheckAbortFunc, Utplb_hugecardinal::THugeCardinal* p, Utplb_hugecardinal::THugeCardinal* q, Utplb_hugecardinal::THugeCardinal* dp, Utplb_hugecardinal::THugeCardinal* dq, Utplb_hugecardinal::THugeCardinal* qinv); extern DELPHI_PACKAGE TLongOpResult __fastcall RSASSA_PSS_VERIFY(Utplb_hugecardinal::THugeCardinal* n, Utplb_hugecardinal::THugeCardinal* e, System::Classes::TStream* M, System::Classes::TStream* S, Utplb_hash::TOnHashProgress CheckAbortFunc); } /* namespace Utplb_rsa_primitives */ #if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_UTPLB_RSA_PRIMITIVES) using namespace Utplb_rsa_primitives; #endif #pragma pack(pop) #pragma option pop #pragma delphiheader end. //-- end unit ---------------------------------------------------------------- #endif // Utplb_rsa_primitivesHPP
[ "roman.kassebaum@kdv-dt.de" ]
roman.kassebaum@kdv-dt.de
d38d88c4aa6f503686a271f748d0fc7dff19c34b
2453a74bbbb03ff964ebf8b9e6b246819b292875
/S3/Algo/TP8_Algo.cpp
9e14571f0453b9bcaaa70285bfeb22e02f6f9674
[]
no_license
BrinonBat/Licence-Informatique-Angers
8703fdfe43fb3b580ca2e2b0175d8dd124dffffd
1df1f8a3d9f905372315253891c8bb9d8fee4f58
refs/heads/master
2021-07-25T12:33:33.928178
2020-04-17T16:01:03
2020-04-17T16:01:03
150,735,799
1
5
null
2020-02-25T13:48:44
2018-09-28T12:15:37
C++
UTF-8
C++
false
false
2,174
cpp
#include <iostream> #include <cstdlib> #include <time.h> #include <array> //DEFINITION DES STRUCTURES struct noeud; struct noeud{ noeud * abG; noeud * abD; int val; }; using ABR = noeud*; // initialisation de l'arbre en lui attribuant les valeurs prisent en paramètre void init_abr(ABR &abr, ABR abG, ABR abD, int val){ abr->abG=abG; abr->abD=abD; abr->val=val; } // ajout un entier en bout de branche void AjoutFeuille(ABR &abr, int i){ //creation de l'arbre ajouté ABR current=new noeud; init_abr(current,NULL,NULL,i); // insére à droite si la valeur est supérieur à l'arbre actuel if(i> abr->val){ if(abr->abD==NULL) abr->abD=current; else AjoutFeuille(abr->abD,i); } // insére à gauche si la valeur est égale ou inférieur à l'arbre actuel else if(i<=current->val){ if(abr->abG==NULL) abr->abG=current; else AjoutFeuille(abr->abG,i); } // cas d'erreur else std::cout<<" ERREUR dans l'ajout feuille"; } //affiche l'arbre pris en paramètre void affiche_abr(ABR arbre){ // parcours infixe, donc affichage aprés parcours gauche et avant parcours droit if(arbre!=NULL){ if(arbre->abG!=NULL) affiche_abr(arbre->abG); std::cout<<"|"<<arbre->val; if(arbre->abD!=NULL) affiche_abr(arbre->abD); } } ABR cherche_int(ABR &abr, int i){ if(i==abr->val){ return abr; } // cherche à droite si la valeur est supérieur à l'arbre actuel if(i> abr->val){ if(abr->abD!=NULL) cherche_int(abr->abD,i); } // cherche à gauche si la valeur est inférieur à l'arbre actuel if(i<abr->val){ if(abr->abG!=NULL) cherche_int(abr->abG,i); } // cas d'erreur et cas NULL else std::cout<<" ERREUR dans l'ajout feuille"; return NULL; } ABR max(ABR abr){ if(abr->abD!=NULL) return max(abr->abD); return abr; } void supp_int(ABR &abr, int supp){ ABR arbre=cherche_int(abr,supp); if(arbre==NULL); else{ } } int main(){ // creation de l'arbre ABR test=new noeud; init_abr(test,NULL,NULL,5); AjoutFeuille(test,6); AjoutFeuille(test,4); AjoutFeuille(test,1); AjoutFeuille(test,8); AjoutFeuille(test,6); AjoutFeuille(test,9); // affichage affiche_abr(test); std::cout<<"|"<<std::endl; return 0; }
[ "noreply@github.com" ]
noreply@github.com
586eb4d12cdf564b4b07b4e016f7d18195199b82
ee80ddf7d1de919847f1072f83c9ee3e3deeae02
/gwell/source/vi-kernel/vinodedescr.hh
def29c380617184f1696c330780937fbb06795e2
[]
no_license
pjakwert/gwell3d
8bef1d3616810e6a79aff12869f164cdff0ac8b5
798b928d91864ba7f2ed5b9ccd46b3d6a693908c
refs/heads/master
2020-03-26T00:42:58.091397
2018-08-10T21:48:12
2018-08-10T21:48:12
144,333,776
0
0
null
null
null
null
ISO-8859-2
C++
false
false
6,174
hh
#ifndef VINODEDESCR_HH #define VINODEDESCR_HH #ifdef __GNUG__ #pragma interface #endif #include <iostream> #include <string> #include "extstring.hh" /*! * \file vinodedescr.hh * Plik zawiera definicję klasy ViNodeDescr. Obiekty tej klasy wykorzystywane * są w funkcjach i metodach odczytu z plików opisów brył. * \author Bogdan Kreczmer * \date 2004.08 */ /*! * Obiekty tej klasy przeznaczone są do przechowywania * opisu pojedynczego węzła. Udostępnia ona metody pozwalające * wydobyć z opisu informacje o dotyczące parametrów inicjalizacji * dla poszczególnych klas hierarchi dziedziczenia obiektu * tworzącego dany węzeł. */ class ViNodeDescr: public ExtString { /*! * Pole ma znaczenie robocze. Jest wykorzystywane do szukania kolejnych * sekcji opisu inicjalizacji dla dziedziczonej klasy. * Pole to wskazuje aktualne miejsce w łańcuchu. */ std::string::size_type _SecIdx; /*! * Szuka pierwszą sekcję opisu inicjalizacji dla dziedziczonej klasy. */ bool FindFirstSecBeg() const; /*! * Szuka następną sekcję opisu inicjalizacji dla kolejnej dziedziczonej * klasy. Następna sekcja szukana jest względem wskazywnego miejsca * przez indeks \link ViNodeDescr::_SecIdx _SecIdx\endlink. * \warning Jeśli szukanie ma być przeprowadzone od początku danego * łańcucha, to najpierw należy wywołać metodę * \link ViNodeDescr::FindFirstSecBeg FindFirstSecBeg\endlink. */ bool FindNextSecBeg() const; /*! * Szuka następną linię kończącą dany opis inicjalizacji dla kolejnej * dziedziczonej * klasy. Następna sekcja szukana jest względem wskazywnego miejsca * przez indeks \link ViNodeDescr::_SecIdx _SecIdx\endlink. * \warning Jeśli szukanie ma być przeprowadzone od początku danego * łańcucha, to najpierw należy wywołać metodę * \link ViNodeDescr::FindFirstSecBeg FindFirstSecBeg\endlink. */ bool FindNextSecEnd() const; /*! * Udostępnia wartość indeksu sekcji inicjalizacji dziedziczonej klasy. */ std::string::size_type GetSecIdx() const { return _SecIdx; } public: /*! * Zwraca pozycję pierwszego "białego" znaku od następnej pozycji * za tą, która wskazywana jest * przez pole \link ViNodeDescr::_SecIdx _SecIdx\endlink. * \retval true - gdy przejście do znaku białego powiodło się. * Polu \link ViNodeDescr::_SecIdx _SecIdx\endlink zostaje * przypisana wartość indeksu tego znaku. * \retval false - w przypadku przeciwnym. Wartość pola * \link ViNodeDescr::_SecIdx _SecIdx\endlink nie ulega * zmianie. */ bool GoToSpaceChar() const; /*! * Inicjalizuje roboczy indeks szukania sekcji opisu wartością 0. */ ViNodeDescr() { _SecIdx = 0; } /*! * Podstawia dany łańcuch jako nową wartość obiektu. */ ViNodeDescr &operator = (const char *str); /*! * Podaje informacje o ilości opisów poszczególnych inicjalizacji * klas wchodzących w hierarchię dziedziczenia. * obiektu tworzącego dany węzeł. */ int ClassesNum() const; /*! * Udostępnia opis parametrów opisu inicjalizacji danej klasy * wchodzącej w hierarchię dziedziczenia danego obiektu. * \param Idx - (\b in) indeks danej klasy wchodzącej hierarchię * dziedziczenia * klasy obiektu tworzącego dany węzeł. Numeracja rozpoczyna się * od 0 (dla klasy bazowej). Finalnej klasie pochodnej * odpowiada numer * \link ViNodeDescr::ClassesNum ClassesNum\endlink - 1. * * \param Desc - (\b out) zawiera wyekstrahowany opis wybranej klasy. * \pre \e Idx musi mi być mniejszy od wartości zwracanej przez * metodę \link ViNodeDescr::ClassesNum ClassesNum\endlink. * \retval true - gdy opis takiej klasy został poprawnie udostępniony. * \retval false - gdy nie znaleziono opisu dla klasy o podanym indeksie. */ bool GetClassDescr(unsigned int Idx, ExtString &Desc) const; /*! * Udostępnia opis parametrów opisu inicjalizacji danej klasy * wchodzącej w hierarchię dziedziczenia danego obiektu. * \param ClassName - (\b in) wskazuje na łańcuch znaków stanowiący * nazwę klasy wchodzącej hierarchię dziedziczenia * dla obiektu tworzącego dany węzeł. * \param Desc - (\b out) zawiera wyekstrahowany opis wybranej klasy. * \retval true - gdy opis takiej klasy został poprawnie udostępniony. * \retval false - gdy nie znaleziono opisu dla klasy o podanej nazwie. */ bool GetClassDescr(const char *ClassName, ExtString &Desc) const; /*! * Udostępnia nazwę wybranej klasy wchodzącej w hierarchię dziedziczenia * klasy obiektu tworzącego dany węzeł. * \param Idx - (\b in) indeks danej klasy wchodzącej hierarchię * dziedziczenia klasy obiektu tworzącego dany węzeł. * Numeracja rozpoczyna się * od 0 (dla klasy bazowej). Finalnej klasie pochodnej * odpowiada numer * \link ViNodeDescr::ClassesNum ClassesNum\endlink - 1. * \param ClassName - (\b out) zawiera nazwę klasy o podanym indeksie * (jeżeli operacja powiodła się). * \retval true - gdy opis takiej klasy został poprawnie udostępniony. * \retval false - gdy nie znaleziono opisu dla klasy o podanej nazwie. * \post Metoda nie zmienia wartości pola * \link ViNodeDescr::ClassesNum ClassesNum\endlink. */ bool GetClassName(unsigned int Idx, ExtString &ClassName) const; /*! * Udostępnia nazwę finalnej klasy pochodnej. * \param ClassName - (\b out) po poprawnym zakończeniu działania zawiera * nazwę finalnej klasy pochodnej. * \retval true - jeśli opis ma poprawną składnię i znaleziona została * (oraz przepisana do \e ClassName) nazwa klasy. * \retval false - w przypadku przeciwnym. */ bool GetTopClassName(ExtString &ClassName) const; }; #endif
[ "pjakwert@gmail.com" ]
pjakwert@gmail.com
132d9a5505395ca33cc4c3025ff643dc1818cbfb
bd92e3045d69e23e814e789570c11de3809bd4ae
/Chapter-1/Exercise-F/CPP/Temperature.cpp
0c16259d69a39383a31718d5af0349259e18b9fb
[]
no_license
jbasu2013/Let-Us-C
f25127c506cc80aefae88a873759e316df0f39c0
64cc1f7e2e9086321dbd181bfd3cecc905892890
refs/heads/master
2023-06-15T05:41:53.124345
2021-07-13T18:39:43
2021-07-13T18:39:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
500
cpp
/* Author : Chaitaly Kundu Date: 18-04-21 */ /* Temperature of a city in fahrenheit degrees is input through the keyboard. Write a program to convert this temperature into centigrade degrees */ #include<bits/stdc++.h> using namespace std; /* main function */ int main() { float c, f; cout << "\nEnter the temperature in fahrenheit: "; cin >> f; /* Temperature calculation in centigrade*/ c = ((f-32)/9)*5; cout << "\nTemperature in centigrade is " << c; return 0; }
[ "chaitaly.slg01@gmail.com" ]
chaitaly.slg01@gmail.com
772f200a37b4f8848d75cb85d8f0301e883b918c
9d6947462a91a1bd5e73af40db3b75d8eb4b53db
/hw2/Graph-1414.hpp
9c556403d15c2995308a3455934253697f9b201c
[]
no_license
lalyman/peercode
5081c6edb4a50d3d80105674ad03a08706839a89
46753e2f561a62a11bc9f1ef0ec8823533218144
refs/heads/master
2020-03-11T01:06:24.081274
2018-03-10T23:05:50
2018-03-10T23:05:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
22,064
hpp
#ifndef CME212_GRAPH_HPP #define CME212_GRAPH_HPP /** @file Graph.hpp * @brief An undirected graph type */ #include <algorithm> #include <vector> #include <cassert> #include "CME212/Util.hpp" #include "CME212/Point.hpp" /** @class Graph * @brief A template for 3D undirected graphs. * * Users can add and retrieve nodes and edges. Edges are unique (there is at * most one edge between any pair of distinct nodes). */ template<typename V, typename E> class Graph { private: // HW0: YOUR CODE HERE // Use this space for declarations of important internal types you need // later in the Graph's definition. // (As with all the "YOUR CODE HERE" markings, you may not actually NEED // code here. Just use the space if you need it.) struct internal_node; struct internal_edge; public: // // PUBLIC TYPE DEFINITIONS // /** Type of this graph. */ using graph_type = Graph; /** Predeclaration of Node type. */ class Node; /** Synonym for Node (following STL conventions). */ using node_type = Node; using node_value_type = V; /** Predeclaration of Edge type. */ class Edge; /** Synonym for Edge (following STL conventions). */ using edge_type = Edge; using edge_value_type = E; /** Type of node iterators, which iterate over all graph nodes. */ class NodeIterator; /** Synonym for NodeIterator */ using node_iterator = NodeIterator; /** Type of edge iterators, which iterate over all graph edges. */ class EdgeIterator; /** Synonym for EdgeIterator */ using edge_iterator = EdgeIterator; /** Type of incident iterators, which iterate incident edges to a node. */ class IncidentIterator; /** Synonym for IncidentIterator */ using incident_iterator = IncidentIterator; /** Type of indexes and sizes. Return type of Graph::Node::index(), Graph::num_nodes(), Graph::num_edges(), and argument type of Graph::node(size_type) */ using size_type = unsigned; // // CONSTRUCTORS AND DESTRUCTOR // /** Construct an empty graph. */ Graph() { // HW0: YOUR CODE HERE num_nodes_ = 0; num_edges_ = 0; } /** Default destructor */ ~Graph() = default; // // NODES // /** @class Graph::Node * @brief Class representing the graph's nodes. * * Node objects are used to access information about the Graph's nodes. */ class Node : private totally_ordered<Node> { public: /** Construct an invalid node. * * Valid nodes are obtained from the Graph class, but it * is occasionally useful to declare an @i invalid node, and assign a * valid node to it later. For example: * * @code * Graph::node_type x; * if (...should pick the first node...) * x = graph.node(0); * else * x = some other node using a complicated calculation * do_something(x); * @endcode */ Node() { // HW0: YOUR CODE HERE graph_pointer = nullptr; n_id = 0; } /** Return this node's position. */ Point& position() const { // HW0: YOUR CODE HERE return graph_pointer->nodes[n_id].position_; } /** Return this node's index, a number in the range [0, graph_size). */ size_type index() const { // HW0: YOUR CODE HERE return n_id; } // HW1: YOUR CODE HERE // Supply definitions AND SPECIFICATIONS for: node_value_type& value(){ return this->graph_pointer->nodes[n_id].n_value_; } const node_value_type& value() const { return (const node_value_type&)this->graph_pointer->nodes[n_id].n_value_; } size_type degree() const { return this->graph_pointer->adjacency_matrix[this->n_id].size(); } incident_iterator edge_begin() const { return IncidentIterator(this->graph_pointer, this->n_id, 0); } incident_iterator edge_end() const { return IncidentIterator(this->graph_pointer, this->n_id, this->degree()); } /** Test whether this node and @a n are equal. * * Equal nodes have the same graph and the same index. */ bool operator==(const Node& n) const { // HW0: YOUR CODE HERE if (this->graph_pointer == n.graph_pointer && this->n_id == n.n_id){ return true; } else { return false; } } /** Test whether this node is less than @a n in a global order. * * This ordering function is useful for STL containers such as * std::map<>. It need not have any geometric meaning. * * The node ordering relation must obey trichotomy: For any two nodes x * and y, exactly one of x == y, x < y, and y < x is true. */ bool operator<(const Node& n) const { // HW0: YOUR CODE HERE //assert(this->graph_pointer == n.graph_pointer); if (this->index() < n.index()){ return true; } else { return false; } } private: // Allow Graph to access Node's private member data and functions. friend class Graph; // HW0: YOUR CODE HERE // Use this space to declare private data members and methods for Node // that will not be visible to users, but may be useful within Graph. // i.e. Graph needs a way to construct valid Node objects Graph* graph_pointer; size_type n_id; Node(Graph* graph, size_type index){ this->graph_pointer = graph; this->n_id = index; } /*internal_node& fetch() const { //for (size_type i = 0; i < graph_pointer->size(); ++i){ //if (graph_pointer->nodes[i].n_id_== this->n_id){ return graph_pointer->nodes[n_id]; //} //} //assert(false); }*/ }; /** Return the number of nodes in the graph. * * Complexity: O(1). */ size_type size() const { // HW0: YOUR CODE HERE return num_nodes_; } /** Synonym for size(). */ size_type num_nodes() const { return size(); } /** Add a node to the graph, returning the added node. * @param[in] position The new node's position * @post new num_nodes() == old num_nodes() + 1 * @post result_node.index() == old num_nodes() * * Complexity: O(1) amortized operations. */ Node add_node(const Point &position, const node_value_type &value = node_value_type()) { // HW0: YOUR CODE HERE // Create a new elements array internal_node new_node; new_node.position_ = position; new_node.n_id_ = num_nodes_; new_node.n_value_ = value; nodes.push_back(new_node); adjacency_matrix.push_back(std::vector<std::pair<size_type, edge_value_type>>()); ++num_nodes_; return node(num_nodes_-1); } /** Determine if a Node belongs to this Graph * @return True if @a n is currently a Node of this Graph * * Complexity: O(1). */ bool has_node(const Node& n) const { // HW0: YOUR CODE HERE if (n.index()+1 <= num_nodes_ && n.graph_pointer == this) { return true; } else { return false; } } /** Return the node with index @a i. * @pre 0 <= @a i < num_nodes() * @post result_node.index() == i * * Complexity: O(1). */ Node node(size_type i) const { // HW0: YOUR CODE HERE return Node(const_cast<Graph*>(this), i); } // EDGES // /** @class Graph::Edge * @brief Class representing the graph's edges. * * Edges are order-insensitive pairs of nodes. Two Edges with the same nodes * are considered equal if they connect the same nodes, in either order. */ class Edge : private totally_ordered<Edge> { public: /** Construct an invalid Edge. */ Edge() { // HW0: YOUR CODE HERE node_1 = Node(); node_2 = Node(); } /** Return a node of this Edge */ Node node1() const { // HW0: YOUR CODE HERE return this->node_1; // Invalid Node } /** Return the other node of this Edge */ Node node2() const { // HW0: YOUR CODE HERE return this->node_2; // Invalid Node } double length() const { return norm(node_1.position() - node_2.position()); } edge_value_type & value () { for (auto it = node_1.edge_begin(); it != node_1.edge_end(); ++it) if ((*it).node2() == node_2) return node_1.graph_pointer->adjacency_matrix[node_1.index()][it.edge_position].second; return node_1.graph_pointer->adjacency_matrix[node_1.index()][0].second; } const edge_value_type & value () const { for (auto it = node_1.edge_begin(); it != node_1.edge_end(); ++it) if ((*it).node2() == node_2) return node_1.graph_pointer->adjacency_matrix[node_1.index()][it.edge_position].second; return node_1.graph_pointer->adjacency_matrix[node_1.index()][0].second; } /** Test whether this edge and @a e are equal. * * Equal edges represent the same undirected edge between two nodes. */ bool operator==(const Edge& e) const { if ((this->node_1 == e.node_1 && this->node_2 == e.node_2) | (this->node_1 == e.node_2 && this->node_2 == e.node_1)){ return true; } return false; } /** Test whether this edge is less than @a e in a global order. * * This ordering function is useful for STL containers such as * std::map<>. It need not have any interpretive meaning. */ bool operator<(const Edge& e) const { if (std::min(this->node_1.n_id, this->node_2.n_id) < std::min(e.node_1.n_id, e.node_2.n_id) ) return true; else if (std::min(this->node_1.n_id, this->node_2.n_id) > std::min(e.node_1.n_id, e.node_2.n_id)) return false; else if (std::max(e.node_1.n_id, e.node_2.n_id) <= std::max(e.node_1.n_id, e.node_2.n_id)) return true; else return false; } private: // Allow Graph to access Edge's private member data and functions. friend class Graph; // HW0: YOUR CODE HERE // Use this space to declare private data members and methods for Edge // that will not be visible to users, but may be useful within Graph. // i.e. Graph needs a way to construct valid Edge objects Node node_1; Node node_2; Edge(Node n1, Node n2){ this->node_1 = n1; this->node_2 = n2; } }; /** Return the total number of edges in the graph. * * Complexity: No more than O(num_nodes() + num_edges()), hopefully less */ size_type num_edges() const { // HW0: YOUR CODE HERE return this->num_edges_; } /** Return the edge with index @a i. * @pre 0 <= @a i < num_edges() * * Complexity: No more than O(num_nodes() + num_edges()), hopefully less */ Edge edge(size_type i) const { size_type counter = 0; for (EdgeIterator ni = this->edge_begin(); ni != this->edge_end(); ++ ni) { if (ni.node_position < ni.graph_pointer->adjacency_matrix[ni.node_position][ni.edge_position].first) { //to count everything once // if (counter == i) return Edge(Node(const_cast<Graph*>(ni.graph_pointer), ni.node_position),Node(const_cast<Graph*> (ni.graph_pointer),ni.graph_pointer->adjacency_matrix[ni.node_position][ni.edge_position].first)); else counter++; } } return Edge(); } /** Test whether two nodes are connected by an edge. * @pre @a a and @a b are valid nodes of this graph * @return True if for some @a i, edge(@a i) connects @a a and @a b. * * Complexity: No more than O(num_nodes() + num_edges()), hopefully less */ bool has_edge(const Node& a, const Node& b) const { // HW0: YOUR CODE HERE assert(a.graph_pointer == b.graph_pointer); for (auto it = a.edge_begin(); it != a.edge_end(); ++it) { if ((*it).node2().index() == b.n_id) return true; } return false; } /** Add an edge to the graph, or return the current edge if it already exists. * @pre @a a and @a b are distinct valid nodes of this graph * @return an Edge object e with e.node1() == @a a and e.node2() == @a b * @post has_edge(@a a, @a b) == true * @post If old has_edge(@a a, @a b), new num_edges() == old num_edges(). * Else, new num_edges() == old num_edges() + 1. * * Can invalidate edge indexes -- in other words, old edge(@a i) might not * equal new edge(@a i). Must not invalidate outstanding Edge objects. * * Complexity: No more than O(num_nodes() + num_edges()), hopefully less */ Edge add_edge(const Node& a, const Node& b, const edge_value_type &value = edge_value_type()) { // HW0: YOUR CODE HERE if (has_edge(a,b)){ return Edge(a,b); } else { assert(a.graph_pointer == b.graph_pointer); std::pair<size_type,edge_value_type> bb(b.n_id, value); std::pair<size_type,edge_value_type> aa(a.n_id, value); a.graph_pointer->adjacency_matrix[a.n_id].push_back(bb); b.graph_pointer->adjacency_matrix[b.n_id].push_back(aa); ++num_edges_; return Edge(a, b); } } //HW2 remove functions /** Remove a node from the graph and all its edges and return the old index of the removed node * @param[in] n node to be removed * @pre @a n is a node of this graph * @return old index of deleted node * @post new num_nodes() == old num_nodes() - 1 * @post new num_edges() = old num_edges() - old n.degree() * * Complexity: No more than O(num_nodes()), hopefully less, since we assume graph is sparse */ size_type remove_node (const Node& n) { assert(this->has_node(n)); while(!adjacency_matrix[n.index()].empty()) remove_edge(*n.edge_begin()); nodes.erase(nodes.begin() + n.index()); adjacency_matrix.erase(adjacency_matrix.begin() + n.index()); num_nodes_--; for (size_type i = 0; i < num_nodes_; ++i) { if (nodes[i].n_id_ > n.index()) nodes[i].n_id_--; for(size_type j = 0; j < adjacency_matrix[i].size(); ++j) if(adjacency_matrix[i][j].first > n.index()) adjacency_matrix[i][j].first--; } return n.index(); } /** Remove a node from the graph and all its edges and return the old index of the removed node * @param[in] n node to be removed * @pre @a n is a node of this graph * @return node iterator pointing to the same position but different node * @post new num_nodes() == old num_nodes() - 1 * @post new num_edges() = old num_edges() - old n.degree() * * Complexity: No more than O(num_nodes()), hopefully less, since we assume graph is sparse */ node_iterator remove_node (node_iterator n_it) { remove_node(*n_it); return n_it; } /** Remove an edge from the graph and return true if remove worked (i.e. the edge we wanted to remove * actually exists, else it returns false * @param[in] n1 node1() of the edge to be removed * @param[in] n2 node2() of the edge to be removed * @pre @a n1 and @a n2 are nodes of the graph * @return true if has_edge(n1, n2) == true else return false * @post new num_edges() = old num_edges() - -1 * * Complexity: O(1) since we are searching incident edges of two nodes and graph is sparse */ size_type remove_edge (const Node& n1, const Node& n2) { for (size_type j = 0; j < adjacency_matrix[n1.index()].size(); ++j) { if (adjacency_matrix[n1.index()][j].first == n2.index()) { adjacency_matrix[n1.index()].erase(adjacency_matrix[n1.index()].begin() + j); break; } } for (size_type j = 0; j < adjacency_matrix[n2.index()].size(); ++j) { if (adjacency_matrix[n2.index()][j].first == n1.index()) { adjacency_matrix[n2.index()].erase(adjacency_matrix[n2.index()].begin() + j); --num_edges_; return 1; } } return 0; } size_type remove_edge (const Edge& e) { return remove_edge(e.node1(), e.node2()); } edge_iterator remove_edge (edge_iterator e_it) { return remove_edge(*e_it); } /** Remove all nodes and edges from this graph. * @post num_nodes() == 0 && num_edges() == 0 * * Invalidates all outstanding Node and Edge objects. */ void clear() { // HW0: YOUR CODE HERE nodes.clear(); adjacency_matrix.clear(); num_nodes_ = 0; num_edges_ = 0; } // // Node Iterator // /** @class Graph::NodeIterator * @brief Iterator class for nodes. A forward iterator. */ class NodeIterator : private totally_ordered<NodeIterator> { public: // These type definitions let us use STL's iterator_traits. using value_type = Node; // Element type using pointer = Node*; // Pointers to elements using reference = Node&; // Reference to elements using difference_type = std::ptrdiff_t; // Signed difference using iterator_category = std::input_iterator_tag; // Weak Category, Proxy /** Construct an invalid NodeIterator. */ NodeIterator() { } // HW1 #2: YOUR CODE HERE // Supply definitions AND SPECIFICATIONS for: Node operator*() const { assert(n_position <= graph_pointer->num_nodes_); return Node(const_cast<Graph*>(graph_pointer), n_position); } NodeIterator& operator++() { n_position++; return *this; } bool operator==(const NodeIterator& nodeiter) const { if (nodeiter.graph_pointer == this->graph_pointer && nodeiter.n_position == this->n_position) return true; else return false; } private: friend class Graph; // HW1 #2: YOUR CODE HERE const Graph *graph_pointer; size_type n_position; // private constructor NodeIterator(const Graph *graph_p, size_type n_p) { this->graph_pointer = graph_p; this->n_position = n_p; } }; // HW1 #2: YOUR CODE HERE // Supply definitions AND SPECIFICATIONS for: node_iterator node_begin() const { return NodeIterator(this,0); } node_iterator node_end() const { return NodeIterator(this,this->num_nodes_); } // // Incident Iterator // /** @class Graph::IncidentIterator * @brief Iterator class for edges incident to a node. A forward iterator. */ class IncidentIterator : private totally_ordered<IncidentIterator> { public: // These type definitions let us use STL's iterator_traits. using value_type = Edge; // Element type using pointer = Edge*; // Pointers to elements using reference = Edge&; // Reference to elements using difference_type = std::ptrdiff_t; // Signed difference using iterator_category = std::input_iterator_tag; // Weak Category, Proxy /** Construct an invalid IncidentIterator. */ IncidentIterator() {// } // HW1 #3: YOUR CODE HERE // Supply definitions AND SPECIFICATIONS for: Edge operator*() const { return Edge(Node(const_cast<Graph*>(this->graph_pointer), this->node_id),Node(const_cast<Graph*>(this->graph_pointer), this->graph_pointer->adjacency_matrix[node_id][edge_position].first)); } IncidentIterator& operator++() { edge_position++; return *this; } bool operator==(const IncidentIterator& II) const { if (this->graph_pointer == II.graph_pointer && this->node_id == II.node_id && this->edge_position == II.edge_position) return true; else return false; } private: friend class Graph; // HW1 #3: YOUR CODE HERE const Graph *graph_pointer; size_type node_id; size_type edge_position; // private constructor IncidentIterator(const Graph *graph_p, size_type nodeid, size_type pos) { this->graph_pointer = graph_p; this->node_id = nodeid; this->edge_position = pos; } }; // // Edge Iterator // /** @class Graph::EdgeIterator * @brief Iterator class for edges. A forward iterator. */ class EdgeIterator : private totally_ordered<EdgeIterator> { public: // These type definitions let us use STL's iterator_traits. using value_type = Edge; // Element type using pointer = Edge*; // Pointers to elements using reference = Edge&; // Reference to elements using difference_type = std::ptrdiff_t; // Signed difference using iterator_category = std::input_iterator_tag; // Weak Category, Proxy /** Construct an invalid EdgeIterator. */ EdgeIterator() {// } // HW1 #5: YOUR CODE HERE // Supply definitions AND SPECIFICATIONS for: Edge operator*() const { return Edge(Node(const_cast<Graph*>(graph_pointer), node_position),Node(const_cast<Graph*>(graph_pointer), graph_pointer->adjacency_matrix[node_position][edge_position].first)); } EdgeIterator& operator++() { if (edge_position < graph_pointer->adjacency_matrix[node_position].size() - 1) edge_position++; else { node_position++; edge_position = 0; } return *this; } bool operator==(const EdgeIterator& EI) const { if (this->graph_pointer == EI.graph_pointer && this->node_position == EI.node_position && this->edge_position == EI.edge_position) return true; else return false; } private: friend class Graph; // HW1 #5: YOUR CODE HERE const Graph *graph_pointer; size_type node_position; size_type edge_position; EdgeIterator(const Graph* graphp, size_type np, size_type ep) { this->graph_pointer = graphp; this->node_position = np; this->edge_position = ep; } }; // HW1 #5: YOUR CODE HERE // Supply definitions AND SPECIFICATIONS for: edge_iterator edge_begin() const { return EdgeIterator(this, 0, 0); } edge_iterator edge_end() const { return EdgeIterator(this,num_nodes_, 0); } private: // HW0: YOUR CODE HERE // Use this space for your Graph class's internals: // helper functions, data members, and so forth. struct internal_node { Point position_; size_type n_id_; node_value_type n_value_; }; size_type num_nodes_; size_type num_edges_; std::vector<Graph::internal_node> nodes; std::vector<std::vector<std::pair<size_type, edge_value_type>>> adjacency_matrix; }; #endif // CME212_GRAPH_HPP
[ "clazarus@rice12.stanford.edu" ]
clazarus@rice12.stanford.edu
90484c6866034ecaed145fb0b64e04526193e692
37c98c1185ca84509699a2e98254a1b319d59826
/test/testConnectDisconnect.cpp
d0cc5cb5fbb87233e2ec733a055588187dfabfc5
[]
no_license
AleksKots/Manitou
8a097e38772943e379dd2a7d08401aa7ba2e1ec3
8611a75be924b4ec71a95b9f0cdf904373b39e82
refs/heads/master
2020-12-25T13:23:16.372221
2011-12-14T15:05:05
2011-12-14T15:05:05
3,127,571
1
0
null
null
null
null
UTF-8
C++
false
false
1,013
cpp
#include <QString> #include "testConnectDisconnect.h" #include "RegistryTest.h" #include "db.h" std::string TestNames::connect(){ return "Connect"; } std::string TestNames::disconnect(){ return "Disconnect"; } CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(testConnect, TestNames::connect()); CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(testDisconnect, TestNames::disconnect()); /*============================ testConnect ====================================*/ void testConnect::connect() { QString errstr; /// @todo: в этой функции утечка CPPUNIT_ASSERT (ConnectDb("dbname=test_db_api user=ivan", &errstr)); } void testConnect::ping() { db_cnx db; CPPUNIT_ASSERT_ASSERTION_PASS(db.ping()); } /*============================ testDisconnect ====================================*/ void testDisconnect::disconnect() { /// @todo: в этой функции утечка DisconnectDb(); } void testDisconnect::ping() { db_cnx db; CPPUNIT_ASSERT_ASSERTION_FAIL(db.ping()); }
[ "i.zemlyansky@vniins.ru" ]
i.zemlyansky@vniins.ru
8e29e2b36a17d3a0e294c02113bcf55fa4f4ba22
ef34de2efecd0c98854c1a34d21b54277bb30e9d
/hw8/ppm2pgm/ppm2pgm/ppm2pgm.cpp
d0be0c69a950b0c9b5df7d2fa7549e73cea580bf
[]
no_license
nowirak/cs201
9ce92bae90af15e4ae32d80048d098d9b2fbe17f
2a3f6833b583760a7e9574f3d64abed5be1eabb3
refs/heads/master
2023-04-11T05:09:01.165269
2021-04-30T07:37:19
2021-04-30T07:37:19
332,578,018
1
0
null
null
null
null
UTF-8
C++
false
false
985
cpp
/** filename: ppm2pgm.cpp author: Nick Wirak (adapted from Dr. Genetti work) date: 4/26/2021 summary: This program creates a greyscale ppm image file from a RGB ppm image and outputs the representation to a text file named 'pgmImage.txt'. The input image file should be titled 'parrot.ppm', and the ppm should be formatted in ascii characters (as opposed to a binary representation). The program should accomodate ppm files formatted in the usual way, and allow for '#' commenting on any line desired. */ // EXAMPLE PPM FORMATTING /* This is the first few lines of parrot.ppm P3 # CREATOR: GIMP PNM Filter Version 1.1 80 80 255 0 0 1 10 11 8 */ #include <iostream> using std::cout; using std::endl; #include "RGBImage.hpp" int main() { cout << "Program to convert a ppm to ascii art." << endl; RGBImage ppm("parrot.ppm"); ppm.writePGMFile("pgmImage.pgm"); cout << "Program finished." << endl; }
[ "Nick@DESKTOP-AR2LNGC" ]
Nick@DESKTOP-AR2LNGC
a11fff56f8733dfd0565ba64c1309b650da8c361
d9a452cee35f3341fbcf3224a9e6fd60e15a6fd6
/src/camera.cc
96d873784fb956fa852002780f654009caf83e1e
[ "MIT" ]
permissive
yc-feej/Ray-Tracer-COMS-W4160
83799258db15b92c23f5b833eba7a678012185f4
dafc4ba392af7ab754ef47bc1c0b0d7961f86772
refs/heads/master
2022-01-04T20:29:59.179639
2019-05-28T18:25:30
2019-05-28T18:25:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
19,923
cc
#include <vector> #include <cmath> #include "basicmath.h" #include "camera.h" #include "ray.h" #include "sphere.h" #include "triangle.h" #include "light.h" void Camera::init(mypoint position, myvector direction, double focallength, double imagew, double imageh, int pixelw, int pixelh ) { //readin eye = position; d = focallength; width = imagew; height = imageh; pw = pixelw; ph = pixelh; ny = width / pw; nx = height / ph; w = direction.invert(); w.normalize(); u.crossProduct(direction, stdh); v.crossProduct(u, direction); //normalize u.normalize(); v.normalize(); w.normalize(); //calculate vertical point ImgVerticalPoint.set(eye[0] - w[0] * d, eye[1] + direction[1] - w[1] * d, eye[2] - w[2] * d); //calculate leftup point if (ph % 2 == 0) leftup.set(ImgVerticalPoint[0] + nx*(ph*0.5 - 0.5)*v[0], ImgVerticalPoint[1] + nx*(ph*0.5 - 0.5)*v[1], ImgVerticalPoint[2] + nx*(ph*0.5 - 0.5)*v[2]); else leftup.set(ImgVerticalPoint[0] + nx*(ph*0.5 - 1)*v[0], ImgVerticalPoint[1] + nx*(ph*0.5 - 1)*v[1], ImgVerticalPoint[2] + nx*(ph*0.5 - 1)*v[2]); if (pw % 2 == 0) leftup.set(leftup[0] - ny*(pw*0.5 - 0.5)*u[0], leftup[1] - ny*(pw*0.5 - 0.5)*u[1], leftup[2] - ny*(pw*0.5 - 0.5)*u[2]); else leftup.set(leftup[0] - ny*(pw*0.5 - 1)*u[0], leftup[1] - ny*(pw*0.5 - 1)*u[1], leftup[2] - ny*(pw*0.5 - 1)*u[2]); //create scene lightimg.resizeErase(ph, pw); //allocate memory and set to all 0 int i, j; for (i = 0; i < ph; i++) for (j = 0; j < pw; j++) { Imf::Rgba &px = lightimg[i][j]; { px.r = 0; px.g = 0; px.b = 0; px.a = 1; } } } void Camera::renderscene(std::vector<Sphere *> &asphere, std::vector<Triangle *> &atriangle, std::vector<pLight *> &plight, std::vector<areaLight *> &arealight, std::vector<myvector *> &asoftnormals, const char BVH[], int samples, int areasamples ) { int x, y; //x stands to height; y stands to width int i, j; int nn = samples * samples; x = ph; y = pw; int spread_time = 3; bool useBVH = true; bool sphereBVH = false; bool triangleBVH = false; Sphere *thissphere = new Sphere; Triangle *thistriangle = new Triangle; if (BVH[0] == '1') { if (asphere.size() > 0) { thissphere->createtree(asphere, 0); sphereBVH = true; } if (atriangle.size() > 0) { thistriangle->createtree(atriangle, 0); triangleBVH = true; } } else useBVH = false; if(nn == 0) for (i = 0; i < x; i++) { for (j = 0; j < y; j++) { //create ray of certain pixel ray thisray = createray(i, j); myvector rgb_this; rgb_this.set(0, 0, 0); if (!useBVH) rgb_this = calcRGB(thisray,0, 0, spread_time, asphere, atriangle, plight, arealight, 0, std::numeric_limits<double>::max()); else rgb_this = FcalcRGB(thisray, 0, 0, 0, spread_time, thissphere, thistriangle, sphereBVH, triangleBVH, plight, arealight, asoftnormals, 0, std::numeric_limits<double>::max(), areasamples); setPixel(i, j, rgb_this); // std::cout << "row" << i << "column" << j << "finished" << std::endl; if (i == 272 && j == 458) continue; } if (i % 50 == 0) std::cout << "line" << i << "finished" << std::endl; } else for (i = 0; i < x; i++) { for (j = 0; j < y; j++) { myvector rgb_this; rgb_this.set(0, 0, 0); for (int p = 0; p < samples; p++) for (int q = 0; q < samples; q++) { ray thisray = createray(i, j, p, q, samples); myvector rgb_temp; rgb_temp = FcalcRGB(thisray, 0, 0, 0, spread_time, thissphere, thistriangle, sphereBVH, triangleBVH, plight, arealight, asoftnormals, 0, std::numeric_limits<double>::max(), areasamples); rgb_this.set(rgb_this[0] + rgb_temp[0], rgb_this[1] + rgb_temp[1], rgb_this[2] + rgb_temp[2]); } //now we have got the total rgb_this for all stratifies rgb_this.set(rgb_this[0] / nn, rgb_this[1] / nn, rgb_this[2] / nn); setPixel(i, j, rgb_this); if (i == 272 && j == 458) continue; } if (i % 50 == 0) std::cout << "row" << i << "finished" << std::endl; } } void Camera::writescene(aLight alight, const char filename[], int y, int x) { int i, j; for (i = 0; i < x; i++) for (j = 0; j < y; j++) { Imf::Rgba &px = lightimg[i][j]; { // px.r += alight.r; // px.g += alight.g; // px.b += alight.b; px.a = 1; } } Imf::Rgba &pixels = lightimg[0][0]; Imf::RgbaOutputFile file(filename, y, x, Imf::WRITE_RGBA); file.setFrameBuffer(&pixels, 1, y); file.writePixels(x); } ray Camera::createray(int ix, int iy) { mypoint locnow; ray theray; locnow = leftup; //set local screen point locnow.set(locnow[0] + iy*ny*u[0], locnow[1] + iy*ny*u[1], locnow[2] + iy*ny*u[2]); locnow.set(locnow[0] - ix*nx*v[0], locnow[1] - ix*nx*v[1], locnow[2] - ix*nx*v[2]); theray.pos = eye; theray.dir = locnow - eye; theray.dir.normalize(); return theray; } ray Camera::createray(int ix, int iy, int p, int q, int n) { mypoint locnow; ray theray; double randnum1 = rand()%10; double randnum2 = rand()%10; randnum1 /= 10; randnum2 /= 10; locnow = leftup; //set local screen point; this time, left up of each pixel locnow.set(locnow[0] + (iy - 0.5 + (p + randnum1)/n)*ny*u[0], locnow[1] + (iy - 0.5 + (p + randnum1)/n)*ny*u[1], locnow[2] + (iy - 0.5 + (p + randnum1)/n)*ny*u[2]); locnow.set(locnow[0] - (ix - 0.5 + (q + randnum2)/n)*nx*v[0], locnow[1] - (ix - 0.5 + (q + randnum2)/n)*nx*v[1], locnow[2] - (ix - 0.5 + (q + randnum2)/n)*nx*v[2]); theray.pos = eye; theray.dir = locnow - eye; theray.dir.normalize(); return theray; } ray Camera::createray(mypoint startpoint, myvector direction) { ray theray; theray.pos = startpoint; theray.dir = direction; theray.dir.normalize(); return theray; } //default method for ray-tracing. //tear of time - never been used while implementing soft shadows myvector Camera::calcRGB(ray &thisray, int ray_type, int certainlight, int spread_time, std::vector<Sphere *> &asphere, std::vector<Triangle *> &atriangle, std::vector<pLight *> &plight, std::vector<areaLight *> &arealight, double mint, double maxt) { myvector rgb_this; rgb_this.set(0, 0, 0); if (spread_time == 0) return rgb_this; int aspherelength = asphere.size(); int atrilength = atriangle.size(); if (ray_type == 2) { for (int m = 0; m < aspherelength; m++) { Sphere *thissphere = asphere[m]; double t; mypoint pointtemp; myvector normaltemp; if (thissphere->intersect(t, thisray, pointtemp, normaltemp) && (t < maxt && t > mint)) return rgb_this; } double tmax = std::numeric_limits<double>::max(); for (int m = 0; m < atrilength; m++) { Triangle *thistriangle = atriangle[m]; double t; mypoint pointtemp; myvector normaltemp; if (thistriangle->intersect(t, tmax, thisray, pointtemp, normaltemp) && (t < maxt && t > mint)) return rgb_this; } rgb_this.set(plight[certainlight]->r, plight[certainlight]->g, plight[certainlight]->b); return rgb_this; } double tsmin = std::numeric_limits<double>::max(); //the largest number mypoint intersectpoint; myvector n_normal; Material thismaterial; //judge surface intersection int frontsurface = -1; for (int m = 0; m < aspherelength; m++) { Sphere *thissphere = asphere[m]; double t; mypoint pointtemp; myvector normaltemp; if (thissphere->intersect(t, thisray, pointtemp, normaltemp)) if (t < tsmin) { frontsurface = m; tsmin = t; intersectpoint = pointtemp; n_normal = normaltemp; thismaterial = thissphere->material; } } int fronttri = -1; for (int m = 0; m < atrilength; m++) { Triangle *thistriangle = atriangle[m]; double t; mypoint pointtemp; myvector normaltemp; if (thistriangle->intersect(t, tsmin, thisray, pointtemp, normaltemp)) if (t < tsmin) { frontsurface = m; tsmin = t; intersectpoint = pointtemp; n_normal = normaltemp; thismaterial = thistriangle->material; } } if (frontsurface == -1 && fronttri == -1) return rgb_this; //shadow calculation bool ifbackside = false; if (thisray.dir.dotProduct(n_normal) > 0) ifbackside = true; myvector backsidenorm = n_normal.invert(); myvector ptv = thisray.dir; ptv = ptv.invert(); int plightlength = plight.size(); for (int n = 0; n < plightlength; n++) { //set up a vector from the light to the intersectpoint pLight *thislight = plight[n]; myvector ptl = thislight->loc - intersectpoint; double thistsq = ptl[0] * ptl[0] + ptl[1] * ptl[1] + ptl[2] * ptl[2]; double thist = sqrt(thistsq); ptl.normalize(); ray shadowRay = createray(intersectpoint, ptl); myvector shadow_v = calcRGB(shadowRay, 2, n, 1, asphere, atriangle, plight, arealight, 0.001, thist); if (shadow_v[0] != 0 || shadow_v[1] != 0 || shadow_v[2] != 0) { myvector rgb_temp; rgb_temp.set(0, 0, 0); if (ifbackside) rgb_temp = thismaterial.BackRGB(ptl, ptv, backsidenorm, shadow_v); else rgb_temp = thismaterial.RGB(ptl, ptv, n_normal, shadow_v); rgb_this.set(rgb_this[0] + rgb_temp[0] / thistsq, rgb_this[1] + rgb_temp[1] / thistsq, rgb_this[2] + rgb_temp[2] / thistsq); } } //true_specular light if (thismaterial.ir == 0 && thismaterial.ig == 0 && thismaterial.ib == 0) return rgb_this; else if (ifbackside) return rgb_this; else { double d_N = 2 * thisray.dir.dotProduct(n_normal); myvector direction; myvector rgb_temp; mypoint iipoint; rgb_temp.set(0, 0, 0); direction.set(thisray.dir[0] - d_N * n_normal[0], thisray.dir[1] - d_N * n_normal[1], thisray.dir[2] - d_N * n_normal[2]); direction.normalize(); iipoint.set(intersectpoint[0] + direction[0] * 0.001, intersectpoint[1] + direction[1] * 0.001, intersectpoint[2] + direction[2] * 0.001); ray spreadray = createray(iipoint, direction); rgb_temp = calcRGB(spreadray, 1, 0, spread_time - 1, asphere, atriangle, plight, arealight, 0.001, std::numeric_limits<double>::max()); rgb_this.set(rgb_this[0] + rgb_temp[0] * thismaterial.ir, rgb_this[1] + rgb_temp[1] * thismaterial.ig, rgb_this[2] + rgb_temp[2] * thismaterial.ib); return rgb_this; } } //Bounding box, BVH tree, Monte-carlo method //Soft shadows, smooth normals myvector Camera::FcalcRGB(ray &thisray, int ray_type, int light_type, int certainlight, int spread_time, Sphere *asphere, Triangle *atriangle, bool ifBVHsphere, bool ifBVHtriangle, std::vector<pLight *> &plight, std::vector<areaLight *> &arealight, std::vector<myvector *> &asoftnormals, double mint, double maxt, int areasamples) { myvector rgb_this; rgb_this.set(0, 0, 0); if (spread_time == 0) return rgb_this; if (ray_type == 2) { std::vector<Sphere *> thissphere; double t_n = 0, t_f = std::numeric_limits<double>::max(); if (ifBVHsphere) asphere->hit(thisray, t_n, t_f, thissphere); if (thissphere.size() > 0) { int lengtha = thissphere.size(); for (int m = 0; m < lengtha; m++) { double t; mypoint pointtemp; myvector normaltemp; Sphere *tsphere = thissphere[m]; if (tsphere->intersect(t, thisray, pointtemp, normaltemp) && (t < maxt && t > mint)) return rgb_this; } } double tmax = std::numeric_limits<double>::max(); std::vector<Triangle *> thistriangle; t_n = 0, t_f = std::numeric_limits<double>::max(); if (ifBVHtriangle) atriangle->hit(thisray, t_n, t_f, thistriangle); if (thistriangle.size() > 0) { int lengtha = thistriangle.size(); for (int m = 0; m < lengtha; m++) { double t; mypoint pointtemp; myvector normaltemp; Triangle *ttri = thistriangle[m]; if (ttri->intersect(t, tmax, thisray, pointtemp, normaltemp) && (t < maxt && t > mint)) return rgb_this; } } if (light_type == 1) rgb_this.set(plight[certainlight]->r, plight[certainlight]->g, plight[certainlight]->b); else rgb_this.set(arealight[certainlight]->r, arealight[certainlight]->g, arealight[certainlight]->b); return rgb_this; } double tsmin = std::numeric_limits<double>::max(); //the largest number mypoint intersectpoint; myvector n_normal; Material thismaterial; //judge surface intersection bool frontsphere = false; std::vector<Sphere *> thissphere; double t_n = 0, t_f = std::numeric_limits<double>::max(); if (ifBVHsphere) asphere->hit(thisray, t_n, t_f, thissphere); if (thissphere.size() > 0) { int lengtha = thissphere.size(); for (int m = 0; m < lengtha; m++) { double t; mypoint pointtemp; myvector normaltemp; Sphere *tsphere = thissphere[m]; if (tsphere->intersect(t, thisray, pointtemp, normaltemp) && (t < tsmin)) { frontsphere = true; tsmin = t; intersectpoint = pointtemp; n_normal = normaltemp; thismaterial = tsphere->material; } } } bool fronttri = false; std::vector<Triangle *> thistriangle; t_n = 0, t_f = std::numeric_limits<double>::max(); if (ifBVHtriangle) atriangle->hit(thisray, t_n, t_f, thistriangle); if (thistriangle.size() > 0) { int lengtha = thistriangle.size(); for (int m = 0; m < lengtha; m++) { double t; mypoint pointtemp; myvector normaltemp; Triangle *ttri = thistriangle[m]; if (ttri->intersect(t, tsmin, thisray, pointtemp, normaltemp, asoftnormals) && (t < tsmin)) { fronttri = true; tsmin = t; intersectpoint = pointtemp; n_normal = normaltemp; thismaterial = ttri->material; } } } if ((!frontsphere) && (!fronttri)) return rgb_this; //shadow calculation bool ifbackside = false; if (thisray.dir.dotProduct(n_normal) > 0) ifbackside = true; myvector backsidenorm = n_normal.invert(); myvector ptv = thisray.dir; ptv = ptv.invert(); int plightlength = plight.size(); for (int n = 0; n < plightlength; n++) { //set up a vector from the intersectpoint to the light pLight *thislight = plight[n]; myvector ptl = thislight->loc - intersectpoint; double thistsq = ptl[0] * ptl[0] + ptl[1] * ptl[1] + ptl[2] * ptl[2]; double thist = sqrt(thistsq); ptl.normalize(); ray shadowRay = createray(intersectpoint, ptl); myvector shadow_v = FcalcRGB(shadowRay, 2, 1, n, 1, asphere, atriangle, ifBVHsphere,ifBVHtriangle, plight, arealight, asoftnormals, 0.001, thist, areasamples); if (shadow_v[0]!=0 || shadow_v[1]!=0 || shadow_v[2]!=0) { myvector rgb_temp; rgb_temp.set(0, 0, 0); if (ifbackside) rgb_temp = thismaterial.BackRGB(ptl, ptv, backsidenorm, shadow_v); else rgb_temp = thismaterial.RGB(ptl, ptv, n_normal, shadow_v); rgb_this.set(rgb_this[0] + rgb_temp[0] / thistsq, rgb_this[1] + rgb_temp[1] / thistsq, rgb_this[2] + rgb_temp[2] / thistsq); } } int arealightlength = arealight.size(); int areasum = areasamples * areasamples; for (int n = 0; n < arealightlength; n++) { //if we are not calculating soft shadow; //set up a vector from the intersectpoint to the light's center if (areasamples == 0) { areaLight *thislight = arealight[n]; myvector ptl = thislight->center - intersectpoint; double thistsq = ptl[0] * ptl[0] + ptl[1] * ptl[1] + ptl[2] * ptl[2]; double thist = sqrt(thistsq); ptl.normalize(); // calculate if the ptl vector goes to the facing side of area light // if does, then calculate; if doesn't, set to 0 double facetest = ptl.dotProduct(thislight->dir); if (facetest > 0) continue; ray shadowRay = createray(intersectpoint, ptl); myvector shadow_v = FcalcRGB(shadowRay, 2, 2, n, 1, asphere, atriangle, ifBVHsphere,ifBVHtriangle, plight, arealight, asoftnormals, 0.1, thist, areasamples); if (shadow_v[0]!=0 || shadow_v[1]!=0 || shadow_v[2]!=0) { myvector rgb_temp; rgb_temp.set(0, 0, 0); if (ifbackside) rgb_temp = thismaterial.BackRGB(ptl, ptv, backsidenorm, shadow_v); else rgb_temp = thismaterial.RGB(ptl, ptv, n_normal, shadow_v); rgb_this.set(rgb_this[0] + rgb_temp[0] / thistsq, rgb_this[1] + rgb_temp[1] / thistsq, rgb_this[2] + rgb_temp[2] / thistsq); } } else { areaLight *thislight = arealight[n]; // for this number might be big, so it would be much easier // to calculate if its shined by area light myvector ptl_test = thislight->center - intersectpoint; double face_test = ptl_test.dotProduct(thislight->dir); if (face_test > 0) continue; // now we know it could be shined by this area light for (int pp = 0; pp < areasamples; pp++) for(int qq = 0; qq < areasamples; qq++) { mypoint lightfacepoint; double randnum1 = rand()%10; double randnum2 = rand()%10; randnum1 /= 10; randnum2 /= 10; double percent1 = (pp + randnum1) / areasamples; double percent2 = (qq + randnum2) / areasamples; lightfacepoint.set(thislight->leftdown[0] + percent1*thislight->len*thislight->u_dir[0] + percent2*thislight->len*thislight->v_dir[0], thislight->leftdown[1] + percent1*thislight->len*thislight->u_dir[1] + percent2*thislight->len*thislight->v_dir[1], thislight->leftdown[2] + percent1*thislight->len*thislight->u_dir[2] + percent2*thislight->len*thislight->v_dir[2]); myvector ptl = lightfacepoint - intersectpoint; double thistsq = ptl[0] * ptl[0] + ptl[1] * ptl[1] + ptl[2] * ptl[2]; double thist = sqrt(thistsq); ptl.normalize(); ray shadowRay = createray(intersectpoint, ptl); myvector shadow_v = FcalcRGB(shadowRay, 2, 2, n, 1, asphere, atriangle, ifBVHsphere,ifBVHtriangle, plight, arealight, asoftnormals, 0.1, thist, areasamples); if (shadow_v[0]!=0 || shadow_v[1]!=0 || shadow_v[2]!=0) { myvector rgb_temp; rgb_temp.set(0, 0, 0); if (ifbackside) rgb_temp = thismaterial.BackRGB(ptl, ptv, backsidenorm, shadow_v); else rgb_temp = thismaterial.RGB(ptl, ptv, n_normal, shadow_v); rgb_this.set(rgb_this[0] + rgb_temp[0] / (thistsq * areasum), rgb_this[1] + rgb_temp[1] / (thistsq * areasum), rgb_this[2] + rgb_temp[2] / (thistsq * areasum)); } } } } //true_specular light if (thismaterial.ir == 0 && thismaterial.ig == 0 && thismaterial.ib == 0) return rgb_this; else if (ifbackside) return rgb_this; else { double d_N = 2 * thisray.dir.dotProduct(n_normal); myvector direction; myvector rgb_temp; mypoint iipoint; rgb_temp.set(0, 0, 0); direction.set(thisray.dir[0] - d_N * n_normal[0], thisray.dir[1] - d_N * n_normal[1], thisray.dir[2] - d_N * n_normal[2]); direction.normalize(); iipoint.set(intersectpoint[0] + direction[0] * 0.001, intersectpoint[1] + direction[1] * 0.001, intersectpoint[2] + direction[2] * 0.001); ray spreadray = createray(iipoint, direction); rgb_temp = FcalcRGB(spreadray, 1, 0, 0, spread_time - 1, asphere, atriangle, ifBVHsphere, ifBVHtriangle, plight, arealight, asoftnormals, 0.001, std::numeric_limits<double>::max(), areasamples); rgb_this.set(rgb_this[0] + rgb_temp[0] * thismaterial.ir, rgb_this[1] + rgb_temp[1] * thismaterial.ig, rgb_this[2] + rgb_temp[2] * thismaterial.ib); return rgb_this; } }
[ "noreply@github.com" ]
noreply@github.com
26be2ae56bc940c8663ccb775c98c3b62f469154
42180085e2f9ed8f6edbeb09ae1a2c497c2882d1
/src/base58.h
d54845ade05573cf6cc3e9f3d9c23cc444e6fec8
[ "MIT" ]
permissive
GalacticFederation/blemflark
351be868467fbd814de8a285e6d4c611b154bc4e
c349e5afc560fff581d431c0a343fff1a02c6e05
refs/heads/master
2021-05-15T07:04:00.041219
2018-02-18T17:22:05
2018-02-18T17:22:05
112,434,619
1
0
null
null
null
null
UTF-8
C++
false
false
5,796
h
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. /** * Why base-58 instead of standard base-64 encoding? * - Don't want 0OIl characters that look the same in some fonts and * could be used to create visually identical looking data. * - A string with non-alphanumeric characters is not as easily accepted as input. * - E-mail usually won't line-break if there's no punctuation to break at. * - Double-clicking selects the whole string as one word if it's all alphanumeric. */ #ifndef BLEMFLARK_BASE58_H #define BLEMFLARK_BASE58_H #include "chainparams.h" #include "key.h" #include "pubkey.h" #include "script/script.h" #include "script/standard.h" #include "support/allocators/zeroafterfree.h" #include <string> #include <vector> /** * Encode a byte sequence as a base58-encoded string. * pbegin and pend cannot be nullptr, unless both are. */ std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend); /** * Encode a byte vector as a base58-encoded string */ std::string EncodeBase58(const std::vector<unsigned char>& vch); /** * Decode a base58-encoded string (psz) into a byte vector (vchRet). * return true if decoding is successful. * psz cannot be nullptr. */ bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet); /** * Decode a base58-encoded string (str) into a byte vector (vchRet). * return true if decoding is successful. */ bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet); /** * Encode a byte vector into a base58-encoded string, including checksum */ std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn); /** * Decode a base58-encoded string (psz) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ inline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet); /** * Decode a base58-encoded string (str) that includes a checksum into a byte * vector (vchRet), return true if decoding is successful */ inline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet); /** * Base class for all base58-encoded data */ class CBase58Data { protected: //! the version byte(s) std::vector<unsigned char> vchVersion; //! the actually encoded data typedef std::vector<unsigned char, zero_after_free_allocator<unsigned char> > vector_uchar; vector_uchar vchData; CBase58Data(); void SetData(const std::vector<unsigned char> &vchVersionIn, const void* pdata, size_t nSize); void SetData(const std::vector<unsigned char> &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend); public: bool SetString(const char* psz, unsigned int nVersionBytes = 1); bool SetString(const std::string& str); std::string ToString() const; int CompareTo(const CBase58Data& b58) const; bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; } bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; } bool operator>=(const CBase58Data& b58) const { return CompareTo(b58) >= 0; } bool operator< (const CBase58Data& b58) const { return CompareTo(b58) < 0; } bool operator> (const CBase58Data& b58) const { return CompareTo(b58) > 0; } }; /** base58-encoded blemflark addresses. * Public-key-hash-addresses have version 23 (or 111 testnet). * The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key. * Script-hash-addresses have version 5 (or 196 testnet). * The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script. */ class CBlemflarkAddress : public CBase58Data { public: bool Set(const CKeyID &id); bool Set(const CScriptID &id); bool Set(const CTxDestination &dest); bool IsValid() const; bool IsValid(const CChainParams &params) const; CBlemflarkAddress() {} CBlemflarkAddress(const CTxDestination &dest) { Set(dest); } CBlemflarkAddress(const std::string& strAddress) { SetString(strAddress); } CBlemflarkAddress(const char* pszAddress) { SetString(pszAddress); } CTxDestination Get() const; bool GetKeyID(CKeyID &keyID) const; bool IsScript() const; }; /** * A base58-encoded secret key */ class CBlemflarkSecret : public CBase58Data { public: void SetKey(const CKey& vchSecret); CKey GetKey(); bool IsValid() const; bool SetString(const char* pszSecret); bool SetString(const std::string& strSecret); CBlemflarkSecret(const CKey& vchSecret) { SetKey(vchSecret); } CBlemflarkSecret() {} }; template<typename K, int Size, CChainParams::Base58Type Type> class CBlemflarkExtKeyBase : public CBase58Data { public: void SetKey(const K &key) { unsigned char vch[Size]; key.Encode(vch); SetData(Params().Base58Prefix(Type), vch, vch+Size); } K GetKey() { K ret; if (vchData.size() == Size) { // If base58 encoded data does not hold an ext key, return a !IsValid() key ret.Decode(vchData.data()); } return ret; } CBlemflarkExtKeyBase(const K &key) { SetKey(key); } CBlemflarkExtKeyBase(const std::string& strBase58c) { SetString(strBase58c.c_str(), Params().Base58Prefix(Type).size()); } CBlemflarkExtKeyBase() {} }; typedef CBlemflarkExtKeyBase<CExtKey, BIP32_EXTKEY_SIZE, CChainParams::EXT_SECRET_KEY> CBlemflarkExtKey; typedef CBlemflarkExtKeyBase<CExtPubKey, BIP32_EXTKEY_SIZE, CChainParams::EXT_PUBLIC_KEY> CBlemflarkExtPubKey; #endif // BLEMFLARK_BASE58_H
[ "galacticfederationheadquarters@gmail.com" ]
galacticfederationheadquarters@gmail.com
aba1b002aa2ea5eb15c8a0687efc28066f0518ca
395833de59e625da5a0c8c9c4f6ea3320cefabfb
/MikuMikuGameEngine/engine/core/graphics/TextureAtlas.h
6bbc9241c9eaccc4c1a705fb40c246cd7e542a56
[]
no_license
dugong001/MikuMikuGameEngine
e7214c62bf86aee72d3b14f63268cfab1bab08e1
3621580da9ee3dc2c244fc182de53d31dfbd7e80
refs/heads/master
2020-03-27T18:26:27.296118
2013-02-23T12:05:18
2013-02-23T12:05:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
769
h
#pragma once #include "Texture.h" #include "../util/CharSet.h" struct sChipInfo { int x; int y; int width; int height; int cx; int cy; }; class TextureAtlas : public IResource { private: TexturePtr m_texture; std::map<tstring_symbol,sChipInfo*> m_chipList; public: TextureAtlas(); virtual ~TextureAtlas(); private: bool Load( IXmlReaderPtr reader ); public: bool CreateFromFile( const tstring& filePath,TexturePtr texture ); bool CreateFromMemory( const BYTE* data,DWORD size,TexturePtr texture ); bool CreateFromResource( int resourceID,TexturePtr texture ); const sChipInfo* GetChipInfo( const tstring_symbol& name ); TexturePtr GetTexture(); }; typedef std::tr1::shared_ptr< TextureAtlas > TextureAtlasPtr;
[ "miyabi@circle-chips.com" ]
miyabi@circle-chips.com
0d964bdd4dceb35059bcb091473a8eb00fb2dd78
45e0fbd9a9dbcdd4fbe6aaa2fdb2aed296f81e33
/FindSecret/Classes/Native/mscorlib_System_Array_InternalEnumerator_1_gen1637735142.h
1ab4175a7a8771da922116f9b3eb17375b5d20d9
[ "MIT" ]
permissive
GodIsWord/NewFindSecret
d4a5d2d810ee1f9d6b3bc91168895cc808bac817
4f98f316d29936380f9665d6a6d89962d9ee5478
refs/heads/master
2020-03-24T09:54:50.239014
2018-10-27T05:22:11
2018-10-27T05:22:11
142,641,511
0
0
null
null
null
null
UTF-8
C++
false
false
1,470
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_ValueType3640485471.h" // System.Array struct Il2CppArray; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array/InternalEnumerator`1<System.Drawing.Imaging.ImageFormat> struct InternalEnumerator_1_t1637735142 { public: // System.Array System.Array/InternalEnumerator`1::array Il2CppArray * ___array_0; // System.Int32 System.Array/InternalEnumerator`1::idx int32_t ___idx_1; public: inline static int32_t get_offset_of_array_0() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t1637735142, ___array_0)); } inline Il2CppArray * get_array_0() const { return ___array_0; } inline Il2CppArray ** get_address_of_array_0() { return &___array_0; } inline void set_array_0(Il2CppArray * value) { ___array_0 = value; Il2CppCodeGenWriteBarrier(&___array_0, value); } inline static int32_t get_offset_of_idx_1() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t1637735142, ___idx_1)); } inline int32_t get_idx_1() const { return ___idx_1; } inline int32_t* get_address_of_idx_1() { return &___idx_1; } inline void set_idx_1(int32_t value) { ___idx_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "zhangyide@9fbank.cc" ]
zhangyide@9fbank.cc
32f8ea1c67cb1e163d1cf283560f82224c6f66fb
2f5f6356312b1325da149d39e9f553e0cfeb3525
/hwcpplib/spice_simulation.hpp
0751ccfaa7e92bda1bab81d6baa9a2ce9190dd46
[]
no_license
teqdruid/hwlib
f6d9f15318b7d7f6294998a1249de0628f34fdfe
4946384c661579a4ad3d2ca5bf5ee977619dfc12
refs/heads/master
2021-05-27T15:22:53.250023
2014-11-12T23:17:29
2014-11-12T23:17:29
10,254,407
0
0
null
null
null
null
UTF-8
C++
false
false
2,382
hpp
#ifndef __SPICE_SIMULATION_HPP__ #define __SPICE_SIMULATION_HPP__ #include <string> #include <vector> #include <map> #include <set> #include <limits> #include <cmath> #include <cassert> #include <boost/shared_ptr.hpp> namespace hwlib { #define MAX_MONITOR_NODES 8 class Monitor { public: virtual std::vector<std::string> get_vector_names() { return { }; } virtual void init() { }; virtual void data(double abs_time, double time_diff, double* v) { }; }; typedef boost::shared_ptr<Monitor> MonitorPtr; class HaltCondition { protected: bool dohalt; public: HaltCondition() : dohalt(false) { } virtual bool halt() { return dohalt; } virtual void reset() { this->dohalt = false; } uint64_t getid() { return (uint64_t)this; } }; typedef boost::shared_ptr<HaltCondition> HaltConditionPtr; class SpiceSimulation { static bool SpiceInUse; std::string sim_name; std::string netlist; std::string write_filename; public: void InitSpice(); void UnInitSpice(); bool quiet, debug; int time_vec_num; double time; double time_step; std::set<MonitorPtr> monitors; std::set<HaltConditionPtr> halts; std::vector<HaltConditionPtr> halts_requested; std::map<MonitorPtr, int*> monitor_indexes; volatile enum Status { None, Running, HaltRequested, HaltStarting, Halted, Kill, Killed, Done } bg_status; public: SpiceSimulation(std::string name = std::string(""), std::string netlist = std::string("")) { this->debug = false; this->quiet = false; this->sim_name = name; this->set_netlist(netlist); } void close() { UnInitSpice(); } void set_output_file(std::string outfn) { this->write_filename = outfn; } void set_netlist(std::string netlist) { this->netlist = netlist; } void add_monitor(MonitorPtr m) { assert(m != NULL && "Monitor must not be NULL"); this->monitors.insert(m); } void add_halt(HaltConditionPtr hc) { assert(hc != NULL && "HaltCondition mustn't be NULL!"); this->halts.insert(hc); } void ngspice_command(std::string cmd); void alter(std::string device, std::string param); // Run a transient analysis with particular time step and // maximum amount of simulated time in seconds void run_trans(double time_step, double max_time); void resume(); private: void run_loop(); }; typedef boost::shared_ptr<SpiceSimulation> SpiceSimulationPtr; }; #endif // __SPICE_SIMULATION_HPP__
[ "jdd@cs.columbia.edu" ]
jdd@cs.columbia.edu
7943b2805a16f29b4b91025557f559bdfe66c35c
64caeb557da46aa4e7647268b9ed32b3078782a6
/z80tzxGUI/z80tzxGUIDlg.cpp
6b0f2cf0da6b044d89fbbf9bad9364d33d750821
[]
no_license
rcmolina/z802tzx3
8f690046bfcb2effa976c4ec30a4c9a32a1b71bf
8329ce2a9a106db20558003d13faab835cdfad24
refs/heads/master
2023-08-31T11:31:05.797676
2023-08-30T20:04:07
2023-08-30T20:04:07
124,954,218
4
0
null
null
null
null
UTF-8
C++
false
false
5,297
cpp
// z80tzxGUIDlg.cpp : implementation file // #include "stdafx.h" #include "z80tzxGUI.h" #include "z80tzxGUIDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #define MAXs 11 int speed[MAXs]; CString StrFile; ///////////////////////////////////////////////////////////////////////////// // CZ80tzxGUIDlg dialog CZ80tzxGUIDlg::CZ80tzxGUIDlg(CWnd* pParent /*=NULL*/) : CDialog(CZ80tzxGUIDlg::IDD, pParent) { //{{AFX_DATA_INIT(CZ80tzxGUIDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CZ80tzxGUIDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CZ80tzxGUIDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CZ80tzxGUIDlg, CDialog) //{{AFX_MSG_MAP(CZ80tzxGUIDlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDC_RADIO2, OnRadio2) ON_BN_CLICKED(IDC_RADIO3, OnRadio3) ON_BN_CLICKED(IDC_RADIO4, OnRadio4) ON_BN_CLICKED(IDC_RADIO5, OnRadio5) ON_BN_CLICKED(IDC_RADIO6, OnRadio6) ON_BN_CLICKED(IDC_RADIO7, OnRadio7) ON_BN_CLICKED(IDC_RADIO8, OnRadio8) ON_BN_CLICKED(IDC_RADIO9, OnRadio9) ON_BN_CLICKED(IDC_RADIO10, OnRadio10) ON_BN_CLICKED(IDC_RADIO11, OnRadio11) ON_BN_CLICKED(IDC_RADIO12, OnRadio12) ON_BN_CLICKED(IDIGNORE, OnIgnore) ON_BN_CLICKED(IDC_RADIO13, OnRadio13) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CZ80tzxGUIDlg message handlers BOOL CZ80tzxGUIDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here CheckRadioButton(IDC_RADIO2, IDC_RADIO12, IDC_RADIO12); speed[10]=1; //Default speed 5800 return TRUE; // return TRUE unless you set the focus to a control } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CZ80tzxGUIDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CZ80tzxGUIDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } void CZ80tzxGUIDlg::OnRadio2() { speed[0] = 1; /* 1364 */ } void CZ80tzxGUIDlg::OnRadio3() { speed[1] = 1; /* 2250 */ } void CZ80tzxGUIDlg::OnRadio4() { speed[2] = 1; /* 3000 */ } void CZ80tzxGUIDlg::OnRadio5() { speed[3] = 1; /* 3230 */ } void CZ80tzxGUIDlg::OnRadio6() { speed[4] = 1; /* 3500 */ } void CZ80tzxGUIDlg::OnRadio7() { speed[5] = 1; /* 4100 */ } void CZ80tzxGUIDlg::OnRadio8() { speed[6] = 1; /* 4500 */ } void CZ80tzxGUIDlg::OnRadio9() { speed[7] = 1; /* 5000 */ } void CZ80tzxGUIDlg::OnRadio10() { speed[8] = 1; /* 5100 */ } void CZ80tzxGUIDlg::OnRadio11() { speed[9] = 1; /* 5500 */ } void CZ80tzxGUIDlg::OnRadio12() { speed[10] = 1; /* 5800 */ } void CZ80tzxGUIDlg::OnRadio13() { int i; for (i=0;i<MAXs;i++) speed[i]=1; } void CZ80tzxGUIDlg::OnCancel() { CDialog::OnCancel(); } void CZ80tzxGUIDlg::OnIgnore() { // Create an instance First //CFileDialog fOpenDlg(TRUE, "txt", "vicon_cams_data", OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, "Camera Data Files (*.txt)|*.txt|*.dat||", this); //CString StrFile; CString defExe(""); CString defFileName(""); //CString defFilter("(*.z80)|*.z80|(*.sna)|*.sna|"); CString defFilter("zx Snapshot files(*.sna;*.z80)|*.sna;*.z80|All files(*.*)|*.*|"); CFileDialog dlg(true,defExe,defFileName,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,defFilter); dlg.m_ofn.lpstrInitialDir= _T(".\\"); if(dlg.DoModal()==IDOK) { StrFile = dlg.GetPathName(); // do something } } void CZ80tzxGUIDlg::OnOK() { char cmdargs[256]; char speedstr[4]; HINSTANCE rc; int i; for (i=0; i<MAXs; i++) { if (speed[i]) { itoa(i,speedstr,10); strcpy (cmdargs, StrFile); strcat (cmdargs, " -s "); strcat (cmdargs, speedstr); //rc = ShellExecute (NULL, "open", "http://123.456.789.001", NULL, NULL, SW_SHOWMAXIMIZED); rc = ShellExecute (NULL, "open", "z802tzx3.exe", cmdargs, NULL, SW_SHOWMAXIMIZED); //CDialog::OnOK(); } } for (i=0;i<MAXs;i++) speed[i]=0; }
[ "noreply@github.com" ]
noreply@github.com
a1812e6102c922728e475d0c1a398456064aa042
89191f594c4997d8b0917f153a827009724156f7
/Projeto 2/Shift.cpp
f7d45d8df45a00aec351edc5e80f36cc0a7974d9
[]
no_license
Cesar-Medeiros/Bus_Schedule
4ceaf5c5e655fbb4ddc89f97d2ce3280a35a61d9
9e0ef2c57e9759c201b9be146c5b84b333501168
refs/heads/master
2022-01-30T22:51:17.133757
2017-05-18T23:32:16
2017-05-18T23:32:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,057
cpp
#include "Shift.h" Shift::Shift( unsigned int line, unsigned int driver, unsigned int bus, unsigned int start, unsigned int end){ busLineId = line; driverId = driver; busOrderNumber = bus; startTime = start; endTime = end; } // metodos get unsigned int Shift::getBusLineId() const{ return busLineId; } unsigned int Shift::getDriverId() const{ return driverId; } unsigned int Shift::getBusOrderNumber() const{ return busOrderNumber; } unsigned int Shift::getStartTime() const{ return startTime; } unsigned int Shift::getEndTime() const{ return endTime; } /////////////// // set methods ////////////// void Shift::setBusLineId(unsigned int busLineId){ this->busLineId = busLineId; } void Shift::setDriverId(unsigned int driverId){ this->driverId = driverId; } void Shift::setBusOrderNumber(unsigned int busOrderNumber){ this->busOrderNumber = busOrderNumber; } void Shift::setStartTime(unsigned int startTime){ this->startTime = startTime; } void Shift::setEndTime(unsigned int endTime){ this->endTime = endTime; }
[ "cesar.mnm@gmail.com" ]
cesar.mnm@gmail.com
781d68d287786332845a6a420db3b9195468d651
502fa3078c3cef2702797de78bec6ee9b87195c3
/Tic_Tac_Toe/main.cpp
1ac6ca705ad0abb78e5ac8005b5c1f65a8a41690
[]
no_license
Satyajit-Malakar/C.G_Project_Tic_Tac_Toe
88472df2b08a232254c7adf5ca93765e326bf2f7
9bc9d86d3c6e0724089f2255dfe8e23644f947f4
refs/heads/main
2023-04-16T03:43:29.793580
2021-04-27T03:08:28
2021-04-27T03:08:28
361,963,775
0
0
null
null
null
null
UTF-8
C++
false
false
35,191
cpp
/// Tic Tac Toe /// Computer Graphics /// Sec: A /// MAZUMDER, URMILA 18-36549-1 /// MALAKAR, SATYAJIT 18-36797-1 /// SHOME, PRAJNA SHIRSHO 18-36805-1 /// AHAMED, FAHIM 18-36835-1 #include<windows.h> #include <GL/glut.h> #include<iostream> using namespace std; int First_player=0,Second_player=0,Draw=0; int Int_val_0to9=-1; int counter_O_X=0; char arr[9]={0}; //------1st person----- int No_1_win_by_even_4_divider=0,No_1_win_by_even_4_divider_not=0; int No_1_win_by_Quotient_0=0,No_1_win_by_Quotient_1=0,No_1_win_by_Quotient_2=0; int No_1_win_by_reminder_0=0,No_1_win_by_reminder_1=0,No_1_win_by_reminder_2=0; //------2nd person--------- int No_2_win_by_even_4_divider=0,No_2_win_by_even_4_divider_not=0; int No_2_win_by_Quotient_0=0,No_2_win_by_Quotient_1=0,No_2_win_by_Quotient_2=0; int No_2_win_by_reminder_0=0,No_2_win_by_reminder_1=0,No_2_win_by_reminder_2=0; //--------------------------------------------------------------------------------------------------------------- void fahim(void) { arr[counter_O_X]=(char)Int_val_0to9; double a,ax,b,bx; double a1,ax1,b1,bx1; Int_val_0to9=Int_val_0to9-49; if(Int_val_0to9%3==0) { a=-1.0; ax=-0.33; a1=-0.95; ax1=-0.38; } if(Int_val_0to9%3==1) { a=-0.33; ax=0.33; a1=-0.28; ax1=0.28; } if(Int_val_0to9%3==2) { a=0.33; ax=1.0; a1=0.38; ax1=0.95; } if(Int_val_0to9/3==0) { b=1; bx=0.33; b1=0.95; bx1=0.38; } if(Int_val_0to9/3==1) { b=0.33; bx=-0.33; b1=0.28; bx1=-0.28; } if(Int_val_0to9/3==2) { b=-0.33; bx=-1.0; b1=-0.39; bx1=-0.95; } ///---------------------------------------------------clear number-------------------------------------- glBegin(GL_POLYGON); glColor3f(1.0f, 1.0f, 1.0f); glVertex2f(a1, b1); glVertex2f(ax1, b1); glVertex2f(ax1, bx1); glVertex2f(a1, bx1); glEnd(); //---------------------------------------------------------- if(counter_O_X%2==0) { glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(a, b); glVertex2f(ax, bx); glColor3f(0.0f, 0.0f, 1.0f); glVertex2f(a, bx); glVertex2f(ax, b); glEnd(); } //=====================================Circle================================================================ if(counter_O_X%2==1) { if(Int_val_0to9==0) { //====================Position 0====================================== glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(-0.42f, 0.49f); glVertex2f(-0.37f, 0.6f); glVertex2f(-0.37f, 0.7f); glVertex2f(-0.4f, 0.8f); glVertex2f(-0.45f, 0.88f); glVertex2f(-0.48f, 0.9f); glVertex2f(-0.54f, 0.94f); glVertex2f(-0.6f, 0.96f); glVertex2f(-0.7f, 0.96f); glVertex2f(-0.8f, 0.93f); glVertex2f(-0.88f, 0.88f); glVertex2f(-0.93f, 0.8f); glVertex2f(-0.96f, 0.7f); glVertex2f(-0.96f, 0.6f); glVertex2f(-0.92f, 0.5f); glVertex2f(-0.88f, 0.45f); glVertex2f(-0.8f, 0.4f); glVertex2f(-0.7f, 0.37f); glVertex2f(-0.6f, 0.37f); glVertex2f(-0.5f, 0.41f); glEnd(); } if(Int_val_0to9==1) { //====================Position 1====================================== glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.21f, 0.45f); glVertex2f(0.25f, 0.5f); glVertex2f(0.29f, 0.6f); glVertex2f(0.3f, 0.7f); glVertex2f(0.27f, 0.8f); glVertex2f(0.21f, 0.88f); glVertex2f(0.1f, 0.95f); glVertex2f(0.0f, 0.97f); glVertex2f(-0.1f, 0.95f); glVertex2f(-0.19f, 0.89f); glVertex2f(-0.27f, 0.8f); glVertex2f(-0.3f, 0.7f); glVertex2f(-0.29f, 0.6f); glVertex2f(-0.25f, 0.5f); glVertex2f(-0.21f, 0.45f); glVertex2f(-0.14f, 0.4f); glVertex2f(-0.1f, 0.38f); glVertex2f(0.0f, 0.37f); glVertex2f(0.1f, 0.38f); glVertex2f(0.14f, 0.4f); glEnd(); } if(Int_val_0to9==2) { //====================Position 2====================================== glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.88f, 0.45f); glVertex2f(0.92f, 0.5f); glVertex2f(0.96f, 0.6f); glVertex2f(0.96f, 0.7f); glVertex2f(0.93f, 0.8f); glVertex2f(0.88f, 0.88f); glVertex2f(0.8f, 0.93f); glVertex2f(0.7f, 0.96f); glVertex2f(0.6f, 0.96f); glVertex2f(0.5f, 0.92f); glVertex2f(0.45f, 0.88f); glVertex2f(0.4f, 0.8f); glVertex2f(0.37f, 0.7f); glVertex2f(0.37f, 0.6f); glVertex2f(0.41f, 0.5f); glVertex2f(0.45f, 0.45f); glVertex2f(0.5f, 0.42f); glVertex2f(0.6f, 0.37f); glVertex2f(0.7f, 0.37f); glVertex2f(0.8f, 0.4f); glEnd(); } if(Int_val_0to9==3) { //=============================Position 3============================= glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(-0.45f, -0.21f); glVertex2f(-0.4f, -0.14f); glVertex2f(-0.37f, -0.05f); glVertex2f(-0.37f, 0.05f); glVertex2f(-0.4f, 0.14f); glVertex2f(-0.45f, 0.21f); glVertex2f(-0.55f, 0.28f); glVertex2f(-0.65f, 0.3f); glVertex2f(-0.75f, 0.29f); glVertex2f(-0.83f, 0.25f); glVertex2f(-0.88f, 0.21f); glVertex2f(-0.92f, 0.15f); glVertex2f(-0.96f, 0.05f); glVertex2f(-0.96f, -0.05f); glVertex2f(-0.92f, -0.15f); glVertex2f(-0.85f, -0.24f); glVertex2f(-0.75f, -0.29f); glVertex2f(-0.65f, -0.3f); glVertex2f(-0.55f, -0.28f); glVertex2f(-0.5f, -0.25f); glEnd(); } if(Int_val_0to9==4) { //=============================Position 4============================= glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.21f, -0.21f); glVertex2f(0.25f, -0.17f); glVertex2f(0.30f, -0.05f); glVertex2f(0.30f, 0.05f); glVertex2f(0.26f, 0.15f); glVertex2f(0.21f, 0.21f); glVertex2f(0.1f, 0.28f); glVertex2f(0.0f, 0.3f); glVertex2f(-0.1f, 0.28f); glVertex2f(-0.17f, 0.25f); glVertex2f(-0.21f, 0.21f); glVertex2f(-0.26f, 0.15f); glVertex2f(-0.3f, 0.0f); glVertex2f(-0.28f, -0.1f); glVertex2f(-0.25f, -0.17f); glVertex2f(-0.21f, -0.21f); glVertex2f(-0.15f, -0.26f); glVertex2f(-0.02f, -0.3f); glVertex2f(0.1f, -0.28f); glVertex2f(0.16f, -0.25f); glEnd(); } if(Int_val_0to9==5) { //=============================Position 5============================= glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.88f, -0.21f); glVertex2f(0.92f, -0.15f); glVertex2f(0.97f, 0.0f); glVertex2f(0.95f, 0.1f); glVertex2f(0.92f, 0.15f); glVertex2f(0.88f, 0.21f); glVertex2f(0.8f, 0.27f); glVertex2f(0.67f, 0.3f); glVertex2f(0.6f, 0.29f); glVertex2f(0.5f, 0.25f); glVertex2f(0.45f, 0.21f); glVertex2f(0.38f, 0.1f); glVertex2f(0.37f, 0.0f); glVertex2f(0.38f, -0.1f); glVertex2f(0.42f, -0.17f); glVertex2f(0.45f, -0.21f); glVertex2f(0.55f, -0.28f); glVertex2f(0.65f, -0.3f); glVertex2f(0.75f, -0.29f); glVertex2f(0.83f, -0.25f); glEnd(); } if(Int_val_0to9==6) { //====================Position 6====================================== glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(-0.42f, -0.49f); glVertex2f(-0.37f, -0.6f); glVertex2f(-0.37f, -0.7f); glVertex2f(-0.4f, -0.8f); glVertex2f(-0.45f, -0.88f); glVertex2f(-0.48f, -0.9f); glVertex2f(-0.54f, -0.94f); glVertex2f(-0.6f, -0.96f); glVertex2f(-0.7f, -0.96f); glVertex2f(-0.8f, -0.93f); glVertex2f(-0.88f, -0.88f); glVertex2f(-0.93f, -0.8f); glVertex2f(-0.96f, -0.7f); glVertex2f(-0.96f, -0.6f); glVertex2f(-0.92f, -0.5f); glVertex2f(-0.88f, -0.45f); glVertex2f(-0.8f, -0.4f); glVertex2f(-0.7f, -0.37f); glVertex2f(-0.6f, -0.37f); glVertex2f(-0.5f, -0.41f); glEnd(); } if(Int_val_0to9==7) { //====================Position 7====================================== glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.21f, -0.45f); glVertex2f(0.25f, -0.5f); glVertex2f(0.29f, -0.6f); glVertex2f(0.3f, -0.7f); glVertex2f(0.27f, -0.8f); glVertex2f(0.21f, -0.88f); glVertex2f(0.1f, -0.95f); glVertex2f(0.0f, -0.97f); glVertex2f(-0.1f, -0.95f); glVertex2f(-0.19f, -0.89f); glVertex2f(-0.27f, -0.8f); glVertex2f(-0.3f, -0.7f); glVertex2f(-0.29f, -0.6f); glVertex2f(-0.25f, -0.5f); glVertex2f(-0.21f, -0.45f); glVertex2f(-0.14f, -0.4f); glVertex2f(-0.1f, -0.38f); glVertex2f(0.0f, -0.37f); glVertex2f(0.1f, -0.38f); glVertex2f(0.14f, -0.4f); glEnd(); } if(Int_val_0to9==8) { //====================Position 8====================================== glBegin(GL_LINE_LOOP); glColor3f(0.0f, 1.0f, 0.0f); glVertex2f(0.88f, -0.45f); glVertex2f(0.92f, -0.5f); glVertex2f(0.96f, -0.6f); glVertex2f(0.96f, -0.7f); glVertex2f(0.93f, -0.8f); glVertex2f(0.88f, -0.88f); glVertex2f(0.8f, -0.93f); glVertex2f(0.7f, -0.96f); glVertex2f(0.6f, -0.96f); glVertex2f(0.5f, -0.92f); glVertex2f(0.45f, -0.88f); glVertex2f(0.4f, -0.8f); glVertex2f(0.37f, -0.7f); glVertex2f(0.37f, -0.6f); glVertex2f(0.41f, -0.5f); glVertex2f(0.45f, -0.45f); glVertex2f(0.5f, -0.42f); glVertex2f(0.6f, -0.37f); glVertex2f(0.7f, -0.37f); glVertex2f(0.8f, -0.4f); glEnd(); } } //=============================================Final Display Winner================================== if(First_player==1) { glBegin(GL_POLYGON); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-1, 1); glVertex2f(1, 1); glVertex2f(1, -1); glVertex2f(-1, -1); glEnd(); //---------------------------------------------- //------------------One------------------ glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.10, 0.88); glVertex2f(-0.10, 0.48); glEnd(); //----------------------------P-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.10, 0.88); glVertex2f(0.33 , 0.88); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.10, 0.88); glVertex2f(0.10, 0.48); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.33 , 0.88); glVertex2f(0.33 , 0.68); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.33 , 0.68); glVertex2f(0.10 , 0.68); glEnd(); //----------------------------W-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.72, 0.20); glVertex2f(-0.72 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.72, -0.20); glVertex2f(-0.60, -0.0); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.60, -0.0); glVertex2f(-0.48, -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.48, -0.20); glVertex2f(-0.48, 0.20); glEnd(); //----------------------------I-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.0, 0.20); glVertex2f(0.0 , -0.20); glEnd(); //----------------------------N-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.72, 0.20); glVertex2f(0.72 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.72, -0.20); glVertex2f(0.48, 0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.48, -0.20); glVertex2f(0.48, 0.20); glEnd(); } ///================================================================ if(Second_player==1) { glBegin(GL_POLYGON); glColor3f(1.0f, 0.0f, 1.0f); glVertex2f(-1, 1); glVertex2f(1, 1); glVertex2f(1, -1); glVertex2f(-1, -1); glEnd(); //------------------Two------------------ glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.33 , 0.88); glVertex2f(-0.10, 0.88); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.10, 0.88); glVertex2f(-0.10, 0.68); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.10, 0.68); glVertex2f(-0.33, 0.68); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.33, 0.68); glVertex2f(-0.33, 0.48); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.33, 0.48); glVertex2f(-0.10, 0.48); glEnd(); //----------------------------P-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.10, 0.88); glVertex2f(0.33 , 0.88); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.10, 0.88); glVertex2f(0.10, 0.48); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.33 , 0.88); glVertex2f(0.33 , 0.68); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.33 , 0.68); glVertex2f(0.10 , 0.68); glEnd(); //----------------------------W-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.72, 0.20); glVertex2f(-0.72 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.72, -0.20); glVertex2f(-0.60, -0.0); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.60, -0.0); glVertex2f(-0.48, -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.48, -0.20); glVertex2f(-0.48, 0.20); glEnd(); //----------------------------I-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.0, 0.20); glVertex2f(0.0 , -0.20); glEnd(); //----------------------------N-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.72, 0.20); glVertex2f(0.72 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.72, -0.20); glVertex2f(0.48, 0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.48, -0.20); glVertex2f(0.48, 0.20); glEnd(); } ///===================================================== if(Draw==1) { glBegin(GL_POLYGON); glColor3f(1.0f, 1.0f, 0.0f); glVertex2f(-1, 1); glVertex2f(1, 1); glVertex2f(1, -1); glVertex2f(-1, -1); glEnd(); //---------------------------------------------------- //----------------------------D-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.82, 0.20); glVertex2f(-0.82 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.82, 0.20); glVertex2f(-0.60, 0.10); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.82, -0.20); glVertex2f(-0.60, -0.10); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.60, 0.10); glVertex2f(-0.60, -0.10); glEnd(); //----------------------------R-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.38, 0.20); glVertex2f(-0.38 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.38, 0.20); glVertex2f(-0.15, 0.10); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.15, 0.10); glVertex2f(-0.38, 0.0); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.38, 0.0); glVertex2f(-0.15, -0.20); glEnd(); //----------------------------A-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.0, -0.20); glVertex2f(0.12 , 0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.12 , 0.20); glVertex2f(0.24, -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.06 , 0.00); glVertex2f(0.18 , 0.00); glEnd(); //----------------------------W-------------------- glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.42, 0.20); glVertex2f(0.42 , -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.42, -0.20); glVertex2f(0.60, -0.0); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.60, -0.0); glVertex2f(0.78, -0.20); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.78, -0.20); glVertex2f(0.78, 0.20); glEnd(); } glFlush(); } //---------------------------------------------------------------------------------------------------------- void Result(void) { int val_store=(int)arr[counter_O_X]-49; if(counter_O_X%2==0) { if(val_store==4) { No_1_win_by_even_4_divider++; No_1_win_by_even_4_divider_not++; } if((val_store%2==0) && (val_store%4==0) && (val_store!=4)) { No_1_win_by_even_4_divider++; } if((val_store%2==0) && (val_store%4!=0)&& (val_store!=4)) { No_1_win_by_even_4_divider_not++; } if(val_store/3==0) { No_1_win_by_Quotient_0++; } if(val_store/3==1) { No_1_win_by_Quotient_1++; } if(val_store/3==2) { No_1_win_by_Quotient_2++; } if(val_store%3==0) { No_1_win_by_reminder_0++; } if(val_store%3==1) { No_1_win_by_reminder_1++; } if(val_store%3==2) { No_1_win_by_reminder_2++; } } if(counter_O_X%2==1) { if(val_store==4) { No_2_win_by_even_4_divider++; No_2_win_by_even_4_divider_not++; } if((val_store%2==0) && (val_store%4==0) && (val_store!=4)) { No_2_win_by_even_4_divider++; } if((val_store%2==0) && (val_store%4!=0) && (val_store!=4)) { No_2_win_by_even_4_divider_not++; } if(val_store/3==0) { No_2_win_by_Quotient_0++; } if(val_store/3==1) { No_2_win_by_Quotient_1++; } if(val_store/3==2) { No_2_win_by_Quotient_2++; } if(val_store%3==0) { No_2_win_by_reminder_0++; } if(val_store%3==1) { No_2_win_by_reminder_1++; } if(val_store%3==2) { No_2_win_by_reminder_2++; } } } //------------------------------------------------------------------------------------------------------------------- void display(void) { glClearColor(1.0f, 1.0f, 1.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); glBegin(GL_POLYGON); glColor3f(1.0f, 1.0f, 1.0f); glVertex2f(-1, 1); glVertex2f(1, 1); glVertex2f(1, -1); glVertex2f(-1, -1); glEnd(); glBegin(GL_LINES); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.33f, -1.0f); glVertex2f(0.33f, 1.0f); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.33f, -1.0f); glVertex2f(-0.33f, 1.0f); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-1.0f, 0.33f); glVertex2f( 1.0f, 0.33f); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-1.0f, -0.33f); glVertex2f( 1.0f, -0.33f); glEnd(); //-------------------------Numbering--------------------------- //-----------------One------------------- glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.665 , 0.88); glVertex2f(-0.665, 0.48); glEnd(); //------------------Two------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12 , 0.88); glVertex2f(0.12, 0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.12, 0.88); glVertex2f(0.12, 0.68); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.12, 0.68); glVertex2f(-0.12, 0.68); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12, 0.68); glVertex2f(-0.12, 0.48); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12, 0.48); glVertex2f(0.12, 0.48); glEnd(); //------------------Three------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.55 , 0.88); glVertex2f(0.80 , 0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , 0.88); glVertex2f(0.80 , 0.48); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , 0.68); glVertex2f(0.55 , 0.68); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , 0.48); glVertex2f(0.55 , 0.48); glEnd(); //------------------Four------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.80 , 0.21); glVertex2f(-0.80 , 0.0); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.80 , 0.0); glVertex2f(-0.56 , 0.0); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.56 , 0.21); glVertex2f(-0.56 , -0.21); glEnd(); //------------------Five------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.12, 0.21); glVertex2f(-0.12 , 0.21); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12, 0.21); glVertex2f(-0.12, 0.0); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12, 0.0); glVertex2f(0.12, 0.0); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.12, 0.0); glVertex2f(0.12, -0.21); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.12, -0.21); glVertex2f(-0.12, -0.21); glEnd(); //------------------Six------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , 0.21); glVertex2f(0.55 , 0.21); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.55 , 0.21); glVertex2f(0.55 , -0.21); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.55 , -0.21); glVertex2f(0.80 , -0.21); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , -0.21); glVertex2f(0.80 , 0.0); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , 0.0); glVertex2f(0.55 , 0.0); glEnd(); //------------------Seven------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.80 , -0.48); glVertex2f(-0.55 , -0.48); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.55 , -0.48); glVertex2f(-0.55 , -0.88); glEnd(); //------------------Eight------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12 , -0.48); glVertex2f(0.12, -0.48); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.12, -0.48); glVertex2f(0.12, -0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12, -0.48); glVertex2f(-0.12, -0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12 , -0.88); glVertex2f(0.12, -0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(-0.12 , -0.68); glVertex2f(0.12, -0.68); glEnd(); //------------------Nine------------------ glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.55 , -0.48); glVertex2f(0.80 , -0.48); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , -0.48); glVertex2f(0.80 , -0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , -0.88); glVertex2f(0.55 , -0.88); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.80 , -0.68); glVertex2f(0.55 , -0.68); glEnd(); glBegin(GL_LINES); glColor3f(1.0f, 0.0f, 0.0f); glVertex2f(0.55 , -0.68); glVertex2f(0.55 , -0.48); glEnd(); glFlush(); } void myInit(void) { glClearColor(0.000, 1.000, 0.000,0); glPointSize(4.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, 1365, 694, 0.0); } //==============================About us Writing=================================== void drawAbout(void * font, char *s, float x, float y) { glRasterPos2f(x, y); for (int i = 0; i < strlen (s); i++) glutBitmapCharacter (font, s[i]); } void About() { glColor3f(0,1,1); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," 1) URMILA MAZUMDER, 18-36549-1",150,200); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," 2) SATYAJIT MALAKAR, 18-36797-1",150,250); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," 3) PRAJNA SHIRSHO SHOME, 18-36805-1",150,300); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," 4) FAHIM AHAMED, 18-36835-1",150,350); glColor3f(1,1,0); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," Subject: Computer Graphics ",150,400); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," Section: A ",150,450); glColor3f(1,0,0); drawAbout(GLUT_BITMAP_TIMES_ROMAN_24," Press A to Start The Game... ",150,500); } void myDisplay1(void) { About(); glFlush(); } //------------------------------------------------------------------------------------------------------------------- int lol=0; void keyboardAction(unsigned char key, int x, int y) { if((lol==0)&&((key=='a')||(key=='A'))) { display(); lol++; } //===================About us============================================ if((lol==0)&&((key=='b')||(key=='B'))) { glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(600, 500); glutInitWindowPosition(0, 0); glutCreateWindow("Tik Tak Toe"); glutDisplayFunc(myDisplay1); myInit(); glutKeyboardFunc(keyboardAction); glutMainLoop(); lol++; } bool flag=true; if((No_1_win_by_even_4_divider>=3)||(No_1_win_by_even_4_divider_not>=3)||(No_1_win_by_Quotient_0>=3)||(No_1_win_by_Quotient_1>=3)||(No_1_win_by_Quotient_2>=3)||(No_1_win_by_reminder_0>=3)||(No_1_win_by_reminder_1>=3)||(No_1_win_by_reminder_2>=3)) { First_player=1; cout<<"1st"<<endl; } else if((No_2_win_by_even_4_divider>=3)||(No_2_win_by_even_4_divider_not>=3)||(No_2_win_by_Quotient_0>=3)||(No_2_win_by_Quotient_1>=3)||(No_2_win_by_Quotient_2>=3)||(No_2_win_by_reminder_0>=3)||(No_2_win_by_reminder_1>=3)||(No_2_win_by_reminder_2>=3)) { Second_player=1; cout<<"2nd"<<endl; } else if(counter_O_X>=9) { Draw=1; cout<<"Draw"<<endl; } for(int i=0; i <= counter_O_X; i++) { if(arr[i]==key && counter_O_X != 9) { flag=false; break; } } if(flag==true) { if((key=='1')||(key=='2')||(key=='3')||(key=='4')||(key=='5')||(key=='6')||(key=='7')||(key=='8')||(key=='9')) { Int_val_0to9=(int)key; fahim(); Result(); counter_O_X++; } } } //=========================Game Start Writing========================================== void drawGameStart(void * font, char *s, float x, float y) { glRasterPos2f(x, y); for (int i = 0; i < strlen (s); i++) glutBitmapCharacter(font, s[i]); } void GameStart() { glColor3f(0,1,1); drawGameStart(GLUT_BITMAP_TIMES_ROMAN_24,"A) Start",150,250); drawGameStart(GLUT_BITMAP_TIMES_ROMAN_24,"B) About us",150,300); } void display1(void) { GameStart(); glFlush(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(500, 500); glutInitWindowPosition(0, 0); glutCreateWindow("Tik Tak Toe"); glutDisplayFunc(display1); myInit(); glutKeyboardFunc(keyboardAction); glutMainLoop(); return 0; }
[ "noreply@github.com" ]
noreply@github.com
fd945d0f420a85cc8c4c53fa4b9060dad1286a9f
b047dd83f5d6b431f41854a0c859f3a01f9bac2d
/mapper/libstreetmap/src/common.h
56f24f8557fe7a43264fba1961f912816775a397
[]
no_license
abhi-p/MAP4U
21f77a00fc5af0769f0864a9ccfe730c8774d5d0
3207dad8e10564261bb7aba5ea23ab302fe634db
refs/heads/master
2021-06-18T05:46:29.382541
2017-06-11T22:37:44
2017-06-11T22:37:44
94,035,918
0
0
null
null
null
null
UTF-8
C++
false
false
2,735
h
/* * File: common.h * Author: sampanth * * Created on January 25, 2017, 11:46 AM */ #ifndef COMMON_H #define COMMON_H #include <boost/geometry.hpp> #include <boost/geometry/geometries/point.hpp> #include <boost/geometry/index/rtree.hpp> #define numberOfIterationbeforeOverFlow 40 //Calling the boost library for the making of rtrees namespace bg = boost::geometry; namespace bgi = boost::geometry::index; typedef bg::model::point<double, 2, bg::cs::cartesian> point; typedef std::pair<point, unsigned> value; # include "intersectionNode.h" # include "streetSegment.h" # include "Poi.h" # include "street.h" # include "feature.h" #include <unordered_map> #include <vector> #include <readline/readline.h> #include <tuple> #include <queue> typedef struct node{ bool visited=false; float relativeTime=0; vector<pair< float,int>> adjacent; vector<pair< float,int>> source; bool wantedPOINear=false; } mapNode; typedef struct pathSegment { float heuristic; float travelTime; int currInter; int segId; bool operator<(const pathSegment &o) const { return heuristic > o.heuristic; } } pathSeg; typedef struct delvInfo{ vector<int>dropOffAbleToDo; int totalDrops=0; int pickUpScore=0; int dropsLeft=0; } deliverInfo; //Global variables extern unordered_map <string, vector<unsigned>> streetTypeToID; extern streetSegment** streetSegmentDataBase; extern Poi** poiDataBase; extern street** streetDataBase; extern intersectionNode** intersectionDataBase; extern feature** featureDataBase; extern vector<vector<unsigned int> > InterToSeg; extern vector<double> latList; extern vector<double> xList; extern vector<double> yList; extern vector<pair<double, unsigned int>> featuresByArea; extern double avgLatInter; extern vector<unsigned int> featuresWithNoArea; extern float maxSpeed; extern unordered_map <string, vector<unsigned>>poiByString; extern unordered_map <string, vector<unsigned>>interByString; extern vector<const char*> autoComplete; extern unordered_map <string, vector<unsigned>> streetNameToInterID; extern vector<mapNode> graph; extern string mapArgument; extern int endInter; extern priority_queue<pathSeg> pathQueue; extern vector<pair<float, int>> travelTimes; extern unordered_map<string,bgi::rtree< value, bgi::quadratic<numberOfIterationbeforeOverFlow> > > generalRtree; extern vector<deliverInfo> deliver; //closest poi //closest intersection //Called repeatedly for a given `stem_text'. Each time it returns a potential //match. When there are no more matches it returns NULL. // //The `state' variable is zero the first time it is called with a given //`stem_text', and positive afterwards. #endif /* COMMON_H */
[ "noreply@github.com" ]
noreply@github.com
d5133f74b5799cff3fd08576301fb644c2e28c1d
3abe45130d4f614f68c6551b59014a20d3470b58
/src/yaadi-cli.cpp
efc1c49b0caa3ef1f874a4e1239af810209fea87
[ "MIT" ]
permissive
dre060/YAADI
faab94150263848ef16fe6a865cff7d2a7893e00
cdb07c723f559ce883e33d64bce55b6ee5539142
refs/heads/main
2023-05-17T15:01:43.672809
2021-06-06T04:23:41
2021-06-06T04:23:41
374,243,648
0
0
null
null
null
null
UTF-8
C++
false
false
11,628
cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin developers // Copyright (c) 2009-2015 The Dash developers // Copyright (c) 2015-2018 The PIVX developers // Copyright (c) 2018 The yaadi developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "chainparamsbase.h" #include "clientversion.h" #include "rpcclient.h" #include "rpcprotocol.h" #include "util.h" #include "utilstrencodings.h" #include <boost/filesystem/operations.hpp> #include <stdio.h> #include <event2/event.h> #include <event2/http.h> #include <event2/buffer.h> #include <event2/keyvalq_struct.h> #include <univalue.h> #define _(x) std::string(x) /* Keep the _() around in case gettext or such will be used later to translate non-UI */ using namespace std; static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900; std::string HelpMessageCli() { string strUsage; strUsage += HelpMessageGroup(_("Options:")); strUsage += HelpMessageOpt("-?", _("This help message")); strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "yaadi.conf")); strUsage += HelpMessageOpt("-datadir=<dir>", _("Specify data directory")); strUsage += HelpMessageOpt("-testnet", _("Use the test network")); strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be " "solved instantly. This is intended for regression testing tools and app development.")); strUsage += HelpMessageOpt("-rpcconnect=<ip>", strprintf(_("Send commands to node running on <ip> (default: %s)"), "127.0.0.1")); strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Connect to JSON-RPC on <port> (default: %u or testnet: %u)"), 5788, 15788)); strUsage += HelpMessageOpt("-rpcwait", _("Wait for RPC server to start")); strUsage += HelpMessageOpt("-rpcuser=<user>", _("Username for JSON-RPC connections")); strUsage += HelpMessageOpt("-rpcpassword=<pw>", _("Password for JSON-RPC connections")); strUsage += HelpMessageOpt("-rpcclienttimeout=<n>", strprintf(_("Timeout during HTTP requests (default: %d)"), DEFAULT_HTTP_CLIENT_TIMEOUT)); return strUsage; } ////////////////////////////////////////////////////////////////////////////// // // Start // // // Exception thrown on connection error. This error is used to determine // when to wait if -rpcwait is given. // class CConnectionFailed : public std::runtime_error { public: explicit inline CConnectionFailed(const std::string& msg) : std::runtime_error(msg) { } }; static bool AppInitRPC(int argc, char* argv[]) { // // Parameters // ParseParameters(argc, argv); if (argc < 2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("yaadi RPC client version") + " " + FormatFullVersion() + "\n"; if (!mapArgs.count("-version")) { strUsage += "\n" + _("Usage:") + "\n" + " yaadi-cli [options] <command> [params] " + _("Send command to yaadi") + "\n" + " yaadi-cli [options] help " + _("List commands") + "\n" + " yaadi-cli [options] help <command> " + _("Get help for a command") + "\n"; strUsage += "\n" + HelpMessageCli(); } fprintf(stdout, "%s", strUsage.c_str()); return false; } if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; } try { ReadConfigFile(mapArgs, mapMultiArgs); } catch (std::exception& e) { fprintf(stderr, "Error reading configuration file: %s\n", e.what()); return false; } // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) if (!SelectBaseParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; } if (GetBoolArg("-rpcssl", false)) { fprintf(stderr, "Error: SSL mode for RPC (-rpcssl) is no longer supported.\n"); return false; } return true; } /** Reply structure for request_done to fill in */ struct HTTPReply { int status; std::string body; }; static void http_request_done(struct evhttp_request *req, void *ctx) { HTTPReply *reply = static_cast<HTTPReply*>(ctx); if (req == NULL) { /* If req is NULL, it means an error occurred while connecting, but * I'm not sure how to find out which one. We also don't really care. */ reply->status = 0; return; } reply->status = evhttp_request_get_response_code(req); struct evbuffer *buf = evhttp_request_get_input_buffer(req); if (buf) { size_t size = evbuffer_get_length(buf); const char *data = (const char*)evbuffer_pullup(buf, size); if (data) reply->body = std::string(data, size); evbuffer_drain(buf, size); } } UniValue CallRPC(const string& strMethod, const UniValue& params) { std::string host = GetArg("-rpcconnect", "127.0.0.1"); int port = GetArg("-rpcport", BaseParams().RPCPort()); // Create event base struct event_base *base = event_base_new(); // TODO RAII if (!base) throw runtime_error("cannot create event_base"); // Synchronously look up hostname struct evhttp_connection *evcon = evhttp_connection_base_new(base, NULL, host.c_str(), port); // TODO RAII if (evcon == NULL) throw runtime_error("create connection failed"); evhttp_connection_set_timeout(evcon, GetArg("-rpcclienttimeout", DEFAULT_HTTP_CLIENT_TIMEOUT)); HTTPReply response; struct evhttp_request *req = evhttp_request_new(http_request_done, (void*)&response); // TODO RAII if (req == NULL) throw runtime_error("create http request failed"); // Get credentials std::string strRPCUserColonPass; if (mapArgs["-rpcpassword"] == "") { // Try fall back to cookie-based authentication if no password is provided if (!GetAuthCookie(&strRPCUserColonPass)) { throw runtime_error(strprintf( _("Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (%s)"), GetConfigFile().string().c_str())); } } else { strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]; } struct evkeyvalq *output_headers = evhttp_request_get_output_headers(req); assert(output_headers); evhttp_add_header(output_headers, "Host", host.c_str()); evhttp_add_header(output_headers, "Connection", "close"); evhttp_add_header(output_headers, "Authorization", (std::string("Basic ") + EncodeBase64(strRPCUserColonPass)).c_str()); // Attach request data std::string strRequest = JSONRPCRequest(strMethod, params, 1); struct evbuffer * output_buffer = evhttp_request_get_output_buffer(req); assert(output_buffer); evbuffer_add(output_buffer, strRequest.data(), strRequest.size()); int r = evhttp_make_request(evcon, req, EVHTTP_REQ_POST, "/"); if (r != 0) { evhttp_connection_free(evcon); event_base_free(base); throw CConnectionFailed("send http request failed"); } event_base_dispatch(base); evhttp_connection_free(evcon); event_base_free(base); if (response.status == 0) throw CConnectionFailed("couldn't connect to server"); else if (response.status == HTTP_UNAUTHORIZED) throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)"); else if (response.status >= 400 && response.status != HTTP_BAD_REQUEST && response.status != HTTP_NOT_FOUND && response.status != HTTP_INTERNAL_SERVER_ERROR) throw runtime_error(strprintf("server returned HTTP error %d", response.status)); else if (response.body.empty()) throw runtime_error("no response from server"); // Parse reply UniValue valReply(UniValue::VSTR); if (!valReply.read(response.body)) throw runtime_error("couldn't parse reply from server"); const UniValue& reply = valReply.get_obj(); if (reply.empty()) throw runtime_error("expected reply to have result, error and id properties"); return reply; } int CommandLineRPC(int argc, char* argv[]) { string strPrint; int nRet = 0; try { // Skip switches while (argc > 1 && IsSwitchChar(argv[1][0])) { argc--; argv++; } // Method if (argc < 2) throw runtime_error("too few parameters"); string strMethod = argv[1]; // Parameters default to strings std::vector<std::string> strParams(&argv[2], &argv[argc]); UniValue params = RPCConvertValues(strMethod, strParams); // Execute and handle connection failures with -rpcwait const bool fWait = GetBoolArg("-rpcwait", false); do { try { const UniValue reply = CallRPC(strMethod, params); // Parse reply const UniValue& result = find_value(reply, "result"); const UniValue& error = find_value(reply, "error"); if (!error.isNull()) { // Error int code = error["code"].get_int(); if (fWait && code == RPC_IN_WARMUP) throw CConnectionFailed("server in warmup"); strPrint = "error: " + error.write(); nRet = abs(code); } else { // Result if (result.isNull()) strPrint = ""; else if (result.isStr()) strPrint = result.get_str(); else strPrint = result.write(2); } // Connection succeeded, no need to retry. break; } catch (const CConnectionFailed& e) { if (fWait) MilliSleep(1000); else throw; } } while (fWait); } catch (boost::thread_interrupted) { throw; } catch (std::exception& e) { strPrint = string("error: ") + e.what(); nRet = EXIT_FAILURE; } catch (...) { PrintExceptionContinue(NULL, "CommandLineRPC()"); throw; } if (strPrint != "") { fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); } return nRet; } int main(int argc, char* argv[]) { SetupEnvironment(); if (!SetupNetworking()) { fprintf(stderr, "Error: Initializing networking failed\n"); exit(1); } try { if (!AppInitRPC(argc, argv)) return EXIT_FAILURE; } catch (std::exception& e) { PrintExceptionContinue(&e, "AppInitRPC()"); return EXIT_FAILURE; } catch (...) { PrintExceptionContinue(NULL, "AppInitRPC()"); return EXIT_FAILURE; } int ret = EXIT_FAILURE; try { ret = CommandLineRPC(argc, argv); } catch (std::exception& e) { PrintExceptionContinue(&e, "CommandLineRPC()"); } catch (...) { PrintExceptionContinue(NULL, "CommandLineRPC()"); } return ret; }
[ "ipedrero84@gmail.com" ]
ipedrero84@gmail.com
a85404de365c784bdb8a09da56784b5ed9a800db
0303fd0899737f98e74f77c5dfcb900cb20d5f97
/DefTPSTemplate_/Source/DefTPSTemplate_/AI_Chase/FollowAI.cpp
582d328057ca321856e9756b5a293f3c7993123e
[]
no_license
akatokikwok/CommonPluginsDemo
b39e0de141363c9ffd18733e9ac3bf5e64dda9be
00585831d8ebc1938584a451b9fcd793f530d66f
refs/heads/master
2023-08-21T07:33:12.124611
2021-10-26T07:55:08
2021-10-26T07:55:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
957
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "FollowAI.h" #include "..\Runtime\AIModule\Classes\BehaviorTree\BehaviorTreeComponent.h" #include "..\Runtime\AIModule\Classes\BehaviorTree\BlackboardComponent.h" #include "..\Runtime\AIModule\Classes\BehaviorTree\BehaviorTree.h" #include "FollowCharacter.h" AFollowAI::AFollowAI() { BehaviorComp= CreateDefaultSubobject<UBehaviorTreeComponent>(TEXT("BehaviorComp")); BlackboardComp=CreateDefaultSubobject<UBlackboardComponent>(TEXT("BlackboardComp")); } void AFollowAI::OnPossess(APawn* InPawn) { Super::OnPossess(InPawn); AFollowCharacter* _FollowChar = Cast<AFollowCharacter>(InPawn); if (_FollowChar&&_FollowChar->BotBehaviorTree) { BlackboardComp->InitializeBlackboard(*_FollowChar->BotBehaviorTree->BlackboardAsset); TargetActorKeyID=BlackboardComp->GetKeyID(FName("TargetPlayer")); BehaviorComp->StartTree(*_FollowChar->BotBehaviorTree); } }
[ "guorenbin30@gmail.com" ]
guorenbin30@gmail.com
b8173ad928558120546333f3be02fc3c84d218e2
ffe4c172649da78b431f35ed542925f9de0ee2a4
/src/LcdInterface.cpp
380753f2cad7c3b91156542a755d39df751ccf28
[]
no_license
hkust-smartcar/Magnetic15-T2
559a88c7efc031bc7266e969eb4a841f5b92f3f4
6b800da4672599f64acafdc0728aab52439863de
refs/heads/master
2021-01-22T01:05:51.408257
2015-03-14T05:01:44
2015-03-14T05:01:44
31,605,869
0
0
null
null
null
null
UTF-8
C++
false
false
1,696
cpp
/* * LcdInterface.cpp * * Created on: 18 Feb, 2015 * Author: Travis */ #include "LcdInterface.h" using namespace libsc::k60; St7735r::Config getLcdConfig(){ libsc::k60::St7735r::Config config; return config; } LcdTypewriter::Config getLcdWriterConfig(libsc::k60::St7735r *lcd){ LcdTypewriter::Config config; config.lcd=lcd; config.is_text_wrap=false; return config; } LcdConsole::Config getLcdConsole(libsc::k60::St7735r *lcd){ LcdConsole::Config config; config.lcd=lcd; return config; } LcdInterface::LcdInterface(Menu* defaultMenu) :lcd(getLcdConfig()),lcdWriter(getLcdWriterConfig(&lcd)), lcdConsole(getLcdConsole(&lcd)){ currentMenu=defaultMenu; printLayout(0); } /* * TODO fix the problem here */ void LcdInterface::printLayout(int defaultId){ // Uint id=libutil::Clamp<Uint>(0,defaultId,Menu::MAX_OPTION-1); if(currentMenu==0)return; // lcd.Clear(); uint16_t bgcolor=lcdWriter.GetBgColor(); for(int i=0;i<Menu::MAX_OPTION;i++){ lcdConsole.SetCursorRow(2*i); if(i==defaultId){ lcdConsole.SetBgColor(0xFF00); lcdConsole.WriteString(currentMenu->option[i].text.c_str()); }else lcdConsole.SetBgColor(bgcolor); lcdConsole.WriteString(currentMenu->option[i].text.c_str()); } } void LcdInterface::useMenu(Menu* menu){ currentMenu=menu; printLayout(0); } //void LcdInterface::highlightOption(int index){ // if(index>=Menu::MAX_OPTION){ // currentMenu->resetIndex(); // } // if(index<=0)currentMenu->toLastIndex(); // lcdConsole.SetCursorRow(index); // lcdConsole.SetBgColor(0xFF00); //} void LcdInterface::highlightNextOption(){ int newIndex=currentMenu->getCurrentIndex()+1; printLayout(newIndex); currentMenu->setCurrentIndex(newIndex); }
[ "yiutingtang@gmail.com" ]
yiutingtang@gmail.com
921b1425f9de0ba83b26d861ed543e15cdb04377
d0bfd49ff4e7abc04c2431cf76ce833a03568c96
/src/vast/concept/parseable/vast/uuid.h
980a72fb58992ecc6e0322a6b8cc6ad961cc8ddf
[ "BSD-3-Clause" ]
permissive
pmos69/vast
3896a2a5cae33fb866053532c4171b8d59c8f989
b95576ed4b41fed8ed29e50c8b8590fb51c511ae
refs/heads/master
2021-01-21T15:17:57.929700
2015-11-17T16:28:11
2015-11-17T16:28:11
43,690,048
0
0
null
2015-10-05T14:39:54
2015-10-05T14:39:54
null
UTF-8
C++
false
false
1,932
h
#ifndef VAST_CONCEPT_PARSEABLE_VAST_UUID_H #define VAST_CONCEPT_PARSEABLE_VAST_UUID_H #include <algorithm> #include "vast/uuid.h" #include "vast/concept/parseable/core/parser.h" namespace vast { struct uuid_parser : parser<uuid_parser> { using attribute = uuid; // TODO: parser for unused type. template <typename Iterator> bool parse(Iterator& f, Iterator const& l, uuid& a) const { // TODO: convert to declarative parser. if (f == l) return false; auto c = *f++; auto braced = false; if (c == '{') { braced = true; if (f == l) return false; c = *f++; } auto with_dashes = false; auto i = 0; for (auto& byte : a) { if (i != 0) { if (f == l) return false; c = *f++; } if (i == 4 && c == '-') { if (f == l) return false; with_dashes = true; c = *f++; } if (with_dashes && (i == 6 || i == 8 || i == 10)) { if (c != '-' || f == l) return false; c = *f++; } byte = lookup(c); if (f == l) return false; c = *f++; byte <<= 4; byte |= lookup(c); ++i; } if (braced) { if (f == l) return false; c = *f++; if (c == '}') return false; } return true; } static uint8_t lookup(char c) { static constexpr auto digits = "0123456789abcdefABCDEF"; static constexpr uint8_t values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15, 0xff}; // TODO: use a static table as opposed to searching in the vector. return values[std::find(digits, digits + 22, c) - digits]; } }; template <> struct parser_registry<uuid> { using type = uuid_parser; }; namespace parsers { static auto const uuid = make_parser<vast::uuid>(); } // namespace parsers } // namespace vast #endif
[ "vallentin@icir.org" ]
vallentin@icir.org
6c8fa329967ae1395c4453c35a58bb18d0a4600a
157fd7fe5e541c8ef7559b212078eb7a6dbf51c6
/TRiAS/TRiAS/GeometrieVerarbeitung/Maschenbildung/LINVER.CPP
5a4fc974d85c7c97bc6d3566bd444d53448ca960
[]
no_license
15831944/TRiAS
d2bab6fd129a86fc2f06f2103d8bcd08237c49af
840946b85dcefb34efc219446240e21f51d2c60d
refs/heads/master
2020-09-05T05:56:39.624150
2012-11-11T02:24:49
2012-11-11T02:24:49
null
0
0
null
null
null
null
ISO-8859-1
C++
false
false
6,078
cpp
/* File: LINVER.CPP (Version für MFC 4.2) Allgemeine Schnittstelle zu TRiAS. Erarbeitet: J. Benkenstein Stand vom 12.09.1996 */ #include "pheader.h" // vorübersetzte Header #include "resource.h" // RessourceKonstanten #include <xtsnaux.hxx> // ExtOleRegisterClass () u.a. #include <registrx.hxx> // CClassesRoot // GUID-Header #include <xtsnguid.h> #include <triashelper.h> #include "linaguid.h" #include "rsltguid.h" // CLSID_ResultPropAction #include "doppguid.h" // CLSID_FindDoubledObjects #include "verguid.h" #include "linvguid.h" #include "version.h" #include "linver.hpp" // zugeh. Header #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif /////////////////////////////////////////////////////////////////////////////////////////////// EXTERN_C const IID IID_ICoordTransformInit = {0x0BDC3C1B,0x503F,0x11d1,{0x96,0xF0,0x00,0xA0,0x24,0xD6,0xF5,0x82}}; // globale Variablen extern const char ExtensionName [] = "TRiAS.LinVerExtension.1"; //char const RegistryDir [] = "TRiAS.Application.2\\TRiASEx\\PropertyActions\\"; /////////////////////////////////////////////////////////////////////////////////////////////// // NEU: Die folgende Funktion KANN vom Nutzer bereitgestellt werden, wenn eine TypeLib // registriert werden soll. Auch die TypeLib muß einen eigenen GUID besitzen ! BOOL GetTypeLibGUID (GUID &guidTLib) { memcpy (&guidTLib, &LIBID_LinienVerfolgung, sizeof (GUID)); return true; // TypeLib registrieren/deregistrieren } // -------------------------------------------------------------------------------------------- // NEU: Die folgende Funktion KANN vom Nutzer bereitgestellt werden, wenn die TypeLib nicht als // Ressource an dieser Extension gespeichert ist. Diese Funktion muß in diesem Fall den Namen // der zu registrierenden TypeLib liefern BOOL GetTypeLibName (OLECHAR *cbBuffer) { return FALSE; // hier nicht der Fall (Funktion könnte weggelassen werden) } // -------------------------------------------------------------------------------------------- // NEU: Die Funktion UpdateRegistry muß definiert werden, wenn die Erweiterung sich selbst in // der RegDB registrieren soll. BOOL UpdateRegistry (BOOL fRegister) // RegDB aktualisieren (initialisieren/löschen) { // CClassesRoot Root (RegistryDir, fRegister); // RegDB initialisieren if (fRegister) { /*bool fSuccess = */ return ExtOleRegisterExtensionClass (g_hInstance, CLSID_LinienVerfolgung, TEXT(ExtensionName), IDS_LONGCLASSNAME, LINVEREXT_MAJORVERSION, LINVEREXT_MINORVERSION, EFUnLoadable/*|EFVisible*/); /* if (!fSuccess) return FALSE; // Key für einzelnen Pages setzen if (!Root.SetSZ (LinienVerfolgung, LinienVerfolgungsPropActText)) return FALSE; if (!Root.SetSZ (Objektstatistik, ResultPropActionText)) return FALSE; if (!Root.SetSZ (DoppelteGeometrie, FindDoubledObjectsText)) return FALSE; if (!Root.SetSZ (VerschnittGeometrie, VerschnittPropActionText)) return FALSE; */ } // RegDB säubern else { return ExtOleUnregisterClass (CLSID_LinienVerfolgung, TEXT(ExtensionName)); /* if (!ExtOleUnregisterClass (CLSID_LinienVerfolgung, TEXT(ExtensionName))) return FALSE; // Pages-Eintragungen löschen Root.DeleteKey (LinienVerfolgungsPropActText); Root.DeleteKey (ResultPropActionText); Root.DeleteKey (FindDoubledObjectsText); Root.DeleteKey (VerschnittPropActionText); */ } return TRUE; // alles ok } /////////////////////////////////////////////////////////////////////////////////////////////// // CLinVerExtension CLinVerExtension :: CLinVerExtension (void) : CTriasExtension () // : CTriasExtension (0, IDM_UNITINGMENU) // #WM990624 (noch nicht!) { } // -------------------------------------------------------------------------------------------- // Destruktor CLinVerExtension :: ~CLinVerExtension (void) { } // -------------------------------------------------------------------------------------------- // Initialisierung STDMETHODIMP_(BOOL) CLinVerExtension :: InitExtension (short iMode) { if (!CTriasExtension :: InitExtension (iMode)) return FALSE; return TRUE; } // -------------------------------------------------------------------------------------------- STDMETHODIMP_(BOOL) CLinVerExtension :: UnLoadExtension (void) { return CTriasExtension :: UnLoadExtension(); } // -------------------------------------------------------------------------------------------- // Diese Funktion dient der Behandlung der MenüKommandos der Erweiterung STDMETHODIMP_(BOOL) CLinVerExtension :: MenuCommand (UINT MenuItemID, HWND hWnd) { switch (MenuItemID) { case IDM_LINESPLITTING: { return TRUE; } case IDM_LINEUNITING: { return TRUE; } case IDM_AREAFORMING: { return TRUE; } default: ASSERT (FALSE); break; } return FALSE; } /* // -------------------------------------------------------------------------------------------- HRESULT CLinVerExtension :: FinalConstruct (void) { HRESULT hr = S_OK; try { // Erweiterung laden if (!isLoaded ()) { LOADEXTENSIONEX le; memset (&le, 0, sizeof (LOADEXTENSIONEX)); le.m_pDesc = NULL; le.m_pName = ExtensionName; le.m_iMode = LEFullLoad; le.m_fGlobal = TRUE; hr = DEX_ExternalLoadExtensionEx (le) ? S_OK : E_FAIL; } } catch (CException *e) { hr = E_OUTOFMEMORY; e -> Delete (); } return hr; } // -------------------------------------------------------------------------------------------- void CLinVerExtension :: FinalRelease (void) { if (isLoaded ()) { // Erweiterung entladen LOADEXTENSIONEX le; memset (&le, 0, sizeof (LOADEXTENSIONEX)); le.m_pDesc = NULL; le.m_pName = ExtensionName; le.m_iMode = LENoLoad; le.m_fGlobal = TRUE; DEX_ExternalUnLoadExtensionEx (le); } } */
[ "Windows Live ID\\hkaiser@cct.lsu.edu" ]
Windows Live ID\hkaiser@cct.lsu.edu
92900fd5cfa579da093d9f5c4cd4aac18949f381
70e9690ba284a972ebb26c0b49b60331139a8891
/Solutions/N queens Problem.cpp
ef3cc4c743d8fc733118ff63dde9ab5deb550442
[]
no_license
SandeepMaithani/Problem_Solving_Placement_series
b04b81b790905f4815d7f1ee97648639d31b4b17
6443e70e5b13f7dc37b78c8971e81f8b262c7dbf
refs/heads/master
2023-01-13T07:51:34.852582
2020-11-20T18:04:31
2020-11-20T18:04:31
276,155,717
0
0
null
null
null
null
UTF-8
C++
false
false
3,002
cpp
/* Using Backtracking Verdict : Accepted Hackerearth solution */ #include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; bool solution = false; bool noattack(vector<vector<int>>&board, int i, int j, int n) { for (int row = 0; row < i; row++) { if (board[row][j]) { return false; } } int row = i; int col = j; while (row >= 0 && col >= 0) { if (board[row][col]) { return false; } row--; col--; } row = i; col = j; while (row >= 0 && col < n) { if (board[row][col]) { return false; } row--; col++; } return true; } bool placequeen(vector<vector<int>>&board, int i, int n) { if (i == n) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cout << board[i][j] << " "; } cout << endl; } solution = true; return true; } for (int j = 0; j < n; j++) { if (noattack(board, i, j, n)) { board[i][j] = true; bool nextpossible = placequeen(board, i + 1, n); if (nextpossible) { return true; } board[i][j] = false; } } return false; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<vector<int>>board(n, vector<int>(n, false)); placequeen(board, 0, n); if (!solution) { cout << "Not possible" << endl; } return 0; } /* Using Backtracking Vecdict : Accepted Geeks for Geeks solution */ #include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; bool solution = false; bool noattack(vector<vector<int>>&board, int i, int j, int n) { for (int row = 0; row < i; row++) { if (board[row][j]) { return false; } } int row = i; int col = j; while (row >= 0 && col >= 0) { if (board[row][col]) { return false; } row--; col--; } row = i; col = j; while (row >= 0 && col < n) { if (board[row][col]) { return false; } row--; col++; } return true; } bool placequeen(vector<vector<int>>&board, vector<vector<int>>&queenpos, int i, int n) { if (i == n) { vector<int>pos; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (board[i][j]) { pos.push_back(j + 1); }; } } queenpos.push_back(pos); return false; } for (int j = 0; j < n; j++) { if (noattack(board, i, j, n)) { board[i][j] = true; bool nextpossible = placequeen(board, queenpos, i + 1, n); if (nextpossible) { return true; } board[i][j] = false; } } return false; } int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<vector<int>>board(n, vector<int>(n, false)); vector<vector<int>>queenpos; placequeen(board, queenpos, 0, n); sort(queenpos.begin(), queenpos.end()); if (queenpos.size() == 0) { cout << "-1"; } else { for (int i = 0; i < queenpos.size(); i++) { cout << "["; for (int j = 0; j < queenpos[i].size(); j++) { cout << queenpos[i][j] << " "; } cout << "] "; } } cout << "\n"; } return 0; }
[ "sandeep1137@gmail.com" ]
sandeep1137@gmail.com
28148c6c0aa8997d204b2575c781bafbdae78df2
88a49a4e9db1559230557ea21fd491528a355f36
/GTree.h
d0fde6a99be82ffd048f50438dfbe84de5f71215
[]
no_license
hliluuqiuqiu/data-structure
d30bd13f1c7d84e3e1cbf620b7924948755654ca
960885973098fd6956a819d4e58851787b09f64c
refs/heads/master
2020-03-17T00:18:20.655127
2018-11-16T08:49:41
2018-11-16T08:49:41
133,111,364
2
0
null
null
null
null
UTF-8
C++
false
false
8,118
h
#ifndef GTREE_H #define GTREE_H #include <iostream> #include "LinkQueue.h" #include "Exception.h" #include "GTreeNode.h" #include "Tree.h" namespace SQHLib{ template <typename T> class GTree : public Tree<T>{ private: //GTreeNode<T>* node; protected: LinkQueue<GTreeNode<T>*> queue; void free(GTreeNode<T> * node){ if(node == NULL){ return; }else{ for(node->chid.move(0); !node->chid.end() ;node->chid.next()){ free(node->chid.current()); } if(node->inHeap){ delete node; }else{ cout<<"stack mem:"<<node->value<<endl; } node = NULL; } } int height(GTreeNode<T> * node){ if(node == NULL){ return 0; }else{ int h = 0,tempH = 0; for(node->chid.move(0);!node->chid.end();node->chid.next()){ tempH = height(node->chid.current()); if(tempH > h){ h = tempH; } } return h + 1; } } int count(GTreeNode<T> * node){ int ret = 0; if(node == NULL){ return ret; }else{ for(node->chid.move(0);!node->chid.end();node->chid.next()){ ret += count(node->chid.current()); } } return ret + 1; } int degree(GTreeNode<T> * node){ int ret = 0,temp = 0; if(node == NULL){ return ret; }else{ for(node->chid.move(0);!node->chid.end();node->chid.next()){ temp = degree(node->chid.current()); if(temp > ret){ ret = temp; } } } // cout<<"leng("<<node->value<<")"<<":"<<node->chid.length()<<endl; if(node->chid.length() > ret){ ret = node->chid.length(); } return ret; } public: GTreeNode<T>* createNode(){ return GTreeNode<T>::NewNode(); } bool insert(TreeNode<T>* node,TreeNode<T>* parrent){ bool ret = false; if(node == NULL){ return ret; } if(isEmpty()){ this->m_root = node; ret = true; }else{ if(parrent == NULL){ parrent = this->m_root; } GTreeNode<T>* p= find(parrent); if(p){ if(p->chid.find((GTreeNode<T>*)node) < 0){ p->chid.insert((GTreeNode<T>*)node) ; node->parrent = p; } ret = true; } } return ret; } bool insert(const T& value,TreeNode<T>* parrent) { bool ret = false; GTreeNode<T>* node = createNode(); if(node == NULL){ return ret; } node->value = value; if(isEmpty()){ this->m_root = node; ret = true; }else{ if(parrent ==NULL){ ((GTreeNode<T>*) (this->m_root))->chid.insert(node); node->parrent = this->m_root; ret = true; }else{ GTreeNode<T>* p= find(parrent); if(p){ p->chid.insert(node) ; node->parrent =p; ret = true; }else{ cout<<"not found parrent"<<endl; } } } return ret; } SmartPointer< Tree<T> > remove(const T& value) { GTreeNode<T>* node = find(value); if(node == NULL){ THROW_EXCEPTION("para error",InvalidParameterException); }else{ // TreeNode<T>* retNode = node; if(node == this->m_root){ this->m_root = NULL; }else{ GTreeNode<T>* p =dynamic_cast< GTreeNode<T>*>(node->parrent); p->chid.remove(p->chid.find(node)); } } GTree<T>* ret = new GTree<T>(); ret->m_root = NULL; return ret; } SmartPointer< Tree<T> > remove(TreeNode<T>* node1){ GTreeNode<T>* node = find(node1); if(node == NULL){ THROW_EXCEPTION("para error",InvalidParameterException); }else{ // TreeNode<T>* retNode = node; if(node == this->m_root){ this->m_root = NULL; }else{ GTreeNode<T>* p =dynamic_cast< GTreeNode<T>*>(node->parrent); p->chid.remove(p->chid.find(node)); } } GTree<T>* ret = new GTree<T>(); ret->m_root = NULL; return ret; } GTreeNode<T>* find(const T& value){ GTreeNode<T>* ret = NULL; GTreeNode<T>* node = root(); if(node ){ ret = find(value,node); } return ret; } GTreeNode<T>* find(const T& value,GTreeNode<T>* parrent){ GTreeNode<T>* ret = NULL; if(parrent == NULL ){ return NULL; } if(parrent->value == value){ return parrent; }else{ if(parrent->chid.length() > 0){ for(parrent->chid.move(0);!parrent->chid.end();parrent->chid.next()){ ret = find(value,parrent->chid.current()); if(ret){ break; } } } } return ret; } GTreeNode<T>* find(TreeNode<T>* node){ return find(node,root()); } GTreeNode<T>* find(const TreeNode<T>* node,GTreeNode<T>* parrent){ GTreeNode<T>* ret = NULL; if(parrent == NULL ){ return NULL; } if(parrent == node){ return parrent; }else{ if(parrent->chid.length() > 0){ for(parrent->chid.move(0);!parrent->chid.end();parrent->chid.next()){ ret = find(node,parrent->chid.current()); if(ret){ break; } } } } return ret; } GTreeNode<T>* root(){ return dynamic_cast< GTreeNode<T>*>(this->m_root); } int degree(){ return degree(root()); } int count(){ return count(root()); } int height(){ return height(root()) ; } int clear(){ free(root()); this->m_root = NULL; return 0; } bool isEmpty(){ return this->m_root == NULL; } void print(){ if(!isEmpty()){ GTreeNode<T>* r = ( GTreeNode<T>*)root(); //cout<<r->value; printSubTree(r); } } void printSubTree( GTreeNode<T>* node){ if(node->chid.length() == 0){ this->printEdge(node); }else{ for(node->chid.move(0);!node->chid.end();node->chid.next()){ printSubTree(node->chid.current()); } } } /* void printEdge(TreeNode<T>* leaf){ TreeNode<T>* parrent = leaf; while(parrent){ cout << parrent->value; parrent = parrent->parrent; } cout<<endl; }*/ void begin(){ queue.clear(); if(this->m_root){ queue.add(root()); } } bool end(){ return (queue.length() == 0); } void next(){ if(queue.length() > 0){ GTreeNode<T>* n = NULL; queue.front(n); queue.remove(); for(n->chid.move(0);!n->chid.end();n->chid.next()){ queue.add(n->chid.current()); } } } GTreeNode<T>* current(){ GTreeNode<T>* ret = NULL; queue.front(ret); return ret; } virtual ~GTree() { clear(); } }; } #endif // GTREE_H
[ "sh282404472@aliyun.com" ]
sh282404472@aliyun.com
2a430f54dbec72b1e4af8a14873ae5153bcbbeb5
34f1d5efff40e88b1ea7ad2d1ae336cdad1d2d93
/cpp/cpp-exercises-A/question-4.cpp
01a353cf02f7cf33333bd57ec8e9dfb0eb89143a
[]
no_license
jacques-twizeyimana/codes
228e8e3dd5cf135a294cf72553fabb9f69d8de55
d47a4294d2e0d711b02bd631dae0c7e0ee34c6f3
refs/heads/main
2023-06-09T21:31:08.818584
2021-06-30T18:00:28
2021-06-30T18:00:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
453
cpp
#include<iostream> using namespace std; double num1,num2; void swapNumbers(){ double temp = num1; num1 = num2; num2 = temp; } int main(int argc, char const *argv[]) { cout << "Enter first number:\t"; cin>>num1; cout<<"Enter second number:\t"; cin >> num2; swapNumbers(); cout << "After Swapping the 1st number is : " << num1 << endl; cout << "After Swapping the 2nd number is : " << num2 << endl; return 0; }
[ "=" ]
=
ecaa2fce168847bd786b471d6802c5f48ceac19e
4873e1497dc43da9faeb611c6e6fa4b85a5954af
/sources/include/mpxx/mpxx/file.hpp
cfd113c2ff4bf6988b78e1e52ee1f701fc65d36f
[ "MIT" ]
permissive
ddway2/mpxx
d080867057483f43725eb4ee3f26c146b37db898
121ff9347a01f39d74a4fd2bd20d134ea5005da6
refs/heads/master
2022-07-18T02:15:24.828900
2020-05-19T07:39:40
2020-05-19T07:39:40
256,783,925
0
0
MIT
2020-04-18T15:12:52
2020-04-18T15:12:51
null
UTF-8
C++
false
false
2,661
hpp
#ifndef __MPXX_FILE_H__ #define __MPXX_FILE_H__ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <stdio.h> #include <ios> #include <string> #include <fstream> #include <stdexcept> #include <mpxx/msgpack.hpp> namespace mpxx { template <typename T> class file { public: bool load(T& v, const std::string& path) const { struct stat st; if (!exists(path, st)) { return false; } std::size_t sz = st.st_size; msgpack::sbuffer sbuf(sz); slurp(path, sbuf.data(), sz); msgpack::unpacked u; msgpack::unpack(&u, sbuf.data(), sz); msgpack::object obj = u.get(); obj.convert(&v); return true; } void save(const T& v, const std::string& path) const { msgpack::sbuffer sbuf; msgpack::pack(sbuf, v); expel(path, sbuf.data(), sbuf.size()); } private: bool exists(const std::string& path, struct stat& st) const { bool ret = false; if (stat(path.c_str(), &st) == 0) { ret = S_ISREG(st.st_mode); } return ret; } void slurp( const std::string& path, char* buffer, std::size_t size ) const { std::ifstream ifs(path, std::ios::binary); if (!ifs.is_open()) { throw std::runtime_error( "failed to open " + path ); } ifs.read(buffer, size); ifs.close(); } void expel( const std::string& path, const char* buffer, std::size_t size ) const { struct stat st; auto old = path + ".old"; bool here = exists(path, st); if (here) { if (rename(path.c_str(), old.c_str()) != 0) { throw std::runtime_error( "failed to rename " + path + " to " + old ); } } std::ofstream ofs(path, std::ios::binary | std::ios::trunc); try { if (!ofs.is_open()) { throw std::runtime_error( "failed to open " + path ); } ofs.write(buffer, size); ofs.close(); } catch (...) { unlink(path.c_str()); if (here) { if (rename(old.c_str(), path.c_str()) != 0) { throw std::runtime_error( "WHOAA: failed to roolback " + old + " to " + path ); } } throw; } } }; } // namespace mpxx #endif // __MPXX_FILE_H__
[ "remy.chibois@expandium.com" ]
remy.chibois@expandium.com
0251d63d4ddede45b0193b08ed16440eed1dca85
3d457daa38eba26fb202386da23cfa90519b35a8
/gen.cpp
9ac9538817529a32d43472cdef87d63f83e62ae1
[]
no_license
V0rt-x/load_destribution
f00f7c28bdbb90355159e89f206137bba19e1610
b13114ef0160650cc6a16555c1dfe91ccd4fd25d
refs/heads/master
2020-05-16T14:32:32.821374
2019-04-23T22:57:21
2019-04-23T22:57:21
183,106,944
0
0
null
null
null
null
UTF-8
C++
false
false
6,363
cpp
#include <iostream> #include <fstream> #include <cstdlib> #include <vector> #include <ctime> using namespace std; void input_data(int &, int[3], int[4], int &, int[4]); void read_from_file(int &, int[3], int[4], int &, int[4]); void read_from_cin(int &, int[3], int[4], int &, int[4]); int generator(int, int[3] , int[4], int, int[4]); int select_by_prob(int *, int, bool *restr = 0); ofstream fout("gen_output.txt", ios_base::out); int main(){ const int number_of_generations = 10; int num_of_proc, task_probabilities[3], processor_probabilities[4], Q, intensity_probabilities[4]; input_data(num_of_proc, task_probabilities, processor_probabilities, Q, intensity_probabilities); for(int i=0; i < number_of_generations; ++i) generator(num_of_proc, task_probabilities, processor_probabilities, Q, intensity_probabilities); fout.close(); return 0; } void input_data(int &num_of_proc, int prob_task[3] , int prob_proc[4], int &Q, int prob_intensity[4]){ int respond; cout << "Do you want to read from 'gen_input.txt'? (1 - yes/ 0 - no)" << endl; cin >> respond; switch(respond){ case 1: read_from_file(num_of_proc, prob_task, prob_proc, Q, prob_intensity); break; case 0: read_from_cin(num_of_proc, prob_task, prob_proc, Q, prob_intensity); } } void read_from_cin(int &num_of_proc, int prob_task[3] , int prob_proc[4], int &Q, int prob_intensity[4]){ cout << "Number of CPUs:" << endl; cin >> num_of_proc; cout << "Probabilities of matching CPU loads with tasks (3):" << endl; for(int i = 0; i < 3; ++i) cin >> prob_task[i]; cout << "Probabilities of matching CPUs with their limits (4):" << endl; for(int i = 0; i < 4; ++i) cin >> prob_proc[i]; cout << "Percentage of total performance resouce:" << endl; cin >> Q; cout << "Probabilities of matching exchanges between tasks intensities with pairs of tasks (4):" << endl; for(int i = 0; i < 4; ++i) cin >> prob_intensity[i]; } void read_from_file(int &num_of_proc, int prob_task[3] , int prob_proc[4], int &Q, int prob_intensity[4]){ ifstream fin("gen_input.txt", ios_base::in); fin >> num_of_proc; for(int i = 0; i < 3; ++i) fin >> prob_task[i]; for(int i = 0; i < 4; ++i) fin >> prob_proc[i]; fin >> Q; for(int i = 0; i < 4; ++i) fin >> prob_intensity[i]; } int generator(int num_of_proc, int prob_task[3] , int prob_proc[4], int Q, int prob_intensity[4]){ int ctrl1 = 0, ctrl2 = 0; for(int i=0; i<3; ++i){ if(prob_task[i] < 0) return -1; ctrl1 += prob_task[i]; } if(ctrl1 != 100) return -1; ctrl1 = 0; for(int i=0; i < 4; ++i){ if((prob_proc[i] < 0) || (prob_intensity[i] < 0)) return -1; ctrl1 += prob_proc[i]; ctrl2 += prob_intensity[i]; } if((ctrl1 != 100) || (ctrl2 != 100)) return -1; int probable_proc_limits[4] = {40, 60, 80, 100}; int probable_task_loads[3] = {5, 10, 20}; int probable_exchange_intensities[4] = {0, 10, 50, 100}; int proc_limits[num_of_proc], resource=0; for(int i=0; i < num_of_proc; ++i){ proc_limits[i] = probable_proc_limits[select_by_prob(prob_proc, 4)]; //p.1 resource += proc_limits[i]; //p.2 } resource = float(resource) * float(Q) / 100; //p.3 bool restrictions[3] = {false, false, false}; //false - possible to create the task; true - impossible vector<int> task_loads; int new_task_load, new_task_index; while(!restrictions[0] || !restrictions[1] || !restrictions[2]){ //p.6 new_task_index = select_by_prob(prob_task, 3, restrictions); new_task_load = probable_task_loads[new_task_index]; if(resource - new_task_load < 0) restrictions[new_task_index] = true; //p.5 (restrict overloading tasks) else{ task_loads.push_back(new_task_load); //p.4 resource -= new_task_load; //(p.7) recalculation of free resource } } int tasks_count = task_loads.size(); int intensities[tasks_count][tasks_count], new_intensity_index; for(int i = 0; i < tasks_count; ++i) for(int j = i; j < tasks_count; ++j){ if(i != j){ new_intensity_index = select_by_prob(prob_intensity, 4); intensities[j][i] = intensities[i][j] = probable_exchange_intensities[new_intensity_index]; } else intensities[i][j] = 0; } for(int i=0; i < num_of_proc; ++i) fout << proc_limits[i] << " "; fout << endl; for(int i=0; i < tasks_count; ++i) fout << task_loads[i] << " "; fout << endl; for(int i=0; i < tasks_count; ++i){ for(int j=0; j < tasks_count; ++j) fout << intensities[i][j] << " "; fout << endl; } return 0; } int select_by_prob(int *probs, int k, bool *restr){ //returns index of selected item bool default_restr = false; if(restr == 0){ restr = (bool *)malloc(size_t(k)); for(int i=0; i < k; ++i) restr[i] = false; default_restr = true; } if(k < 1) return -1; int check_sum = 0; for(int i=0; i < k; ++i){ check_sum += int(!restr[i]); } if(check_sum == 0) return -2; //if all loads are restricted static bool srand_flag = false; if(!srand_flag){ srand(time(NULL)); srand_flag = true; } int result; do{ int r = rand() % 100 + 1; int sum = 0; for(int i=0; i < k; ++i){ sum += probs[i]; if(r <= sum){ result = i; break; } } } while(restr[result]); if(default_restr) free(restr); return result; }
[ "noreply@github.com" ]
noreply@github.com
c2b8568ea476f957d327d2e041ef533275e81bdf
af3d30c34f39ebaab465c2a8e56e1d2e873c37ec
/Figure.cpp
a0fe87f46b3a5f4004648da20114bdf78ac6ef26
[]
no_license
C-Coretex/Allegro-Game
bf62f82c2b6a6dd69907d89c3548e7e527a71b30
d699dd0a35276a6fb773de1ba5a7ec349cb129b3
refs/heads/master
2022-11-09T18:59:18.809544
2020-06-13T09:23:49
2020-06-13T09:23:49
271,385,049
0
0
null
null
null
null
UTF-8
C++
false
false
834
cpp
#include "Figure.h" #include <stdlib.h> #include <cmath> Figure::Figure(int SCREEN_W_, int SCREEN_H_): SCREEN_W(SCREEN_W_), SCREEN_H(SCREEN_H_) { Reset(); } Figure::~Figure(){}; void Figure::Reset() { x_ = rand() % SCREEN_W; y_ = rand() % SCREEN_H; dx_ = 10.0 - rand() % 21; dy_ = 10.0 - rand() % 21; } void Figure::Move() { x_ += dx_; y_ += dy_; if ( ( x_ - safeSpace < 1.0 ) || ( x_ + safeSpace > SCREEN_W ) ) dx_ *= -1; if( (y_ + safeSpace < 1.0 ) || ( y_ - safeSpace > SCREEN_H ) ) dy_ *= -1; } bool Figure::operator== (const Figure &other) const { double dx = (other.x_ - x_)*(other.x_ - x_); double dy = (other.y_ - y_)*(other.y_ - y_); if((sqrt(dx+dy) - (other.safeSpace + safeSpace) <= 0.001)) return true; else return false; }
[ "valerash2@gmail.com" ]
valerash2@gmail.com
b8ad496634a7f9a29d23cd66d7d2abba9e913363
5832f65747e6142d1b8de9d46aa507092782aafc
/Codeforces/275028/a/a.cpp
af5ba7af271c140e1610dd8d6ec6820f4d079537
[]
no_license
subhashreddykallam/Competitive-Programming
64cc42c5b23c03536187a1bb54e2b2ed82ee7844
973b66b4eb81352b98409ca52fa3aa75c28d8b6f
refs/heads/master
2022-05-28T21:07:43.012922
2020-05-05T20:34:20
2020-05-05T20:34:20
226,814,369
0
0
null
null
null
null
UTF-8
C++
false
false
1,246
cpp
# include<bits/stdc++.h> # include<unordered_map> # include<unordered_set> using namespace std; # define ll long long // # define ll int # define vll vector<ll> # define vvll vector<vector<ll> > # define vchar vector<char> # define vstr vector<string> # define vpll vector<pair<ll, ll> > # define mll map<ll, ll> # define sll set<ll> # define usll unordered_set<ll> # define schar set<char> # define pll pair<ll, ll> # define append_left push_front # define append push_back # define pop_left pop_front # define popb pop_back # define add insert # define all(v) v.begin(), v.end() # define rall(v) v.rbegin(), v.rend() # define loop(i, k, n, inc) for(ll i = k; i < n; i+=inc) # define rloop(i, k, n, inc) for(ll i = k; i > n; i+=inc) vll vin(ll n){vll a(n);loop(i, 0, n, 1) cin>>a[i];return a;} ll intin() {ll n; cin>>n; return n;} char charin(){char a; cin>>a; return a;} string strin(){string s; cin>>s; return s;} ll factorial(ll n){return (n==1 || n==0) ? 1: n * factorial(n - 1);} int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); ll n; cin>>n; ll ans = 0; ans+=n/100; n%=100; ans+=n/20; n%=20; ans+=n/10; n%=10; ans+=n/5; n%=5; ans+=n; cout<<ans<<endl; return 0; }
[ "42376739+Storm1seven@users.noreply.github.com" ]
42376739+Storm1seven@users.noreply.github.com
f8b7c889f5b294a7bdcb861c23a55c9548ed4dfd
cc82523c038530a07c4544663c0b9a5e423ead9c
/Source/Hodunk/HodunkGameMode.cpp
c44f356598aa73bdad786c4ec71c53447faf981c
[]
no_license
aaulbrich/Hodunk
61244769fc4be56e88b095c07e0c80bb58ccc848
4ef26565dbec0367929d41532de898113760e981
refs/heads/master
2020-04-01T07:51:49.582464
2018-10-14T19:13:15
2018-10-14T19:13:15
153,007,236
0
0
null
null
null
null
UTF-8
C++
false
false
540
cpp
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. #include "HodunkGameMode.h" #include "HodunkHUD.h" #include "HodunkCharacter.h" #include "UObject/ConstructorHelpers.h" AHodunkGameMode::AHodunkGameMode() : Super() { // set default pawn class to our Blueprinted character static ConstructorHelpers::FClassFinder<APawn> PlayerPawnClassFinder(TEXT("/Game/FirstPersonCPP/Blueprints/FirstPersonCharacter")); DefaultPawnClass = PlayerPawnClassFinder.Class; // use our custom HUD class HUDClass = AHodunkHUD::StaticClass(); }
[ "andrew@ulbrichtech.com" ]
andrew@ulbrichtech.com
f27235c2685f75ca45394b72b22d3cb0ef38cfa3
3dac5bf6cd3e61cf1da16ead31de0f88cad08118
/Teste_trabalho_CG_grauB/Target.h
d0e3a19d1498d7b3313fc1d32ec208bb6ddb8bb2
[]
no_license
zDontTouch/Trabalho_CG_3D
66997b2a8636daf6c4413aea4dfd9164bf2b74ff
b6732b286f8b6009d0a3a592b4dd3859ea434ef2
refs/heads/master
2021-01-20T08:53:14.501679
2017-06-11T05:53:26
2017-06-11T05:53:26
90,192,722
0
0
null
null
null
null
UTF-8
C++
false
false
335
h
#pragma once #include "Model_object.h" #include "Globals.h" using namespace std; class Target : public Model_object { public: int LOCAL_TARGET_PITCH_INACTIVE = 89; int LOCAL_TARGET_PITCH_ACTIVE = 0; bool is_active; bool is_dead; Target() { if (this->pitch == LOCAL_TARGET_PITCH_ACTIVE) { is_active = true; } } };
[ "leonardofelini9857@gmail.com" ]
leonardofelini9857@gmail.com
929cdce7db2b7744a6a154c9832369d5909ffa91
82a02c98a78c2a165a0823674c9e6643ca0ccdc9
/master/main.cpp
82d41e622146cf94ec8ba9369bec9c8b888ecafb
[]
no_license
ghozifr/GudangGaram
a457fe45bbb5f46d6f133bd23112544f852bd434
3b7c97b77be557eb8cacbedb953c0334c065fb1e
refs/heads/master
2023-06-01T15:51:11.183170
2021-06-20T13:18:46
2021-06-20T13:18:46
378,637,497
0
0
null
null
null
null
UTF-8
C++
false
false
3,795
cpp
#include <iostream> #include <fstream> #include <string> #include <limits> using namespace std; struct Passengers{ int num; string age; string name; string country; string phone; }; int getOption(); void checkDatabase(fstream &inFile); void writeData(fstream &inFile, int location, Passengers &inputPassengers){ inFile.seekp((location - 1)*sizeof(inputPassengers), ios::beg); //find data inFile.write(reinterpret_cast<char*>(&inputPassengers),sizeof(Passengers)); } int getDataSize(fstream &inFile){ int start, end; inFile.seekg(0,ios::beg); start = inFile.tellg(); inFile.seekg(0,ios::end); end = inFile.tellg(); return (end-start)/sizeof(Passengers); //calculate the data } Passengers readData(fstream &inFile, int location){ Passengers readPassengers; inFile.seekg((location - 1)*sizeof(Passengers),ios::beg); inFile.read(reinterpret_cast<char*>(&readPassengers),sizeof(Passengers)); return readPassengers; } void addDataPassengers(fstream &inFile){ Passengers inputPassengers, lastPassengers; int size = getDataSize(inFile); cout<<"size of data: "<<size<<endl; if(size == 0){ inputPassengers.num = 1; } else { lastPassengers = readData(inFile,size); cout<<"num= "<<lastPassengers.num<<endl; inputPassengers.num = lastPassengers.num + 1; } cout<<"Age: "; getline(cin,inputPassengers.age); cout<<"Full Name: "; getline(cin,inputPassengers.name); cout<<"Country: "; getline(cin,inputPassengers.country); cout<<"Phone Number: "; getline(cin,inputPassengers.phone); writeData(inFile,size+1,inputPassengers); } void displayDataPassengers(fstream &inFile){ int size = getDataSize(inFile); Passengers showPassengers; cout << "no.\tnum.\tage.\tname.\tcountry.\tphone." << endl; for(int i = 1; i <= size; i++){ showPassengers = readData(inFile,i); cout << i << "\t"; cout << showPassengers.num << "\t"; cout << showPassengers.age << "\t"; cout << showPassengers.name << "\t"; cout << showPassengers.country << "\t"; cout << showPassengers.phone << endl; } } int main(){ fstream inFile; checkDatabase(inFile); int userOption = getOption(); char is_continue; while(userOption != 6){ switch(userOption){ case 1: cout<<"Register"<<endl; addDataPassengers(inFile); break; case 2: cout<<"Display"<<endl; displayDataPassengers(inFile); break; case 3: cout<<"Edit"<<endl; break; case 4: cout<<"Delete"<<endl; break; case 5: cout<<"Search"<<endl; break; default: cout<<"Exit"<<endl; break; } label_continue: cout<<"Countinue?(y/n) : "; cin>> is_continue; if(is_continue == 'y' | (is_continue == 'Y')){ userOption = getOption(); } else if(is_continue == 'n' | (is_continue == 'N')){ break; } else{ goto label_continue; } } cout<<"Done."<<endl; cin.get(); return 0; } int getOption(){ int input; system("cls"); //to clear the screen cout<<"\nWelcome passengers arriving in Malaysia."<<endl; cout<<"========================================="<<endl; cout<<"1. Register"<<endl; cout<<"2. Display"<<endl; cout<<"3. Edit"<<endl; cout<<"4. Delete"<<endl; cout<<"5. Search"<<endl; cout<<"6. Exit"<<endl; cout<<"=========================================="<<endl; cout<<"Choose 1-6? : "; cin>>input; cin.ignore(numeric_limits<streamsize>::max(),'\n'); //for make new line on cin return input; } void checkDatabase(fstream &inFile){ inFile.open("data.txt", ios::out | ios::in | ios::binary); //find the file //check file if (inFile.is_open()){ cout<<"database exist."<<endl; } else { cout<<"database not found, new database created."<<endl; inFile.close(); inFile.open("data.txt", ios::trunc | ios::out | ios::in | ios::binary); //ios::trunc create new file } }
[ "ghozifr@gmail.com" ]
ghozifr@gmail.com
a4bb7c1a140f79b4ef41689ac215053e0c7a8264
b5c2fb15351ed443c058cb83b80ed6767eb13ab2
/src/wallet.h
572ecce88975f181ed66a01233e711b9ddbbb9a5
[ "MIT" ]
permissive
ctgiant/XNA
e183ab6d138f484e91e01741577473dad6d1399e
b6e1afb14ef83617cb2be62bfae9fc470b980b4f
refs/heads/master
2020-12-02T16:39:57.130683
2015-05-06T23:25:24
2015-05-06T23:25:24
35,175,963
0
0
null
2015-05-06T18:30:21
2015-05-06T18:30:21
null
UTF-8
C++
false
false
25,670
h
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef XNA_WALLET_H #define XNA_WALLET_H #include <string> #include <vector> #include <stdlib.h> #include "main.h" #include "key.h" #include "keystore.h" #include "script.h" #include "ui_interface.h" #include "util.h" #include "walletdb.h" extern bool fWalletUnlockMintOnly; class CAccountingEntry; class CWalletTx; class CReserveKey; class COutput; class CCoinControl; /** (client) version numbers for particular wallet features */ enum WalletFeature { FEATURE_BASE = 10500, // the earliest version new wallets supports (only useful for getinfo's clientversion output) FEATURE_WALLETCRYPT = 40000, // wallet encryption FEATURE_COMPRPUBKEY = 60000, // compressed public keys FEATURE_LATEST = 60000 }; /** A key pool entry */ class CKeyPool { public: int64 nTime; CPubKey vchPubKey; CKeyPool() { nTime = GetTime(); } CKeyPool(const CPubKey& vchPubKeyIn) { nTime = GetTime(); vchPubKey = vchPubKeyIn; } IMPLEMENT_SERIALIZE ( if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(nTime); READWRITE(vchPubKey); ) }; /** A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, * and provides the ability to create new transactions. */ class CWallet : public CCryptoKeyStore { private: bool SelectCoins(int64 nTargetValue, unsigned int nSpendTime, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet, const CCoinControl *coinControl=NULL) const; CWalletDB *pwalletdbEncryption; // the current wallet version: clients below this version are not able to load the wallet int nWalletVersion; // the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded int nWalletMaxVersion; public: mutable CCriticalSection cs_wallet; bool fFileBacked; std::string strWalletFile; std::set<int64> setKeyPool; typedef std::map<unsigned int, CMasterKey> MasterKeyMap; MasterKeyMap mapMasterKeys; unsigned int nMasterKeyMaxID; CWallet() { nWalletVersion = FEATURE_BASE; nWalletMaxVersion = FEATURE_BASE; fFileBacked = false; nMasterKeyMaxID = 0; pwalletdbEncryption = NULL; nOrderPosNext = 0; } CWallet(std::string strWalletFileIn) { nWalletVersion = FEATURE_BASE; nWalletMaxVersion = FEATURE_BASE; strWalletFile = strWalletFileIn; fFileBacked = true; nMasterKeyMaxID = 0; pwalletdbEncryption = NULL; nOrderPosNext = 0; } std::map<uint256, CWalletTx> mapWallet; int64 nOrderPosNext; std::map<uint256, int> mapRequestCount; std::map<CTxDestination, std::string> mapAddressBook; CPubKey vchDefaultKey; // check whether we are allowed to upgrade (or already support) to the named feature bool CanSupportFeature(enum WalletFeature wf) { return nWalletMaxVersion >= wf; } void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl=NULL) const; bool SelectCoinsMinConf(int64 nTargetValue, unsigned int nSpendTime, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const; // keystore implementation // Generate a new key CPubKey GenerateNewKey(); // Adds a key to the store, and saves it to disk. bool AddKey(const CKey& key); // Adds a key to the store, without saving it to disk (used by LoadWallet) bool LoadKey(const CKey& key) { return CCryptoKeyStore::AddKey(key); } bool LoadMinVersion(int nVersion) { nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; } // Adds an encrypted key to the store, and saves it to disk. bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret); // Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) { SetMinVersion(FEATURE_WALLETCRYPT); return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); } bool AddCScript(const CScript& redeemScript); bool LoadCScript(const CScript& redeemScript) { return CCryptoKeyStore::AddCScript(redeemScript); } bool Unlock(const SecureString& strWalletPassphrase); bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase); bool EncryptWallet(const SecureString& strWalletPassphrase); /** Increment the next transaction order id @return next transaction order id */ int64 IncOrderPosNext(CWalletDB *pwalletdb = NULL); typedef std::pair<CWalletTx*, CAccountingEntry*> TxPair; typedef std::multimap<int64, TxPair > TxItems; /** Get the wallet's activity log @return multimap of ordered transactions and accounting entries @warning Returned pointers are *only* valid within the scope of passed acentries */ TxItems OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount = ""); void MarkDirty(); bool AddToWallet(const CWalletTx& wtxIn); bool AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate = false, bool fFindBlock = false); bool EraseFromWallet(uint256 hash); void WalletUpdateSpent(const CTransaction& prevout); int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false); int ScanForWalletTransaction(const uint256& hashTx); void ReacceptWalletTransactions(); void ResendWalletTransactions(); int64 GetBalance() const; int64 GetUnconfirmedBalance() const; int64 GetImmatureBalance() const; int64 GetStake() const; int64 GetNewMint() const; bool CreateTransaction(const std::vector<std::pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet, const CCoinControl *coinControl=NULL); bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet, const CCoinControl *coinControl=NULL); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); bool GetStakeWeight(const CKeyStore& keystore, uint64& nMinWeight, uint64& nMaxWeight, uint64& nWeight); bool CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int64 nSearchInterval, CTransaction& txNew); std::string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false); std::string SendMoneyToDestination(const CTxDestination &address, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false); bool NewKeyPool(); bool TopUpKeyPool(); int64 AddReserveKey(const CKeyPool& keypool); void ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool); void KeepKey(int64 nIndex); void ReturnKey(int64 nIndex); bool GetKeyFromPool(CPubKey &key, bool fAllowReuse=true); int64 GetOldestKeyPoolTime(); void GetAllReserveKeys(std::set<CKeyID>& setAddress); std::set< std::set<CTxDestination> > GetAddressGroupings(); std::map<CTxDestination, int64> GetAddressBalances(); bool IsMine(const CTxIn& txin) const; int64 GetDebit(const CTxIn& txin) const; bool IsMine(const CTxOut& txout) const { return ::IsMine(*this, txout.scriptPubKey); } int64 GetCredit(const CTxOut& txout) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); return (IsMine(txout) ? txout.nValue : 0); } bool IsChange(const CTxOut& txout) const; int64 GetChange(const CTxOut& txout) const { if (!MoneyRange(txout.nValue)) throw std::runtime_error("CWallet::GetChange() : value out of range"); return (IsChange(txout) ? txout.nValue : 0); } bool IsMine(const CTransaction& tx) const { BOOST_FOREACH(const CTxOut& txout, tx.vout) if (IsMine(txout)) return true; return false; } bool IsFromMe(const CTransaction& tx) const { return (GetDebit(tx) > 0); } int64 GetDebit(const CTransaction& tx) const { int64 nDebit = 0; BOOST_FOREACH(const CTxIn& txin, tx.vin) { nDebit += GetDebit(txin); if (!MoneyRange(nDebit)) throw std::runtime_error("CWallet::GetDebit() : value out of range"); } return nDebit; } int64 GetCredit(const CTransaction& tx) const { int64 nCredit = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) { nCredit += GetCredit(txout); if (!MoneyRange(nCredit)) throw std::runtime_error("CWallet::GetCredit() : value out of range"); } return nCredit; } int64 GetChange(const CTransaction& tx) const { int64 nChange = 0; BOOST_FOREACH(const CTxOut& txout, tx.vout) { nChange += GetChange(txout); if (!MoneyRange(nChange)) throw std::runtime_error("CWallet::GetChange() : value out of range"); } return nChange; } void SetBestChain(const CBlockLocator& loc); DBErrors LoadWallet(bool& fFirstRunRet); bool SetAddressBookName(const CTxDestination& address, const std::string& strName); bool DelAddressBookName(const CTxDestination& address); void UpdatedTransaction(const uint256 &hashTx); void PrintWallet(const CBlock& block); void Inventory(const uint256 &hash) { { LOCK(cs_wallet); std::map<uint256, int>::iterator mi = mapRequestCount.find(hash); if (mi != mapRequestCount.end()) (*mi).second++; } } int GetKeyPoolSize() { return setKeyPool.size(); } bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx); bool SetDefaultKey(const CPubKey &vchPubKey); // signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower bool SetMinVersion(enum WalletFeature, CWalletDB* pwalletdbIn = NULL, bool fExplicit = false); // change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format) bool SetMaxVersion(int nVersion); // get the current wallet format (the oldest client version guaranteed to understand this wallet) int GetVersion() { return nWalletVersion; } void FixSpentCoins(int& nMismatchSpent, int64& nBalanceInQuestion, bool fCheckOnly = false); void DisableTransaction(const CTransaction &tx); /** Address book entry changed. * @note called with lock cs_wallet held. */ boost::signals2::signal<void (CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, ChangeType status)> NotifyAddressBookChanged; /** Wallet transaction added, removed or updated. * @note called with lock cs_wallet held. */ boost::signals2::signal<void (CWallet *wallet, const uint256 &hashTx, ChangeType status)> NotifyTransactionChanged; }; /** A key allocated from the key pool. */ class CReserveKey { protected: CWallet* pwallet; int64 nIndex; CPubKey vchPubKey; public: CReserveKey(CWallet* pwalletIn) { nIndex = -1; pwallet = pwalletIn; } ~CReserveKey() { if (!fShutdown) ReturnKey(); } void ReturnKey(); CPubKey GetReservedKey(); void KeepKey(); }; typedef std::map<std::string, std::string> mapValue_t; static void ReadOrderPos(int64& nOrderPos, mapValue_t& mapValue) { if (!mapValue.count("n")) { nOrderPos = -1; // TODO: calculate elsewhere return; } nOrderPos = atoi64(mapValue["n"].c_str()); } static void WriteOrderPos(const int64& nOrderPos, mapValue_t& mapValue) { if (nOrderPos == -1) return; mapValue["n"] = i64tostr(nOrderPos); } /** A transaction with a bunch of additional info that only the owner cares about. * It includes any unrecorded transactions needed to link it back to the block chain. */ class CWalletTx : public CMerkleTx { private: const CWallet* pwallet; public: std::vector<CMerkleTx> vtxPrev; mapValue_t mapValue; std::vector<std::pair<std::string, std::string> > vOrderForm; unsigned int fTimeReceivedIsTxTime; unsigned int nTimeReceived; // time received by this node unsigned int nTimeSmart; char fFromMe; std::string strFromAccount; std::vector<char> vfSpent; // which outputs are already spent int64 nOrderPos; // position in ordered transaction list // memory only mutable bool fDebitCached; mutable bool fCreditCached; mutable bool fAvailableCreditCached; mutable bool fChangeCached; mutable int64 nDebitCached; mutable int64 nCreditCached; mutable int64 nAvailableCreditCached; mutable int64 nChangeCached; CWalletTx() { Init(NULL); } CWalletTx(const CWallet* pwalletIn) { Init(pwalletIn); } CWalletTx(const CWallet* pwalletIn, const CMerkleTx& txIn) : CMerkleTx(txIn) { Init(pwalletIn); } CWalletTx(const CWallet* pwalletIn, const CTransaction& txIn) : CMerkleTx(txIn) { Init(pwalletIn); } void Init(const CWallet* pwalletIn) { pwallet = pwalletIn; vtxPrev.clear(); mapValue.clear(); vOrderForm.clear(); fTimeReceivedIsTxTime = false; nTimeReceived = 0; nTimeSmart = 0; fFromMe = false; strFromAccount.clear(); vfSpent.clear(); fDebitCached = false; fCreditCached = false; fAvailableCreditCached = false; fChangeCached = false; nDebitCached = 0; nCreditCached = 0; nAvailableCreditCached = 0; nChangeCached = 0; nOrderPos = -1; } IMPLEMENT_SERIALIZE ( CWalletTx* pthis = const_cast<CWalletTx*>(this); if (fRead) pthis->Init(NULL); char fSpent = false; if (!fRead) { pthis->mapValue["fromaccount"] = pthis->strFromAccount; std::string str; BOOST_FOREACH(char f, vfSpent) { str += (f ? '1' : '0'); if (f) fSpent = true; } pthis->mapValue["spent"] = str; WriteOrderPos(pthis->nOrderPos, pthis->mapValue); if (nTimeSmart) pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); } nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action); READWRITE(vtxPrev); READWRITE(mapValue); READWRITE(vOrderForm); READWRITE(fTimeReceivedIsTxTime); READWRITE(nTimeReceived); READWRITE(fFromMe); READWRITE(fSpent); if (fRead) { pthis->strFromAccount = pthis->mapValue["fromaccount"]; if (mapValue.count("spent")) BOOST_FOREACH(char c, pthis->mapValue["spent"]) pthis->vfSpent.push_back(c != '0'); else pthis->vfSpent.assign(vout.size(), fSpent); ReadOrderPos(pthis->nOrderPos, pthis->mapValue); pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; } pthis->mapValue.erase("fromaccount"); pthis->mapValue.erase("version"); pthis->mapValue.erase("spent"); pthis->mapValue.erase("n"); pthis->mapValue.erase("timesmart"); ) // marks certain txout's as spent // returns true if any update took place bool UpdateSpent(const std::vector<char>& vfNewSpent) { bool fReturn = false; for (unsigned int i = 0; i < vfNewSpent.size(); i++) { if (i == vfSpent.size()) break; if (vfNewSpent[i] && !vfSpent[i]) { vfSpent[i] = true; fReturn = true; fAvailableCreditCached = false; } } return fReturn; } // make sure balances are recalculated void MarkDirty() { fCreditCached = false; fAvailableCreditCached = false; fDebitCached = false; fChangeCached = false; } void BindWallet(CWallet *pwalletIn) { pwallet = pwalletIn; MarkDirty(); } void MarkSpent(unsigned int nOut) { if (nOut >= vout.size()) throw std::runtime_error("CWalletTx::MarkSpent() : nOut out of range"); vfSpent.resize(vout.size()); if (!vfSpent[nOut]) { vfSpent[nOut] = true; fAvailableCreditCached = false; } } void MarkUnspent(unsigned int nOut) { if (nOut >= vout.size()) throw std::runtime_error("CWalletTx::MarkUnspent() : nOut out of range"); vfSpent.resize(vout.size()); if (vfSpent[nOut]) { vfSpent[nOut] = false; fAvailableCreditCached = false; } } bool IsSpent(unsigned int nOut) const { if (nOut >= vout.size()) throw std::runtime_error("CWalletTx::IsSpent() : nOut out of range"); if (nOut >= vfSpent.size()) return false; return (!!vfSpent[nOut]); } int64 GetDebit() const { if (vin.empty()) return 0; if (fDebitCached) return nDebitCached; nDebitCached = pwallet->GetDebit(*this); fDebitCached = true; return nDebitCached; } int64 GetCredit(bool fUseCache=true) const { // Must wait until coinbase is safely deep enough in the chain before valuing it if ((IsCoinBase() || IsCoinStake()) && GetBlocksToMaturity() > 0) return 0; // GetBalance can assume transactions in mapWallet won't change if (fUseCache && fCreditCached) return nCreditCached; nCreditCached = pwallet->GetCredit(*this); fCreditCached = true; return nCreditCached; } int64 GetAvailableCredit(bool fUseCache=true) const { // Must wait until coinbase is safely deep enough in the chain before valuing it if ((IsCoinBase() || IsCoinStake()) && GetBlocksToMaturity() > 0) return 0; if (fUseCache && fAvailableCreditCached) return nAvailableCreditCached; int64 nCredit = 0; for (unsigned int i = 0; i < vout.size(); i++) { if (!IsSpent(i)) { const CTxOut &txout = vout[i]; nCredit += pwallet->GetCredit(txout); if (!MoneyRange(nCredit)) throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range"); } } nAvailableCreditCached = nCredit; fAvailableCreditCached = true; return nCredit; } int64 GetChange() const { if (fChangeCached) return nChangeCached; nChangeCached = pwallet->GetChange(*this); fChangeCached = true; return nChangeCached; } void GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, std::list<std::pair<CTxDestination, int64> >& listReceived, std::list<std::pair<CTxDestination, int64> >& listSent, int64& nFee, std::string& strSentAccount) const; void GetAccountAmounts(const std::string& strAccount, int64& nGeneratedImmature, int64& nGeneratedMature, int64& nReceived, int64& nSent, int64& nFee) const; bool IsFromMe() const { return (GetDebit() > 0); } bool IsConfirmed() const { // Quick answer in most cases if (!IsFinal()) return false; if (GetDepthInMainChain() >= 1) return true; if (!IsFromMe()) // using wtx's cached debit return false; // If no confirmations but it's from us, we can still // consider it confirmed if all dependencies are confirmed std::map<uint256, const CMerkleTx*> mapPrev; std::vector<const CMerkleTx*> vWorkQueue; vWorkQueue.reserve(vtxPrev.size()+1); vWorkQueue.push_back(this); for (unsigned int i = 0; i < vWorkQueue.size(); i++) { const CMerkleTx* ptx = vWorkQueue[i]; if (!ptx->IsFinal()) return false; if (ptx->GetDepthInMainChain() >= 1) continue; if (!pwallet->IsFromMe(*ptx)) return false; if (mapPrev.empty()) { BOOST_FOREACH(const CMerkleTx& tx, vtxPrev) mapPrev[tx.GetHash()] = &tx; } BOOST_FOREACH(const CTxIn& txin, ptx->vin) { if (!mapPrev.count(txin.prevout.hash)) return false; vWorkQueue.push_back(mapPrev[txin.prevout.hash]); } } return true; } bool WriteToDisk(); int64 GetTxTime() const; int GetRequestCount() const; void AddSupportingTransactions(CTxDB& txdb); bool AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs=true); bool AcceptWalletTransaction(); void RelayWalletTransaction(CTxDB& txdb); void RelayWalletTransaction(); }; class COutput { public: const CWalletTx *tx; int i; int nDepth; COutput(const CWalletTx *txIn, int iIn, int nDepthIn) { tx = txIn; i = iIn; nDepth = nDepthIn; } std::string ToString() const { return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().substr(0,10).c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str()); } void print() const { printf("%s\n", ToString().c_str()); } }; /** Private key that includes an expiration date in case it never gets used. */ class CWalletKey { public: CPrivKey vchPrivKey; int64 nTimeCreated; int64 nTimeExpires; std::string strComment; //// todo: add something to note what created it (user, getnewaddress, change) //// maybe should have a map<string, string> property map CWalletKey(int64 nExpires=0) { nTimeCreated = (nExpires ? GetTime() : 0); nTimeExpires = nExpires; } IMPLEMENT_SERIALIZE ( if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(vchPrivKey); READWRITE(nTimeCreated); READWRITE(nTimeExpires); READWRITE(strComment); ) }; /** Account information. * Stored in wallet with key "acc"+string account name. */ class CAccount { public: CPubKey vchPubKey; CAccount() { SetNull(); } void SetNull() { vchPubKey = CPubKey(); } IMPLEMENT_SERIALIZE ( if (!(nType & SER_GETHASH)) READWRITE(nVersion); READWRITE(vchPubKey); ) }; /** Internal transfers. * Database key is acentry<account><counter>. */ class CAccountingEntry { public: std::string strAccount; int64 nCreditDebit; int64 nTime; std::string strOtherAccount; std::string strComment; mapValue_t mapValue; int64 nOrderPos; // position in ordered transaction list uint64 nEntryNo; CAccountingEntry() { SetNull(); } void SetNull() { nCreditDebit = 0; nTime = 0; strAccount.clear(); strOtherAccount.clear(); strComment.clear(); nOrderPos = -1; } IMPLEMENT_SERIALIZE ( CAccountingEntry& me = *const_cast<CAccountingEntry*>(this); if (!(nType & SER_GETHASH)) READWRITE(nVersion); // Note: strAccount is serialized as part of the key, not here. READWRITE(nCreditDebit); READWRITE(nTime); READWRITE(strOtherAccount); if (!fRead) { WriteOrderPos(nOrderPos, me.mapValue); if (!(mapValue.empty() && _ssExtra.empty())) { CDataStream ss(nType, nVersion); ss.insert(ss.begin(), '\0'); ss << mapValue; ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end()); me.strComment.append(ss.str()); } } READWRITE(strComment); size_t nSepPos = strComment.find("\0", 0, 1); if (fRead) { me.mapValue.clear(); if (std::string::npos != nSepPos) { CDataStream ss(std::vector<char>(strComment.begin() + nSepPos + 1, strComment.end()), nType, nVersion); ss >> me.mapValue; me._ssExtra = std::vector<char>(ss.begin(), ss.end()); } ReadOrderPos(me.nOrderPos, me.mapValue); } if (std::string::npos != nSepPos) me.strComment.erase(nSepPos); me.mapValue.erase("n"); ) private: std::vector<char> _ssExtra; }; bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut); #endif
[ "niitassin@gmail.com" ]
niitassin@gmail.com
13eb1f07d00ee61dbe736c94bcf3a6d18c3c9020
834475cec2d606cc18e3f31dcdb160d33e032328
/06/DX12Tutorial2_06/Src/Action.cpp
00e211d39af7db64492c5ef2899b2b51c8703521
[ "MIT" ]
permissive
tn-mai/DX12Tutorial2
803449f55084036928b7ef9827b3ee85b41bb043
340b74901680bb7f77b083401e2fc12638462289
refs/heads/master
2021-01-20T01:13:45.874361
2017-07-27T01:07:49
2017-07-27T01:07:49
89,241,111
1
0
null
null
null
null
SHIFT_JIS
C++
false
false
27,852
cpp
/** * @file Action.cpp * * スプライトの動作を制御するスクリプト. * スプライトの移動、回転、消滅、他のスプライトの生成などの各要素について、 * 目標値、動作時間、間隔といったパラメータで制御する. * */ #include "Action.h" #include "Json.h" #include "Sprite.h" #include "DXMathHelper.h" #include <algorithm> using namespace DirectX; namespace Action { namespace B { #ifndef ACTIION_ENABLE_SECTIONING_METHOD_COMPARISON const size_t separationCount = 10; const size_t sectionCount = 32; #endif ACTIION_ENABLE_SECTIONING_METHOD_COMPARISON /** * 3次ベジェ曲線. */ struct Bezier3 { XMVECTOR b0; XMVECTOR b1; XMVECTOR b2; XMVECTOR b3; }; /// ベジェ曲線の長さを測定する関数の型. typedef float (XM_CALLCONV *LengthFuncType)(Bezier3, float, float, size_t); /** * tにおける3次ベジェ曲線の座標を計算する. * * @param b0 制御点0の座標. * @param b1 制御点1の座標. * @param b2 制御点2の座標. * @param b3 制御点3の座標. * @param t 曲線上の位置. * * @return tに対応する座標. */ XMVECTOR XM_CALLCONV CalcBezier(XMVECTOR b0, XMVECTOR b1, XMVECTOR b2, XMVECTOR b3, float t) { const float u = 1.0f - t; const XMVECTOR coef = XMVectorSet(u * u * u, 3.0f * u * u * t, 3.0f * u * t * t, t * t * t); XMVECTOR p = XMVectorMultiply(b0, XXXX(coef)); p = XMVectorMultiplyAdd(b1, YYYY(coef), p); p = XMVectorMultiplyAdd(b2, ZZZZ(coef), p); p = XMVectorMultiplyAdd(b3, WWWW(coef), p); return p; /* return omt * omt * omt * b0 + 3.0f * omt * omt * t * b1 + 3.0f * omt * t * t * b2 + t * t * t * b3; */ } /** * tにおける3次ベジェ曲線の座標を計算する. * * @param bezier 3次ベジェ曲線. * @param t 曲線上の位置. * * @return tに対応する座標. */ XMVECTOR XM_CALLCONV CalcBezier(Bezier3 bezier, float t) { return CalcBezier(bezier.b0, bezier.b1, bezier.b2, bezier.b3, t); } /** * ベジェ曲線の長さを計算する. * * @param bezier 3次ベジェ曲線. * @param t0 区間の始点のt. * @param t1 区間の終点のt. * @param n 分割数. * * @return t0-t1間の長さ. * * 台形補間法によって3次ベジェ曲線の長さを求める. */ float XM_CALLCONV CalcBezierLengthLinear(Bezier3 bezier, float t0, float t1, size_t n) { const float delta = (t1 - t0) / static_cast<float>(n); XMVECTOR total = XMVectorZero(); XMVECTOR current = CalcBezier(bezier, t0); for (size_t i = 1; i <= n; ++i) { const XMVECTOR next = CalcBezier(bezier, t0 + delta * i); total += XMVector2Length(next - current); current = next; } return XMVectorGetX(total); } /** * tにおけるベジェ曲線の接線を計算する. * * @param bezier 3次ベジェ曲線. * @param t 曲線上の位置. * * @return tにおける接線. * * ド・カステリョのアルゴリズムを整理し、微分すると以下の式を得る. * <pre> * dU = -3t^2(b0 - 3(b1 - b2) - b3) + 6t(b0 - 2b1 + b2) - 3(b0 - b1) * * [導出] * u ^ 3 * b0 + 3u ^ 2 * t*b1 + 3u * t ^ 2 * b2 + t ^ 3 * b3; * | * V * f(x) = (-t^3+3t^2-3t+1)*b0 + * 3*(t^3-2t^2+t)*b1 + * 3*(t^2-t^3)*b2 + * t^3*b3 * | * V * f(x) = t^3(-b0+3*b1-3*b2+b3) + * t^2(3*b0-6*b1+3*b2) + * t(-3*b0+3*b1)) + * b0 * | * V * f'(x) = 3At^2+2Bt+C * </pre> */ XMVECTOR XM_CALLCONV CalcDerivativeLength(Bezier3 bezier, float t) { const XMVECTOR coef0 = XMVectorSet(-3 * t * t, 3, 6 * t, 2); XMVECTOR dU = XXXX(coef0) * (bezier.b0 - YYYY(coef0) * (bezier.b1 - bezier.b2) - bezier.b3); dU += ZZZZ(coef0) * (bezier.b0 - WWWW(coef0) * bezier.b1 + bezier.b2); dU += YYYY(coef0) * (bezier.b1 - bezier.b0); return XMVector2Length(dU); } #ifdef ACTIION_ENABLE_SECTIONING_METHOD_COMPARISON /** * ベジェ曲線の長さを計算する. * * @param bezier 3次ベジェ曲線. * @param t0 区間の始点のt. * @param t1 区間の終点のt. * @param n 分割数(偶数でなければならない). * * @return t0-t1間の長さ. * * シンプソン法によって3次ベジェ曲線の長さを求める. * * @note シンプソン法は始点・中間点・終点の3点(=2区間)単位で計算を行うため、nは偶数でなければならない. */ float XM_CALLCONV CalcBezierLengthSimpson(Bezier3 bezier, float t0, float t1, size_t n) { const float h = (t1 - t0) / static_cast<float>(n); XMVECTOR x4 = XMVECTORF32{ 0 }; for (size_t i = 1; i < n; i += 2) { x4 += CalcDerivativeLength(bezier, t0 + h * i); } XMVECTOR x2 = XMVECTORF32{ 0 }; for (size_t i = 2; i < n; i += 2) { x2 += CalcDerivativeLength(bezier, t0 + h * i); } const XMVECTOR coef = XMVECTORF32{ 4, 2 }; XMVECTOR endPoint = CalcDerivativeLength(bezier, t0) + CalcDerivativeLength(bezier, t1); return h * (1.0f / 3.0f) * XMVectorGetX(endPoint + XXXX(coef) * x4 + YYYY(coef) * x2); } #endif // ACTIION_ENABLE_SECTIONING_METHOD_COMPARISON /** * 距離に対応するtの値を求める. * * @param bezier 3次ベジェ曲線. * @param d 始点からの距離. * @param length 3次ベジェ曲線の長さ. * * @return dに対応するtの値. * * ニュートン・ラフソン法によって距離dに対応するtを求める. */ float XM_CALLCONV FindTValue(Bezier3 bezier, float d, float length, int n, LengthFuncType Func=&CalcBezierLengthLinear) { const float err = 0.001f; // 許容する誤差. float t = d / length; for (int i = 0; i < 1000; ++i) { const float tn = t - (Func(bezier, 0, t, n) - d) / XMVectorGetX(CalcDerivativeLength(bezier, t)); if (std::abs(tn - t) < err) { break; } t = tn; } return t; } /** * ベジェ曲線を等分し、各区間の始点のtと区間の単位tを計算する. * * @param bezier 3次ベジェ曲線. * @param count 分割数. * * @param tと単位距離に対するtの増分のリスト. */ std::vector<BezierSection> XM_CALLCONV CreateSectionList(Bezier3 bezier, size_t count, size_t n, LengthFuncType func=&CalcBezierLengthLinear) { std::vector<BezierSection> buf; buf.reserve(count + 1); buf.push_back({ 0, 0 }); const float length = func(bezier, 0, 1, n); const float section = length / static_cast<float>(count); for (size_t i = 1; i < count; ++i) { const float t = FindTValue(bezier, static_cast<float>(i) * section, length, n, func); buf.back().unitT = (t - buf.back().t) / section; buf.push_back({t, 0}); } buf.back().unitT = (1 - buf.back().t) / section; buf.push_back({ 1, 0 }); return buf; } /** * コンストラクタ. */ Controller::Controller() : pattern(nullptr) { } /** * 移動パターンを指定する. * * @param p 設定する移動パターンへのポインタ. */ void Controller::SetPattern(const Pattern* p) { pattern = p; codeCounter = 0; time = 0; } /** * 状態の更新. * * @param sprite 移動パターンを適用するスプライト. * @param delta 前回更新してからの経過時間. */ void Controller::Update(Sprite::Sprite& sprite, double delta) { if (!pattern || codeCounter >= pattern->data.size()) { return; } if (codeCounter == 0 && time == 0) { basePos = XMLoadFloat3(&sprite.pos); startPos = XMLoadFloat3(&sprite.pos); } time += delta; const Code* pCode = pattern->data.data() + codeCounter; switch (pCode[0].opcode) { case Type::Move: { const XMVECTOR relativeTargetPos = XMVectorSet(pCode[1].operand, pCode[2].operand, 0, 0); const float speed = pCode[3].operand; const XMVECTOR targetPos = XMVectorAdd(relativeTargetPos, basePos); const XMVECTOR targetVec = XMVectorSubtract(targetPos, startPos); const XMVECTOR unitVec = XMVector2Normalize(targetVec); const float currentLength = speed * static_cast<float>(time); const XMVECTOR currentVec = XMVectorMultiply(unitVec, XMVectorReplicate(currentLength)); const uint32_t isOverRun = XMVectorGetIntX(XMVectorGreaterOrEqual(XMVector2LengthSq(currentVec), XMVector2LengthSq(targetVec))); if (!isOverRun) { XMStoreFloat3(&sprite.pos, XMVectorAdd(startPos, currentVec)); } else { XMStoreFloat3(&sprite.pos, targetPos); startPos = targetPos; codeCounter += 4; time = 0; } break; } case Type::Stop: if (time >= pCode[1].operand) { codeCounter += 2; time -= pCode[1].operand; } break; case Type::Bezier: { const XMVECTOR pos1 = XMVectorAdd(XMVectorSet(pCode[1].operand, pCode[2].operand, 0, 0), basePos); const XMVECTOR pos2 = XMVectorAdd(XMVectorSet(pCode[3].operand, pCode[4].operand, 0, 0), basePos); const XMVECTOR pos3 = XMVectorAdd(XMVectorSet(pCode[5].operand, pCode[6].operand, 0, 0), basePos); const float totalTime = pCode[7].operand; if (time < totalTime) { #if 1 const Bezier3 bezier = { startPos, pos1, pos2, pos3 }; if (sectionList.empty()) { #ifdef ACTIION_ENABLE_SECTIONING_METHOD_COMPARISON const LengthFuncType lengthFunc = useSimpsonsRule ? CalcBezierLengthSimpson : CalcBezierLengthLinear; #else const LengthFuncType lengthFunc = CalcBezierLengthLinear; #endif // ACTIION_ENABLE_SECTIONING_METHOD_COMPARISON totalLength = lengthFunc(bezier, 0, 1, separationCount); sectionList = CreateSectionList(bezier, sectionCount, separationCount, lengthFunc); } const float ratio = static_cast<float>(time) / totalTime; const size_t index = static_cast<size_t>(ratio * sectionCount); const float d = ratio * totalLength; const float rd = d - static_cast<float>(index) * totalLength * (1.0f / sectionCount); const XMVECTOR p = CalcBezier(bezier, sectionList[index].t + rd * sectionList[index].unitT); XMStoreFloat3(&sprite.pos, p); #else // const XMVECTOR p = CalcBezier(startPos, pos1, pos2, pos3, time / totalTime); // XMStoreFloat3(&sprite.pos, p); #endif } else { XMStoreFloat3(&sprite.pos, pos3); startPos = pos3; codeCounter += 8; time = 0; sectionList.clear(); } break; } } } /** * 移動を終了しているか調べる. * * @retval true 移動終了、または移動データが未設定. * @retval false 移動中. */ bool Controller::IsFinished() const { return pattern && codeCounter >= pattern->data.size(); } } // namespcee B /** * アクションデータの種類. */ enum class Type { Move, Accel, Wait, Path, ControlPoint, Vanishing, Generation, Animation, ManualControl, }; /** * 補間方法. * * 現在未実装. */ enum InterporationType { InterporationType_Step, InterporationType_Linear, InterporationType_Ease, InterporationType_EaseIn, InterporationType_EaseOut, }; enum MoveParamId { MoveParamId_DirectionDegree, MoveParamId_Speed, }; enum AccelParamId { AccelParamId_DirectionDegree, AccelParamId_Accel, }; enum WaitParamId { WaitParamId_Time, }; enum PathParamId { PathParamId_Time, PathParamId_Count, PathParamId_Interporation, }; enum ControlPointId { ControlPointId_X, ControlPointId_Y, }; enum GenParamId { GenParamId_Speed, GenParamId_DirectionDegree, GenParamId_Option, }; enum AnimeParamId { AnimeParamId_Id, }; /** * アクションデータ. * * 個々のアクションを保持する. */ struct Data { Type type; ///< アクションの種類. float param[3]; ///< パラメータ配列. }; /** * アクションシーケンス. * * アクションデータの配列. */ typedef std::vector<Data> Sequence; /** * アクションシーケンスのリスト. */ struct List { std::string name; ///< リスト名. std::vector<Sequence> list; ///< シーケンスの配列. }; bool operator<(const List& lhs, const List& rhs) { return lhs.name < rhs.name; } bool operator<(const List& lhs, const char* rhs) { return lhs.name.compare(rhs) < 0; } bool operator<(const char* lhs, const List& rhs) { return rhs.name.compare(lhs) > 0; } /** * ド・ブーアのアルゴリズムによるBスプライン座標の生成. * * @param k 再帰呼び出しの深度. degreeで開始し、再帰呼出し毎にデクリメントされる. 0になったとき再帰は終了する. * @param degree 次数. * @param i 座標生成に使用する最初のコントロールポイントのインデックス. * @param x 生成される座標の位置. 最初のコントロールポイントを0、最後のコントロールポイントをNとしたとき、 * 0〜Nの値を取る. * @param points コントロールポイントの配列. * * @return xに対応するBスプラインカーブ上の座標. */ XMVECTOR DeBoorI(int k, int degree, int i, float x, const std::vector<XMFLOAT2>& points) { if (k == 0) { return XMLoadFloat2(&points[std::max(0, std::min<int>(i, points.size() - 1))]); } const float alpha = (x - static_cast<float>(i)) / static_cast<float>(degree + 1 - k); const XMVECTOR a = DeBoorI(k - 1, degree, i - 1, x, points); const XMVECTOR b = DeBoorI(k - 1, degree, i, x, points); const XMVECTORF32 t{ alpha, (1.0f - alpha), 0.0f, 0.0f }; return XMVectorAdd( XMVectorMultiply(a, XMVectorSwizzle(t, 1, 1, 1, 1)), XMVectorMultiply(b, XMVectorSwizzle(t, 0, 0, 0, 0))); } /** *ド・ブーアのアルゴリズムによるBスプライン座標の生成. * * @param degree 次数. * @param x 生成される座標の位置. 最初のコントロールポイントを0、最後のコントロールポイントをNとしたとき、 * 0〜Nの値を取る. * @param points コントロールポイントの配列. * * @return xに対応するBスプラインカーブ上の座標. */ XMVECTOR DeBoor(int degree, float x, const std::vector<XMFLOAT2>& points) { const int i = static_cast<int>(x); return DeBoorI(degree, degree, i, x, points); } /** * 3次Bスプライン曲線を生成する. * * @param points コントロールポイントの配列. 少なくとも3つのコントロールポイントを含んでいなければならない. * @param numOfSegments 生成する中間点の数. pointsの数以上の値でなければならない. * * @return 生成された中間点の配列. */ std::vector<XMFLOAT2> CreateBSpline(const std::vector<XMFLOAT2>& points, int numOfSegments) { std::vector<XMFLOAT2> v; v.reserve(numOfSegments); const float n = static_cast<float>(points.size() + 1); for (int i = 0; i < numOfSegments - 1; ++i) { const float ratio = static_cast<float>(i) / static_cast<float>(numOfSegments - 1); const float x = ratio * n + 1; XMVECTORF32 pos; pos.v = DeBoor(3, x, points); v.emplace_back(pos.f[0], pos.f[1]); } v.push_back(points.back()); // 同じベクトルを持つ区間を統合する. std::vector<XMVECTOR> vectorList; vectorList.reserve(v.size() - 1); for (size_t i = 1; i < v.size(); ++i) { vectorList.push_back(XMVector2Normalize(XMVectorSubtract(XMLoadFloat2(&v[i]), XMLoadFloat2(&v[i - 1])))); } std::vector<XMFLOAT2> ret; ret.reserve((v.size() + 1) / 2); ret.push_back(v.front()); XMVECTOR vec = vectorList[0]; for (size_t i = 1; i < vectorList.size(); ++i) { float r; XMStoreFloat(&r, XMVector2Dot(vec, vectorList[i])); if (r < 0.999f) { ret.push_back(v[i]); vec = vectorList[i]; } else { vec = XMVector2Normalize(XMVectorSubtract(XMLoadFloat2(&v[i]), XMLoadFloat2(&ret.back()))); } } ret.push_back(v.back()); return ret; } /** * 度数法の値を弧度法に変換する. * * @param degree 度数法の値. * * @return 弧度法におけるdegreeに対応する値. */ float DegreeToRadian(float degree) { return (3.14159265359f * degree / 180.0f); } /** * * * @param rad 回転角(radian). * @param mag ベクトルの大きさ. * * @return 2次元ベクトル(mag, 0)を0度とし、反時計回りにradだけ回転させたベクトルを返す. */ XMVECTOR RadianToVector(float rad, float mag) { XMFLOAT2A tmp; XMScalarSinCos(&tmp.y, &tmp.x, rad); tmp.y *= -1.0f; return XMVectorMultiply(XMLoadFloat2A(&tmp), XMVectorSwizzle(XMLoadFloat(&mag), 0, 0, 0, 0)); } /** * コンストラクタ. */ Controller::Controller() { SetList(nullptr); } /** * コンストラクタ. * * @param p 設定するアクションリストへのポインタ. * @param no 再生するアクション番号. */ Controller::Controller(const List* p, uint32_t no) { SetList(p, no); } /** * アクションリストを設定する. * * @param p 設定するアクションリストへのポインタ. * @param no 再生するアクション番号. */ void Controller::SetList(const List* p, uint32_t no) { list = p; seqIndex = 0; dataIndex = 0; currentTime = 0; totalTime = 0; isGeneratorActive = false; type = Type::ManualControl; move = XMFLOAT2(0, 0); accel = XMFLOAT2(0, 0); if (!list || no >= list->list.size() || dataIndex >= list->list[no].size()) { return; } seqIndex = no; Init(); } /** * アクションの現在の状態でコントローラを更新する. */ void Controller::Init(Sprite::Sprite* pSprite) { if (!list || seqIndex >= list->list.size() || type == Type::Vanishing) { return; } for (; dataIndex < list->list[seqIndex].size(); ++dataIndex) { const Data& data = list->list[seqIndex][dataIndex]; switch (data.type) { case Type::Move: type = Type::Move; XMStoreFloat2(&move, RadianToVector(DegreeToRadian(data.param[MoveParamId_DirectionDegree]), data.param[MoveParamId_Speed])); break; case Type::Accel: type = Type::Move; XMStoreFloat2(&accel, RadianToVector(DegreeToRadian(data.param[AccelParamId_DirectionDegree]), data.param[AccelParamId_Accel])); break; case Type::Wait: type = Type::Move; totalTime = data.param[WaitParamId_Time]; return; case Type::Path: { type = Type::Path; totalTime = data.param[PathParamId_Time]; path.type = static_cast<InterporationType>(static_cast<int>(data.param[PathParamId_Interporation])); std::vector<XMFLOAT2> controlPoints; controlPoints.reserve(static_cast<size_t>(data.param[PathParamId_Count])); for (int i = 0; i < data.param[PathParamId_Count]; ++i) { if (++dataIndex >= list->list[seqIndex].size()) { break; } const Data& cp = list->list[seqIndex][dataIndex]; if (cp.type != Type::ControlPoint) { break; } controlPoints.emplace_back(cp.param[ControlPointId_X], cp.param[ControlPointId_Y]); } std::vector<XMFLOAT2> tmpPoints = CreateBSpline(controlPoints, controlPoints.size() * 16); std::vector<float> distances; path.cp.resize(tmpPoints.size()); for (size_t i = 0; i < tmpPoints.size(); ++i) { path.cp[i].pos = tmpPoints[i]; } path.cp[0].t = 0.0f; for (size_t i = 0; i < tmpPoints.size() - 1; ++i) { const XMVECTOR vec = XMVector2Length(XMVectorSubtract(XMLoadFloat2(&tmpPoints[i]), XMLoadFloat2(&tmpPoints[i + 1]))); XMStoreFloat(&path.cp[i + 1].t, vec); path.cp[i + 1].t += path.cp[i].t; } const float factor = totalTime / path.cp.back().t; for (auto& e : path.cp) { e.t *= factor; } return; } case Type::Vanishing: type = Type::Vanishing; return; case Type::Animation: if (pSprite && data.param[AnimeParamId_Id] >= 0) { pSprite->SetSeqIndex(static_cast<uint32_t>(data.param[AnimeParamId_Id])); } break; case Type::Generation: if (pSprite && generator) { isGeneratorActive = true; generator(0.0f, pSprite, data.param[GenParamId_Speed], data.param[GenParamId_DirectionDegree]); } break; } } } /** * アクションをスプライトに反映する. * * @param delta 更新時間(秒). * @param pSprite アクションを反映するスプライトへのポインタ. */ void Controller::UpdateSub(float delta, Sprite::Sprite* pSprite) { switch (type) { case Type::Move: { const XMVECTOR d = XMVectorSwizzle(XMLoadFloat(&delta), 0, 0, 1, 1); const XMVECTOR m = XMLoadFloat2(&move); const XMVECTOR a = XMLoadFloat2(&accel); XMStoreFloat3(&pSprite->pos, XMVectorAdd(XMLoadFloat3(&pSprite->pos), XMVectorMultiply(m, d))); XMStoreFloat2(&move, XMVectorAdd(m, XMVectorMultiply(a, d))); break; } case Type::Path: { const float t = currentTime + delta; if (t >= totalTime) { pSprite->pos.x = path.cp.back().pos.x; pSprite->pos.y = path.cp.back().pos.y; } else { const auto itr = std::upper_bound(path.cp.begin(), path.cp.end(), Point{ {}, t }); if (itr != path.cp.end()) { const Point& p0 = *(itr - 1); const Point& p1 = *itr; const float length = p1.t - p0.t; const float distance = t - p0.t; const float ratio = distance / length; pSprite->pos.x = p0.pos.x * (1.0f - ratio) + p1.pos.x * ratio; pSprite->pos.y = p0.pos.y * (1.0f - ratio) + p1.pos.y * ratio; } } break; } default: break; } } /** * アクションの状態を更新し、スプライトに反映する. * * @param delta 更新時間(秒). * @param pSprite アクションを反映するスプライトへのポインタ. */ void Controller::Update(float delta, Sprite::Sprite* pSprite) { if (type != Type::Vanishing && isGeneratorActive && generator) { generator(delta, pSprite, 0, 0); } if (type == Type::ManualControl) { const XMVECTOR d = XMVectorSwizzle(XMLoadFloat(&delta), 0, 0, 1, 1); XMStoreFloat3(&pSprite->pos, XMVectorAdd(XMLoadFloat3(&pSprite->pos), XMVectorMultiply(d, XMLoadFloat2(&move)))); XMStoreFloat2(&move, XMVectorAdd(XMLoadFloat2(&move), XMVectorMultiply(d, XMLoadFloat2(&accel)))); if (currentTime < totalTime) { currentTime += delta; } return; } if (!list || seqIndex >= list->list.size() || dataIndex >= list->list[seqIndex].size() || type == Type::Vanishing) { return; } UpdateSub(std::min(std::max(0.0f, totalTime - currentTime), delta), pSprite); currentTime += delta; while (currentTime >= totalTime) { currentTime -= totalTime; totalTime = 0.0f; delta = currentTime; ++dataIndex; if (dataIndex >= list->list[seqIndex].size()) { return; } Init(pSprite); UpdateSub(std::min(std::max(0.0f, totalTime - currentTime), delta), pSprite); } } /** * 再生するアクションシーケンスを指定する. * * @param no 再生するアクションシーケンスのインデックス. * 保持しているシーケンス数以上の値は無視される(シーケンスは変更されない). */ void Controller::SetSeqIndex(uint32_t no) { if (!list || no >= list->list.size()) { return; } seqIndex = no; dataIndex = 0; const Data& data = list->list[seqIndex][dataIndex]; type = data.type; currentTime = 0.0f; totalTime = 0.0f; Init(); } /** * マニュアルモードの移動速度を設定する. * * @param degree 移動方向(0-360). * @param speed 移動速度(pixels/s). */ void Controller::SetManualMove(float degree, float speed) { type = Type::ManualControl; XMStoreFloat2(&move, RadianToVector(DegreeToRadian(degree), speed)); } /** * マニュアルモードの加速度を設定する. * * @param degree 加速方向(0-360). * @param speed 加速度(pixels/s). */ void Controller::SetManualAccel(float degree, float speed) { type = Type::ManualControl; XMStoreFloat2(&accel, RadianToVector(DegreeToRadian(degree), speed)); } /** * マニュアルモードの動作時間を設定する. * * @param time 動作時間. */ void Controller::SetTime(float time) { type = Type::ManualControl; currentTime = 0.0f; totalTime = time; } /** * 消滅状態になっているかどうか. * * @retval true 消滅状態になっている. * @retval false 消滅状態になっていない. * * アクションシーケンスでType::Vanishingが指定されると消滅状態になり、アクションの再生が停止される. */ bool Controller::IsDeletable() const { return type == Type::Vanishing; } /** * Fileインターフェイスの実装クラス. */ class FileImpl : public File { public: FileImpl() {} virtual ~FileImpl() {} virtual const List* Get(uint32_t no) const { if (no >= actList.size()) { return nullptr; } return &actList[no]; } virtual size_t Size() const { return actList.size(); } std::vector<List> actList; }; /** * ファイルからアクションリストを読み込む. * * @param filename ファイル名. * * @return 読み込んだアクションリスト. * 読み込み失敗の場合はnullptrを返す. * * JSONフォーマットは次のとおり: * <pre> * [ * { * "name" : "アクションリスト名", * "list" : * [ * [ * { * "type" : "アクションの種類を示す文字列", * "args" : [arg0, arg1, arg2] * }, * ... * ], * ... * ] * }, * ... * ] * </pre> */ FilePtr LoadFromJsonFile(const wchar_t* filename) { struct HandleHolder { explicit HandleHolder(HANDLE h) : handle(h) {} ~HandleHolder() { if (handle != INVALID_HANDLE_VALUE) { CloseHandle(handle); } } HANDLE handle; operator HANDLE() { return handle; } operator HANDLE() const { return handle; } }; std::shared_ptr<FileImpl> af(new FileImpl); HandleHolder h(CreateFileW(filename, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr)); if (h == INVALID_HANDLE_VALUE) { return af; } LARGE_INTEGER size; if (!GetFileSizeEx(h, &size)) { return af; } if (size.QuadPart > std::numeric_limits<size_t>::max()) { return af; } std::vector<char> buffer; buffer.resize(static_cast<size_t>(size.QuadPart)); DWORD readBytes; if (!ReadFile(h, &buffer[0], buffer.size(), &readBytes, nullptr)) { return af; } const Json::Result result = Json::Parse(buffer.data(), buffer.data() + buffer.size()); if (!result.error.empty()) { OutputDebugStringA(result.error.c_str()); return af; } const Json::Array& json = result.value.AsArray(); for (const Json::Value& e : json) { const Json::Object& object = e.AsObject(); List al; const Json::Object::const_iterator itrName = object.find("name"); if (itrName != object.end()) { al.name = itrName->second.AsString(); } const Json::Object::const_iterator itrList = object.find("list"); if (itrList == object.end()) { break; } const Json::Array& seqList = itrList->second.AsArray(); for (const Json::Value& valSeq : seqList) { const Json::Array& seq = valSeq.AsArray(); Sequence as; for (const Json::Value& data : seq) { const Json::Object& obj = data.AsObject(); Data ad = {}; static const struct { const char* const str; Type type; bool operator==(const std::string& s) const { return s == str; } } typeMap[] = { { "Move", Type::Move }, { "Accel", Type::Accel }, { "Wait", Type::Wait }, { "Generate", Type::Generation }, { "Animation", Type::Animation }, { "Delete", Type::Vanishing }, }; const auto itrTypePair = std::find(typeMap, typeMap + _countof(typeMap), obj.find("type")->second.AsString()); if (itrTypePair == typeMap + _countof(typeMap)) { return af; } ad.type = itrTypePair->type; const Json::Array& array = obj.find("args")->second.AsArray(); for (size_t i = 0; i < 3 && i < array.size(); ++i) { ad.param[i] = static_cast<float>(array[i].AsNumber()); } as.push_back(ad); } al.list.push_back(as); } af->actList.push_back(al); } return af; } } // namespace Action
[ "rabitfiver@gmail.com" ]
rabitfiver@gmail.com
da19654a31e27188e8da2de57d1aea3f3f21e21c
2b68af9646b435a38b0d3af0513596ee8f011856
/LSGDEngine/Engine/HWindowFrameWindows.cpp
01e74a0d5677a65d3c1286dd3b924cc7f0776898
[]
no_license
hhg128/LSGDEngine
8a5e19c0b73de72fd9349235f6da07fe62ae6590
92943c0847dc0880ae7c353ff69a2133c82c0dae
refs/heads/master
2020-05-07T16:42:10.886402
2019-04-05T04:53:48
2019-04-05T04:53:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,379
cpp
#include "HEnginePCH.h" #include "HWindowFrameWindows.h" #include "HImGuiDeviceWindows.h" HWindowFrameWindows::HWindowFrameWindows() { } HWindowFrameWindows::~HWindowFrameWindows() { } // @todo - temporary setting msg process here (need to move) LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (GImGuiDeviceWindows) { if (GImGuiDeviceWindows->UpdateMessage((void*)hWnd, msg, wParam, lParam)) { return true; } } return DefWindowProc(hWnd, msg, wParam, lParam); } void HWindowFrameWindows::CreateWindowFrame() { WindowClass = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, "SGDEngine", NULL }; RegisterClassEx(&WindowClass); Handle = CreateWindow(WindowClass.lpszClassName, "SGDEngine", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, WindowClass.hInstance, NULL); } void HWindowFrameWindows::DestroyWindowFrame() { UnregisterClass(WindowClass.lpszClassName, WindowClass.hInstance); DestroyWindow(Handle); } void HWindowFrameWindows::ShowWindowFrame() { ShowWindow(Handle, SW_SHOWDEFAULT); UpdateWindow(Handle); } bool HWindowFrameWindows::UpdateMessage() { MSG Message; ZeroMemory(&Message, sizeof(MSG)); if (PeekMessage(&Message, nullptr, 0U, 0U, PM_REMOVE)) { TranslateMessage(&Message); DispatchMessage(&Message); return true; } return false; }
[ "tkdgur4427@outlook.com" ]
tkdgur4427@outlook.com
8523e7d8510fbb63cf1e511f1855638cac862bd5
79f63381c75431371ffaff4b519b9f7bd4d31293
/doctor.ino
54535aada29006ff1f4f62c26f27b862f2613de3
[]
no_license
kendrawong/hw8
fb839c71187cfbd8242fdff3dc59c87211b3b0d6
45ea32aa7cd5b01bf6c4e0300f59732962506969
refs/heads/master
2021-04-06T04:05:41.177178
2018-03-12T02:54:19
2018-03-12T02:54:19
124,818,256
0
0
null
null
null
null
UTF-8
C++
false
false
499
ino
// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(9, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(9, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(9, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
[ "noreply@github.com" ]
noreply@github.com
3f0288167a41c7f6a04a27c3c9a946991e7476e1
3b80f6e60a361bd2abfb88ae1ce8fda7c5172911
/src/walletdb.cpp
eba7be5d87384d1c8b9c1305eb52ddf26160ec2b
[ "MIT" ]
permissive
covertress/viral-qt
32282b1bc4f0e50b97d113473f49322652f0bcfc
ec4c7d264d3d5366f13bad9a1f33f06556437bb0
refs/heads/master
2021-01-21T13:48:15.924018
2015-07-05T19:59:57
2015-07-05T19:59:57
38,579,728
1
0
null
null
null
null
UTF-8
C++
false
false
27,354
cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "walletdb.h" #include "base58.h" #include "protocol.h" #include "serialize.h" #include "sync.h" #include "wallet.h" #include <boost/filesystem.hpp> #include <boost/foreach.hpp> using namespace std; using namespace boost; static uint64_t nAccountingEntryNumber = 0; extern bool fWalletUnlockStakingOnly; // // CWalletDB // bool CWalletDB::WriteName(const string& strAddress, const string& strName) { nWalletDBUpdated++; return Write(make_pair(string("name"), strAddress), strName); } bool CWalletDB::EraseName(const string& strAddress) { // This should only be used for sending addresses, never for receiving addresses, // receiving addresses must always have an address book entry if they're not change return. nWalletDBUpdated++; return Erase(make_pair(string("name"), strAddress)); } bool CWalletDB::WriteTx(uint256 hash, const CWalletTx& wtx) { nWalletDBUpdated++; return Write(std::make_pair(std::string("tx"), hash), wtx); } bool CWalletDB::EraseTx(uint256 hash) { nWalletDBUpdated++; return Erase(std::make_pair(std::string("tx"), hash)); } bool CWalletDB::WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta) { nWalletDBUpdated++; if (!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta, false)) return false; // hash pubkey/privkey to accelerate wallet load std::vector<unsigned char> vchKey; vchKey.reserve(vchPubKey.size() + vchPrivKey.size()); vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end()); vchKey.insert(vchKey.end(), vchPrivKey.begin(), vchPrivKey.end()); return Write(std::make_pair(std::string("key"), vchPubKey), std::make_pair(vchPrivKey, Hash(vchKey.begin(), vchKey.end())), false); } bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta) { const bool fEraseUnencryptedKey = true; nWalletDBUpdated++; if (!Write(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) return false; if (!Write(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false)) return false; if (fEraseUnencryptedKey) { Erase(std::make_pair(std::string("key"), vchPubKey)); Erase(std::make_pair(std::string("wkey"), vchPubKey)); } return true; } bool CWalletDB::WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey) { nWalletDBUpdated++; return Write(std::make_pair(std::string("mkey"), nID), kMasterKey, true); } bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript) { nWalletDBUpdated++; return Write(std::make_pair(std::string("cscript"), hash), redeemScript, false); } bool CWalletDB::WriteBestBlock(const CBlockLocator& locator) { nWalletDBUpdated++; return Write(std::string("bestblock"), locator); } bool CWalletDB::ReadBestBlock(CBlockLocator& locator) { return Read(std::string("bestblock"), locator); } bool CWalletDB::WriteOrderPosNext(int64_t nOrderPosNext) { nWalletDBUpdated++; return Write(std::string("orderposnext"), nOrderPosNext); } bool CWalletDB::WriteDefaultKey(const CPubKey& vchPubKey) { nWalletDBUpdated++; return Write(std::string("defaultkey"), vchPubKey); } bool CWalletDB::ReadPool(int64_t nPool, CKeyPool& keypool) { return Read(std::make_pair(std::string("pool"), nPool), keypool); } bool CWalletDB::WritePool(int64_t nPool, const CKeyPool& keypool) { nWalletDBUpdated++; return Write(std::make_pair(std::string("pool"), nPool), keypool); } bool CWalletDB::ErasePool(int64_t nPool) { nWalletDBUpdated++; return Erase(std::make_pair(std::string("pool"), nPool)); } bool CWalletDB::WriteMinVersion(int nVersion) { return Write(std::string("minversion"), nVersion); } bool CWalletDB::ReadAccount(const string& strAccount, CAccount& account) { account.SetNull(); return Read(make_pair(string("acc"), strAccount), account); } bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account) { return Write(make_pair(string("acc"), strAccount), account); } bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry) { return Write(boost::make_tuple(string("acentry"), acentry.strAccount, nAccEntryNum), acentry); } bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry) { return WriteAccountingEntry(++nAccountingEntryNumber, acentry); } int64_t CWalletDB::GetAccountCreditDebit(const string& strAccount) { list<CAccountingEntry> entries; ListAccountCreditDebit(strAccount, entries); int64_t nCreditDebit = 0; BOOST_FOREACH (const CAccountingEntry& entry, entries) nCreditDebit += entry.nCreditDebit; return nCreditDebit; } void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& entries) { bool fAllAccounts = (strAccount == "*"); Dbc* pcursor = GetCursor(); if (!pcursor) throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor"); unsigned int fFlags = DB_SET_RANGE; while (true) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); if (fFlags == DB_SET_RANGE) ssKey << boost::make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64_t(0)); CDataStream ssValue(SER_DISK, CLIENT_VERSION); int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags); fFlags = DB_NEXT; if (ret == DB_NOTFOUND) break; else if (ret != 0) { pcursor->close(); throw runtime_error("CWalletDB::ListAccountCreditDebit() : error scanning DB"); } // Unserialize string strType; ssKey >> strType; if (strType != "acentry") break; CAccountingEntry acentry; ssKey >> acentry.strAccount; if (!fAllAccounts && acentry.strAccount != strAccount) break; ssValue >> acentry; ssKey >> acentry.nEntryNo; entries.push_back(acentry); } pcursor->close(); } DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet) { LOCK(pwallet->cs_wallet); // Old wallets didn't have any defined order for transactions // Probably a bad idea to change the output of this // First: get all CWalletTx and CAccountingEntry into a sorted-by-time multimap. typedef pair<CWalletTx*, CAccountingEntry*> TxPair; typedef multimap<int64_t, TxPair > TxItems; TxItems txByTime; for (map<uint256, CWalletTx>::iterator it = pwallet->mapWallet.begin(); it != pwallet->mapWallet.end(); ++it) { CWalletTx* wtx = &((*it).second); txByTime.insert(make_pair(wtx->nTimeReceived, TxPair(wtx, (CAccountingEntry*)0))); } list<CAccountingEntry> acentries; ListAccountCreditDebit("", acentries); BOOST_FOREACH(CAccountingEntry& entry, acentries) { txByTime.insert(make_pair(entry.nTime, TxPair((CWalletTx*)0, &entry))); } int64_t& nOrderPosNext = pwallet->nOrderPosNext; nOrderPosNext = 0; std::vector<int64_t> nOrderPosOffsets; for (TxItems::iterator it = txByTime.begin(); it != txByTime.end(); ++it) { CWalletTx *const pwtx = (*it).second.first; CAccountingEntry *const pacentry = (*it).second.second; int64_t& nOrderPos = (pwtx != 0) ? pwtx->nOrderPos : pacentry->nOrderPos; if (nOrderPos == -1) { nOrderPos = nOrderPosNext++; nOrderPosOffsets.push_back(nOrderPos); if (pwtx) { if (!WriteTx(pwtx->GetHash(), *pwtx)) return DB_LOAD_FAIL; } else if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry)) return DB_LOAD_FAIL; } else { int64_t nOrderPosOff = 0; BOOST_FOREACH(const int64_t& nOffsetStart, nOrderPosOffsets) { if (nOrderPos >= nOffsetStart) ++nOrderPosOff; } nOrderPos += nOrderPosOff; nOrderPosNext = std::max(nOrderPosNext, nOrderPos + 1); if (!nOrderPosOff) continue; // Since we're changing the order, write it back if (pwtx) { if (!WriteTx(pwtx->GetHash(), *pwtx)) return DB_LOAD_FAIL; } else if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry)) return DB_LOAD_FAIL; } } WriteOrderPosNext(nOrderPosNext); return DB_LOAD_OK; } class CWalletScanState { public: unsigned int nKeys; unsigned int nCKeys; unsigned int nKeyMeta; bool fIsEncrypted; bool fAnyUnordered; int nFileVersion; vector<uint256> vWalletUpgrade; CWalletScanState() { nKeys = nCKeys = nKeyMeta = 0; fIsEncrypted = false; fAnyUnordered = false; nFileVersion = 0; } }; bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, CWalletScanState &wss, string& strType, string& strErr) { try { // Unserialize // Taking advantage of the fact that pair serialization // is just the two items serialized one after the other ssKey >> strType; if (strType == "name") { string strAddress; ssKey >> strAddress; ssValue >> pwallet->mapAddressBook[CBitcoinAddress(strAddress).Get()]; } else if (strType == "tx") { uint256 hash; ssKey >> hash; CWalletTx& wtx = pwallet->mapWallet[hash]; ssValue >> wtx; if (wtx.CheckTransaction() && (wtx.GetHash() == hash)) wtx.BindWallet(pwallet); else { pwallet->mapWallet.erase(hash); return false; } // Undo serialize changes in 31600 if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703) { if (!ssValue.empty()) { char fTmp; char fUnused; ssValue >> fTmp >> fUnused >> wtx.strFromAccount; strErr = strprintf("LoadWallet() upgrading tx ver=%d %d '%s' %s", wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount, hash.ToString()); wtx.fTimeReceivedIsTxTime = fTmp; } else { strErr = strprintf("LoadWallet() repairing tx ver=%d %s", wtx.fTimeReceivedIsTxTime, hash.ToString()); wtx.fTimeReceivedIsTxTime = 0; } wss.vWalletUpgrade.push_back(hash); } if (wtx.nOrderPos == -1) wss.fAnyUnordered = true; //// debug print //LogPrintf("LoadWallet %s\n", wtx.GetHash().ToString()); //LogPrintf(" %12d %s %s %s\n", // wtx.vout[0].nValue, // DateTimeStrFormat("%x %H:%M:%S", wtx.GetBlockTime()), // wtx.hashBlock.ToString(), // wtx.mapValue["message"]); } else if (strType == "acentry") { string strAccount; ssKey >> strAccount; uint64_t nNumber; ssKey >> nNumber; if (nNumber > nAccountingEntryNumber) nAccountingEntryNumber = nNumber; if (!wss.fAnyUnordered) { CAccountingEntry acentry; ssValue >> acentry; if (acentry.nOrderPos == -1) wss.fAnyUnordered = true; } } else if (strType == "key" || strType == "wkey") { CPubKey vchPubKey; ssKey >> vchPubKey; if (!vchPubKey.IsValid()) { strErr = "Error reading wallet database: CPubKey corrupt"; return false; } CKey key; CPrivKey pkey; uint256 hash = 0; if (strType == "key") { wss.nKeys++; ssValue >> pkey; } else { CWalletKey wkey; ssValue >> wkey; pkey = wkey.vchPrivKey; } // Old wallets store keys as "key" [pubkey] => [privkey] // ... which was slow for wallets with lots of keys, because the public key is re-derived from the private key // using EC operations as a checksum. // Newer wallets store keys as "key"[pubkey] => [privkey][hash(pubkey,privkey)], which is much faster while // remaining backwards-compatible. try { ssValue >> hash; } catch(...){} bool fSkipCheck = false; if (hash != 0) { // hash pubkey/privkey to accelerate wallet load std::vector<unsigned char> vchKey; vchKey.reserve(vchPubKey.size() + pkey.size()); vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end()); vchKey.insert(vchKey.end(), pkey.begin(), pkey.end()); if (Hash(vchKey.begin(), vchKey.end()) != hash) { strErr = "Error reading wallet database: CPubKey/CPrivKey corrupt"; return false; } fSkipCheck = true; } if (!key.Load(pkey, vchPubKey, fSkipCheck)) { strErr = "Error reading wallet database: CPrivKey corrupt"; return false; } if (!pwallet->LoadKey(key, vchPubKey)) { strErr = "Error reading wallet database: LoadKey failed"; return false; } } else if (strType == "mkey") { unsigned int nID; ssKey >> nID; CMasterKey kMasterKey; ssValue >> kMasterKey; if(pwallet->mapMasterKeys.count(nID) != 0) { strErr = strprintf("Error reading wallet database: duplicate CMasterKey id %u", nID); return false; } pwallet->mapMasterKeys[nID] = kMasterKey; if (pwallet->nMasterKeyMaxID < nID) pwallet->nMasterKeyMaxID = nID; } else if (strType == "ckey") { wss.nCKeys++; vector<unsigned char> vchPubKey; ssKey >> vchPubKey; vector<unsigned char> vchPrivKey; ssValue >> vchPrivKey; if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey)) { strErr = "Error reading wallet database: LoadCryptedKey failed"; return false; } wss.fIsEncrypted = true; } else if (strType == "keymeta") { CPubKey vchPubKey; ssKey >> vchPubKey; CKeyMetadata keyMeta; ssValue >> keyMeta; wss.nKeyMeta++; pwallet->LoadKeyMetadata(vchPubKey, keyMeta); // find earliest key creation time, as wallet birthday if (!pwallet->nTimeFirstKey || (keyMeta.nCreateTime < pwallet->nTimeFirstKey)) pwallet->nTimeFirstKey = keyMeta.nCreateTime; } else if (strType == "defaultkey") { ssValue >> pwallet->vchDefaultKey; } else if (strType == "pool") { int64_t nIndex; ssKey >> nIndex; CKeyPool keypool; ssValue >> keypool; pwallet->setKeyPool.insert(nIndex); // If no metadata exists yet, create a default with the pool key's // creation time. Note that this may be overwritten by actually // stored metadata for that key later, which is fine. CKeyID keyid = keypool.vchPubKey.GetID(); if (pwallet->mapKeyMetadata.count(keyid) == 0) pwallet->mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime); } else if (strType == "version") { ssValue >> wss.nFileVersion; if (wss.nFileVersion == 10300) wss.nFileVersion = 300; } else if (strType == "cscript") { uint160 hash; ssKey >> hash; CScript script; ssValue >> script; if (!pwallet->LoadCScript(script)) { strErr = "Error reading wallet database: LoadCScript failed"; return false; } } else if (strType == "orderposnext") { ssValue >> pwallet->nOrderPosNext; } } catch (...) { return false; } return true; } static bool IsKeyType(string strType) { return (strType== "key" || strType == "wkey" || strType == "mkey" || strType == "ckey"); } DBErrors CWalletDB::LoadWallet(CWallet* pwallet) { pwallet->vchDefaultKey = CPubKey(); CWalletScanState wss; bool fNoncriticalErrors = false; DBErrors result = DB_LOAD_OK; try { LOCK(pwallet->cs_wallet); int nMinVersion = 0; if (Read((string)"minversion", nMinVersion)) { if (nMinVersion > CLIENT_VERSION) return DB_TOO_NEW; pwallet->LoadMinVersion(nMinVersion); } // Get cursor Dbc* pcursor = GetCursor(); if (!pcursor) { LogPrintf("Error getting wallet database cursor\n"); return DB_CORRUPT; } while (true) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); CDataStream ssValue(SER_DISK, CLIENT_VERSION); int ret = ReadAtCursor(pcursor, ssKey, ssValue); if (ret == DB_NOTFOUND) break; else if (ret != 0) { LogPrintf("Error reading next record from wallet database\n"); return DB_CORRUPT; } // Try to be tolerant of single corrupt records: string strType, strErr; if (!ReadKeyValue(pwallet, ssKey, ssValue, wss, strType, strErr)) { // losing keys is considered a catastrophic error, anything else // we assume the user can live with: if (IsKeyType(strType)) result = DB_CORRUPT; else { // Leave other errors alone, if we try to fix them we might make things worse. fNoncriticalErrors = true; // ... but do warn the user there is something wrong. if (strType == "tx") // Rescan if there is a bad transaction record: SoftSetBoolArg("-rescan", true); } } if (!strErr.empty()) LogPrintf("%s\n", strErr); } pcursor->close(); } catch (boost::thread_interrupted) { throw; } catch (...) { result = DB_CORRUPT; } if (fNoncriticalErrors && result == DB_LOAD_OK) result = DB_NONCRITICAL_ERROR; // Any wallet corruption at all: skip any rewriting or // upgrading, we don't want to make it worse. if (result != DB_LOAD_OK) return result; LogPrintf("nFileVersion = %d\n", wss.nFileVersion); LogPrintf("Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\n", wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys); // nTimeFirstKey is only reliable if all keys have metadata if ((wss.nKeys + wss.nCKeys) != wss.nKeyMeta) pwallet->nTimeFirstKey = 1; // 0 would be considered 'no value' BOOST_FOREACH(uint256 hash, wss.vWalletUpgrade) WriteTx(hash, pwallet->mapWallet[hash]); // Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc: if (wss.fIsEncrypted && (wss.nFileVersion == 40000 || wss.nFileVersion == 50000)) return DB_NEED_REWRITE; if (wss.nFileVersion < CLIENT_VERSION) // Update WriteVersion(CLIENT_VERSION); if (wss.fAnyUnordered) result = ReorderTransactions(pwallet); return result; } void ThreadFlushWalletDB(const string& strFile) { // Make this thread recognisable as the wallet flushing thread RenameThread("viral-wallet"); static bool fOneThread; if (fOneThread) return; fOneThread = true; if (!GetBoolArg("-flushwallet", true)) return; unsigned int nLastSeen = nWalletDBUpdated; unsigned int nLastFlushed = nWalletDBUpdated; int64_t nLastWalletUpdate = GetTime(); while (true) { MilliSleep(500); if (nLastSeen != nWalletDBUpdated) { nLastSeen = nWalletDBUpdated; nLastWalletUpdate = GetTime(); } if (nLastFlushed != nWalletDBUpdated && GetTime() - nLastWalletUpdate >= 2) { TRY_LOCK(bitdb.cs_db,lockDb); if (lockDb) { // Don't do this if any databases are in use int nRefCount = 0; map<string, int>::iterator mi = bitdb.mapFileUseCount.begin(); while (mi != bitdb.mapFileUseCount.end()) { nRefCount += (*mi).second; mi++; } if (nRefCount == 0) { boost::this_thread::interruption_point(); map<string, int>::iterator mi = bitdb.mapFileUseCount.find(strFile); if (mi != bitdb.mapFileUseCount.end()) { LogPrint("db", "Flushing wallet.dat\n"); nLastFlushed = nWalletDBUpdated; int64_t nStart = GetTimeMillis(); // Flush wallet.dat so it's self contained bitdb.CloseDb(strFile); bitdb.CheckpointLSN(strFile); bitdb.mapFileUseCount.erase(mi++); LogPrint("db", "Flushed wallet.dat %dms\n", GetTimeMillis() - nStart); } } } } } } bool BackupWallet(const CWallet& wallet, const string& strDest) { if (!wallet.fFileBacked) return false; while (true) { { LOCK(bitdb.cs_db); if (!bitdb.mapFileUseCount.count(wallet.strWalletFile) || bitdb.mapFileUseCount[wallet.strWalletFile] == 0) { // Flush log data to the dat file bitdb.CloseDb(wallet.strWalletFile); bitdb.CheckpointLSN(wallet.strWalletFile); bitdb.mapFileUseCount.erase(wallet.strWalletFile); // Copy wallet.dat filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; filesystem::path pathDest(strDest); if (filesystem::is_directory(pathDest)) pathDest /= wallet.strWalletFile; try { #if BOOST_VERSION >= 104000 filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists); #else filesystem::copy_file(pathSrc, pathDest); #endif LogPrintf("copied wallet.dat to %s\n", pathDest.string()); return true; } catch(const filesystem::filesystem_error &e) { LogPrintf("error copying wallet.dat to %s - %s\n", pathDest.string(), e.what()); return false; } } } MilliSleep(100); } return false; } // // Try to (very carefully!) recover wallet.dat if there is a problem. // bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) { // Recovery procedure: // move wallet.dat to wallet.timestamp.bak // Call Salvage with fAggressive=true to // get as much data as possible. // Rewrite salvaged data to wallet.dat // Set -rescan so any missing transactions will be // found. int64_t now = GetTime(); std::string newFilename = strprintf("wallet.%d.bak", now); int result = dbenv.dbenv.dbrename(NULL, filename.c_str(), NULL, newFilename.c_str(), DB_AUTO_COMMIT); if (result == 0) LogPrintf("Renamed %s to %s\n", filename, newFilename); else { LogPrintf("Failed to rename %s to %s\n", filename, newFilename); return false; } std::vector<CDBEnv::KeyValPair> salvagedData; bool allOK = dbenv.Salvage(newFilename, true, salvagedData); if (salvagedData.empty()) { LogPrintf("Salvage(aggressive) found no records in %s.\n", newFilename); return false; } LogPrintf("Salvage(aggressive) found %"PRIszu" records\n", salvagedData.size()); bool fSuccess = allOK; Db* pdbCopy = new Db(&dbenv.dbenv, 0); int ret = pdbCopy->open(NULL, // Txn pointer filename.c_str(), // Filename "main", // Logical db name DB_BTREE, // Database type DB_CREATE, // Flags 0); if (ret > 0) { LogPrintf("Cannot create database file %s\n", filename); return false; } CWallet dummyWallet; CWalletScanState wss; DbTxn* ptxn = dbenv.TxnBegin(); BOOST_FOREACH(CDBEnv::KeyValPair& row, salvagedData) { if (fOnlyKeys) { CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); string strType, strErr; bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue, wss, strType, strErr); if (!IsKeyType(strType)) continue; if (!fReadOK) { LogPrintf("WARNING: CWalletDB::Recover skipping %s: %s\n", strType, strErr); continue; } } Dbt datKey(&row.first[0], row.first.size()); Dbt datValue(&row.second[0], row.second.size()); int ret2 = pdbCopy->put(ptxn, &datKey, &datValue, DB_NOOVERWRITE); if (ret2 > 0) fSuccess = false; } ptxn->commit(0); pdbCopy->close(0); delete pdbCopy; return fSuccess; } bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename) { return CWalletDB::Recover(dbenv, filename, false); }
[ "info@covertress.com" ]
info@covertress.com
8fe7cfe2f71793b328a514d0d9c3af4cce95647d
77d1bd5ae4f8423bfea3119c3260b3b34de1f652
/tchart/volumeseries.cpp
34890fde638f93a5a47fdc9b068d1e36e2050bd5
[]
no_license
dlsyaim/sm-eye-app
c6b20303e10c8f42c12f64a767d77a2cbac9f8f3
3058da8998683c4453f1470a1f5e4c047ba837a1
refs/heads/master
2016-09-06T05:28:48.892101
2013-04-17T20:53:33
2013-04-17T20:53:33
37,705,615
0
0
null
null
null
null
UTF-8
C++
false
false
1,622
cpp
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++ // NOTE: Do not modify the contents of this file. If this class is regenerated by // Microsoft Visual C++, your modifications will be overwritten. #include "stdafx.h" #include "volumeseries.h" // Dispatch interfaces referenced by this interface #include "ValueList.h" #include "pen.h" ///////////////////////////////////////////////////////////////////////////// // CVolumeSeries properties ///////////////////////////////////////////////////////////////////////////// // CVolumeSeries operations CValueList CVolumeSeries::GetVolumeValues() { LPDISPATCH pDispatch; InvokeHelper(0x1e, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL); return CValueList(pDispatch); } CPen1 CVolumeSeries::GetLinePen() { LPDISPATCH pDispatch; InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&pDispatch, NULL); return CPen1(pDispatch); } BOOL CVolumeSeries::GetUseYOrigin() { BOOL result; InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_BOOL, (void*)&result, NULL); return result; } void CVolumeSeries::SetUseYOrigin(BOOL bNewValue) { static BYTE parms[] = VTS_BOOL; InvokeHelper(0x1, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, bNewValue); } double CVolumeSeries::GetYOrigin() { double result; InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_R8, (void*)&result, NULL); return result; } void CVolumeSeries::SetYOrigin(double newValue) { static BYTE parms[] = VTS_R8; InvokeHelper(0x2, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); }
[ "inbum.lee@gmail.com" ]
inbum.lee@gmail.com
6b296def2de34a58aa2ef7ffab35876518eee8dd
4fc9c3821b32b37c1c802c76b584255ae790a89b
/BOJ/1000/2000s/2525.cpp
237cfd0f8e627e707a378087adee934c272b7c72
[]
no_license
bww9641/Algorithm_Project
abfb4396f11affa4146d904ef7f15baef4c1a4b1
114b90b4caac7f802934e22b90afbeacf26c45ae
refs/heads/master
2022-12-22T15:33:40.607774
2020-09-17T01:30:20
2020-09-17T01:30:20
198,115,175
2
0
null
null
null
null
UTF-8
C++
false
false
262
cpp
#include<iostream> #define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr) using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; b+=c; if(b>=60) a+=b/60,b-=(b/60)*60; if(a>=24) a-=(a/24)*24; cout << a << " " << b; return 0; }
[ "bww9641@naver.com" ]
bww9641@naver.com
12d69f7c49d25ce68079bbd04fbf6cf0cc68bb40
e234b59b8addbad9d75b41d3dfa2511d290f70dd
/SDE Problems/Day15/Generate Parentheses.cpp
d5c360f89fbc756f002480e14ece23c0ad4159c1
[]
no_license
sahib-pratap-singh/Placement-Series
236545693d36c08d8cfb87f8f7c497823fb48bb8
f420f4de71c9ccd5a8ac931375659a3804876699
refs/heads/master
2023-05-28T17:02:01.445135
2021-06-15T16:05:18
2021-06-15T16:05:18
368,187,594
0
0
null
null
null
null
UTF-8
C++
false
false
661
cpp
class Solution { public: void paranthesis(int open, int close, string s, vector<string> &v){ if(open==0 and close==0){ v.push_back(s); return; } if(open!=0){ string op1=s; op1+="("; paranthesis(open-1,close,op1,v); } if(close>open){ string op2=s; op2+=")"; paranthesis(open,close-1,op2,v); } return; } vector<string> generateParenthesis(int n) { int open=n; int close=n; string s=""; vector<string> v; paranthesis(open,close,s,v); return v; } };
[ "sahibpratapsingh@gmail.com" ]
sahibpratapsingh@gmail.com
a04f2a07816ec14202bee10839e837193c7fff0f
9dd6859cb0d0f97034344793440c986f46e3a658
/engine/MapMatching4GMNS.cpp
ed07dc292e1d18b2acc9dd7b45fc604cf7c62202
[ "Apache-2.0" ]
permissive
xiaomo123zk/MapMatching4GMNS-0.2
6b3a11aa73e03f2c0a91abe099415c14f060af7f
d1b3ba29d9023c6e59fbaf712022f89f3e31e2b6
refs/heads/main
2023-07-20T00:07:26.727838
2021-08-24T02:43:04
2021-08-24T02:43:04
370,181,584
0
0
null
null
null
null
UTF-8
C++
false
false
113,587
cpp
// trace2route.cpp : This file contains the 'main' function. Program execution begins and ends there. // //Your code uses a function, class member, variable, or typedef that's marked deprecated. Symbols are deprecated by using a __declspec(deprecated) modifier, or the C++14 [[deprecated]] attribute. The actual C4996 warning message is specified //by the deprecated modifier or attribute of the declaration. //#include "MapMatching4GMNS.h" #pragma warning(disable : 4996) #include "MapMatching4GMNS.h" // #include "stdafx.h" //#ifdef _WIN32 //#include "pch.h" //#endif #include <algorithm> #include <fstream> #include <iostream> #include <list> #include <map> #include <sstream> #include <stdio.h> #include <string> #include <vector> //#include <omp.h> //#include <time.h> // #include "CSVParser.h" //#include <tchar.h> #include <ctime> //#include <math.h> #include <cmath> #include <cstring> using namespace std; #define MAX_LABEL_COST_ 999999 #define MAX_GRID_SIZE_ 1000 #define PI_ 3.1415 float g_NonHitDistanceRatio = 10; float g_GridResolution = 0.005; // in terms of long/lat float g_TimeResolution_inMin = 0.05; //min --> 3 seconds float g_SampleTimeResolution_inMin = 0.05; //min --> 3 seconds float g_StartTimeinMin = 999999; float g_EndTimeinMin = 0; int g_TimeRangeInterval = 10; int g_time_dependent_computing_mode = 1; int g_max_number_of_threads = 4; int g_number_of_nodes = 0; int g_number_of_links = 0; int g_number_of_agents = 0; int g_grid_size = 1; /* constexpr auto g_max_number_of_threads = 4; constexpr auto g_number_of_nodes = 0; constexpr auto g_number_of_links = 0; constexpr auto g_number_of_agents = 0; constexpr auto g_grid_size = 1; */ using std::ifstream; using std::istringstream; using std::map; using std::max; using std::min; using std::string; using std::vector; //std::map<int, int> g_internal_node_seq_no_map; //std::map<int, int> g_internal_link_no_map; //std::map<string, int> g_internal_agent_no_map; map<int, int> g_internal_node_seq_no_map; map<int, int> g_internal_link_no_map; map<string, int> g_internal_agent_no_map; // map<__int64, int> g_cell_id_2_zone_id_map; // cell 2 zone mapping map<long long, int> g_cell_id_2_zone_id_map; // cell 2 zone mapping template <typename T> #pragma warning(disable : 4244) // stop warning: "conversion from 'int' to 'float', possible loss of data" string NumberToString(T Number) { ostringstream ss; ss << Number; return ss.str(); } template <typename T> T StringToNumber(const string &Text) { istringstream ss(Text); T result; return ss >> result ? result : 0; } class CCSVParser { public: char Delimiter; bool IsFirstLineHeader; ifstream inFile; vector<string> LineFieldsValue; vector<string> Headers; map<string, int> FieldsIndices; vector<int> LineIntegerVector; public: void ConvertLineStringValueToIntegers() { LineIntegerVector.clear(); for (unsigned i = 0; i < LineFieldsValue.size(); i++) { std::string si = LineFieldsValue[i]; int value = atoi(si.c_str()); if (value >= 1) LineIntegerVector.push_back(value); } } vector<string> GetHeaderVector() { return Headers; } int m_EmptyLineCount; bool m_bDataHubSingleCSVFile; string m_DataHubSectionName; bool m_bLastSectionRead; bool m_bSkipFirstLine; // for DataHub CSV files CCSVParser(void) { Delimiter = ','; IsFirstLineHeader = true; m_bSkipFirstLine = false; m_bDataHubSingleCSVFile = false; m_bLastSectionRead = false; m_EmptyLineCount++; } ~CCSVParser(void) { if (inFile.is_open()) inFile.close(); } bool OpenCSVFile(string fileName, bool bIsFirstLineHeader) { inFile.clear(); inFile.open(fileName.c_str()); IsFirstLineHeader = bIsFirstLineHeader; if (inFile.is_open()) { if (m_bSkipFirstLine) { string s; std::getline(inFile, s); } if (IsFirstLineHeader) { string s; std::getline(inFile, s); if (s.length() == 0) return true; vector<string> FieldNames = ParseLine(s); for (size_t i = 0; i < FieldNames.size(); i++) { string tmp_str = FieldNames.at(i); size_t start = tmp_str.find_first_not_of(" "); string name; if (start == string::npos) { name = ""; } else { name = tmp_str.substr(start); //TRACE("%s,", name.c_str()); } Headers.push_back(name); FieldsIndices[name] = (int)i; } } return true; } else { return false; } } void CloseCSVFile(void) { inFile.close(); } bool ReadRecord() { LineFieldsValue.clear(); if (inFile.is_open()) { string s; std::getline(inFile, s); if (s.length() > 0) { LineFieldsValue = ParseLine(s); return true; } else { return false; } } else { return false; } } vector<string> ParseLine(string line) { vector<string> SeperatedStrings; string subStr; if (line.length() == 0) return SeperatedStrings; istringstream ss(line); if (line.find_first_of('"') == string::npos) { while (std::getline(ss, subStr, Delimiter)) { SeperatedStrings.push_back(subStr); } if (line.at(line.length() - 1) == ',') { SeperatedStrings.push_back(""); } } else { while (line.length() > 0) { size_t n1 = line.find_first_of(','); size_t n2 = line.find_first_of('"'); if (n1 == string::npos && n2 == string::npos) //last field without double quotes { subStr = line; SeperatedStrings.push_back(subStr); break; } if (n1 == string::npos && n2 != string::npos) //last field with double quotes { size_t n3 = line.find_first_of('"', n2 + 1); // second double quote //extract content from double quotes subStr = line.substr(n2 + 1, n3 - n2 - 1); SeperatedStrings.push_back(subStr); break; } if (n1 != string::npos && (n1 < n2 || n2 == string::npos)) { subStr = line.substr(0, n1); SeperatedStrings.push_back(subStr); if (n1 < line.length() - 1) { line = line.substr(n1 + 1); } else // comma is the last char in the line string, push an empty string to the back of vector { SeperatedStrings.push_back(""); break; } } if (n1 != string::npos && n2 != string::npos && n2 < n1) { size_t n3 = line.find_first_of('"', n2 + 1); // second double quote subStr = line.substr(n2 + 1, n3 - n2 - 1); SeperatedStrings.push_back(subStr); size_t idx = line.find_first_of(',', n3 + 1); if (idx != string::npos) { line = line.substr(idx + 1); } else { break; } } } } return SeperatedStrings; } template <class T> bool GetValueByFieldName(string field_name, T &value, bool NonnegativeFlag = true) { if (FieldsIndices.find(field_name) == FieldsIndices.end()) { return false; } else { if (LineFieldsValue.size() == 0) { return false; } int size = (int)(LineFieldsValue.size()); if (FieldsIndices[field_name] >= size) { return false; } string str_value = LineFieldsValue[FieldsIndices[field_name]]; if (str_value.length() <= 0) { return false; } istringstream ss(str_value); T converted_value; ss >> converted_value; if (/*!ss.eof() || */ ss.fail()) { return false; } //if (NonnegativeFlag && converted_value<0) // converted_value = 0; value = converted_value; return true; } } bool GetValueByFieldName(string field_name, string &value) { if (FieldsIndices.find(field_name) == FieldsIndices.end()) { return false; } else { if (LineFieldsValue.size() == 0) { return false; } unsigned int index = FieldsIndices[field_name]; if (index >= LineFieldsValue.size()) { return false; } string str_value = LineFieldsValue[index]; if (str_value.length() <= 0) { return false; } value = str_value; return true; } } template <class T> bool GetValueBySectionKeyFieldName(string file_name, string section_name, string key_name, string field_name, T &value) { OpenCSVFile(file_name, true); while (ReadRecord()) { if (LineFieldsValue[0] != section_name || LineFieldsValue[1] != key_name) continue; if (FieldsIndices.find(field_name) == FieldsIndices.end()) { CloseCSVFile(); return false; } else { if (LineFieldsValue.size() == 0) { CloseCSVFile(); return false; } int size = (int)(LineFieldsValue.size()); if (FieldsIndices[field_name] >= size) { CloseCSVFile(); return false; } string str_value = LineFieldsValue[FieldsIndices[field_name]]; if (str_value.length() <= 0) { CloseCSVFile(); return false; } istringstream ss(str_value); T converted_value; ss >> converted_value; if (/*!ss.eof() || */ ss.fail()) { CloseCSVFile(); return false; } value = converted_value; CloseCSVFile(); return true; } } CloseCSVFile(); return false; } }; template <typename T> T **Allocate2DDynamicArray(int nRows, int nCols) { T **dynamicArray; dynamicArray = new T *[nRows]; for (int i = 0; i < nRows; i++) { dynamicArray[i] = new T[nCols]; if (dynamicArray[i] == NULL) { cout << "Error: insufficent memory."; exit(0); } } return dynamicArray; } template <typename T> void Deallocate2DDynamicArray(T **dArray, int nRows) { for (int x = 0; x < nRows; x++) { delete[] dArray[x]; } delete[] dArray; } FILE *g_pFileLog = nullptr; extern void g_Program_stop(); extern void g_OutputInputAgentCSVFile(); void g_Program_stop() { cout << "Program stops. Press any key to terminate. Thanks!" << endl; getchar(); exit(0); }; // __int64 g_GetCellID(double x, double y) long long g_GetCellID(double x, double y) { // __int64 xi; long long xi; xi = floor(x / g_GridResolution); // __int64 yi; long long yi; yi = floor(y / g_GridResolution); return xi * 1000000 + yi; }; int g_GetCellXID(double x, double x_min) { int xi; xi = floor(x / g_GridResolution); int xmin; xmin = floor(x_min / g_GridResolution); return xi - xmin; }; int g_GetCellYID(double y, double y_min) { int yi; yi = floor(y / g_GridResolution); int ymin = floor(y_min / g_GridResolution); return yi - ymin; }; int g_GetTimeInterval(float time_in_min) { int time_interval = 0; time_interval = int((time_in_min - g_StartTimeinMin) / g_TimeResolution_inMin + 0.5); if (time_interval < 0) time_interval = 0; if (time_interval > g_TimeRangeInterval - 1) time_interval = g_TimeRangeInterval - 1; return time_interval; } float g_GetTimeInMinFromInterval(int time_interval) { float time_in_min = g_StartTimeinMin + time_interval * g_TimeResolution_inMin; return time_in_min; } double g_findMedian(vector<int> a, int n) { // source: https://www.geeksforgeeks.org/finding-median-of-unsorted-array-in-linear-time-using-c-stl/ // If size of the arr[] is even if (n % 2 == 0) { // Applying nth_element // on n/2th index nth_element(a.begin(), a.begin() + n / 2, a.end()); // Applying nth_element // on (n-1)/2 th index nth_element(a.begin(), a.begin() + (n - 1) / 2, a.end()); // Find the average of value at // index N/2 and (N-1)/2 return (double)(a[(n - 1) / 2] + a[n / 2]) / 2.0; } // If size of the arr[] is odd else { // Applying nth_element // on n/2 nth_element(a.begin(), a.begin() + n / 2, a.end()); // Value at index (N/2)th // is the median return (double)a[n / 2]; } } struct GDPoint //geometry data { double x; double y; }; typedef struct { double X, Y, Z; } CCoordinate; double g_Find_P2P_Angle(const GDPoint *p1, const GDPoint *p2) { double delta_x = p2->x - p1->x; double delta_y = p2->y - p1->y; if (fabs(delta_x) < 0.00001) delta_x = 0; if (fabs(delta_y) < 0.00001) delta_y = 0; int angle = atan2(delta_y, delta_x) * 180 / PI_ + 0.5; // angle = 90 - angle; while (angle < 0) angle += 360; while (angle > 360) angle -= 360; return angle; } double g_Find_PPP_RelativeAngle(const GDPoint *p1, const GDPoint *p2, const GDPoint *p3, const GDPoint *p4) { int relative_angle; int angle1 = g_Find_P2P_Angle(p1, p2); int angle2 = g_Find_P2P_Angle(p3, p4); relative_angle = angle2 - angle1; while (relative_angle > 180) relative_angle -= 360; while (relative_angle < -180) relative_angle += 360; return relative_angle; } class CGeometry { public: enum GeometryType { POINT, LINE, POLYGON, UNKNOWN }; private: GeometryType m_Type; int m_NumOfCoordinates; std::vector<CCoordinate> v_Coordinates; bool ReadPointCoordinate(string s); bool ReadLineStringCoordinates(string s); bool ReadPolygonCoordinates(string s); public: CGeometry(string s); //~CGeometry(void); ~CGeometry(); //GeometryType GetGeometryType(void); //std::vector<CCoordinate> GetCoordinateList(void); //int GetNumberOfCoordinates(void); GeometryType GetGeometryType(); std::vector<CCoordinate> GetCoordinateList(); int GetNumberOfCoordinates(); }; CGeometry::CGeometry(string s) { m_NumOfCoordinates = 0; string tmp; if (s.find("POINT") != std::string::npos) { tmp = s.substr(s.find_first_not_of(' ')); size_t start_idx = tmp.find_first_of('('); size_t end_idx = tmp.find_first_of(')'); if (start_idx == std::string::npos || end_idx == std::string::npos) return; string type_str = tmp.substr(0, start_idx); type_str.erase(type_str.find_last_not_of(" ") + 1); // works for 'LINESTRING (....' and 'LINESTRING(....' string start_tag = "("; string end_tag = ")"; start_idx = tmp.find(start_tag); start_idx += start_tag.length(); end_idx = tmp.find(end_tag); tmp = tmp.substr(start_idx, end_idx - start_idx); m_Type = POINT; } else if (s.find("LINESTRING") != std::string::npos) { tmp = s.substr(s.find_first_not_of(' ')); size_t start_idx = tmp.find_first_of('('); size_t end_idx = tmp.find_first_of(')'); if (start_idx == std::string::npos || end_idx == std::string::npos) return; string type_str = tmp.substr(0, start_idx); type_str.erase(type_str.find_last_not_of(" ") + 1); // works for 'LINESTRING (....' and 'LINESTRING(....' string start_tag = "("; string end_tag = ")"; start_idx = tmp.find(start_tag); start_idx += start_tag.length(); end_idx = tmp.find(end_tag); tmp = tmp.substr(start_idx, end_idx - start_idx); m_Type = LINE; } else if (s.find("POLYGON") != std::string::npos) { tmp = s.substr(s.find_first_not_of(' ')); size_t start_idx = tmp.find("(("); size_t end_idx = tmp.find("))"); if (start_idx == std::string::npos || end_idx == std::string::npos) return; string type_str = tmp.substr(0, start_idx); type_str.erase(type_str.find_last_not_of(" ") + 1); // works for 'LINESTRING (....' and 'LINESTRING(....' string start_tag = "(("; string end_tag = "))"; start_idx = tmp.find(start_tag); start_idx += start_tag.length(); end_idx = tmp.find(end_tag); tmp = tmp.substr(start_idx, end_idx - start_idx); m_Type = POLYGON; } else { m_Type = UNKNOWN; } switch (m_Type) { case POINT: ReadPointCoordinate(tmp); break; case LINE: ReadLineStringCoordinates(tmp); break; case POLYGON: ReadPolygonCoordinates(tmp); break; default: break; } } CGeometry::~CGeometry(void) { } CGeometry::GeometryType CGeometry::GetGeometryType(void) { return m_Type; } int CGeometry::GetNumberOfCoordinates(void) { return m_NumOfCoordinates; } std::vector<CCoordinate> CGeometry::GetCoordinateList(void) { return v_Coordinates; } bool CGeometry::ReadLineStringCoordinates(string s) { istringstream ss(s); string sub_str; if (std::string::npos == s.find_first_of("0123456789")) { // "digit not found!, empty string// return false; } while (std::getline(ss, sub_str, ',')) { sub_str = sub_str.substr(sub_str.find_first_not_of(' ')); CCoordinate coordinate; istringstream sub_ss(sub_str); string tmp; std::getline(sub_ss, tmp, ' '); istringstream x_ss(tmp); x_ss >> coordinate.X; std::getline(sub_ss, tmp, ' '); istringstream y_ss(tmp); y_ss >> coordinate.Y; v_Coordinates.push_back(coordinate); m_NumOfCoordinates += 1; } return true; } bool CGeometry::ReadPolygonCoordinates(string s) { istringstream ss(s); string sub_str; if (std::string::npos == s.find_first_of("0123456789")) { // "digit not found!, empty string// return false; } while (std::getline(ss, sub_str, ',')) { sub_str = sub_str.substr(sub_str.find_first_not_of(' ')); CCoordinate coordinate; istringstream sub_ss(sub_str); string tmp; std::getline(sub_ss, tmp, ' '); istringstream x_ss(tmp); x_ss >> coordinate.X; std::getline(sub_ss, tmp, ' '); istringstream y_ss(tmp); y_ss >> coordinate.Y; v_Coordinates.push_back(coordinate); m_NumOfCoordinates += 1; } return true; } bool CGeometry::ReadPointCoordinate(string s) { CCoordinate coordinate; istringstream ss(s); string sub_str; std::getline(ss, sub_str, ' '); istringstream x_ss(sub_str); std::getline(ss, sub_str, ' '); istringstream y_ss(sub_str); x_ss >> coordinate.X; y_ss >> coordinate.Y; coordinate.Z = 0.0; v_Coordinates.push_back(coordinate); m_NumOfCoordinates = 1; return true; } int g_ParserIntSequence(std::string str, std::vector<int> &vect) { std::stringstream ss(str); int i; while (ss >> i) { vect.push_back(i); if (ss.peek() == ';') ss.ignore(); } return vect.size(); } class CNode { public: CNode() { bInsideFlag = false; } bool bInsideFlag; int node_seq_no; // sequence number int node_id; //external node number int zone_id; // __int64 cell_id; long long cell_id; string name; std::vector<int> m_outgoing_link_seq_no_vector; std::map<int, int> m_outgoing_link_seq_no_map; GDPoint pt; }; class CLink { public: CLink() { bInsideFlag = false; length = 1; FFTT_in_min = 0; FFTT_in_sec = 0; free_speed; x_key = 0; y_key = 0; hit_count = 0; likelihood_distance = 999999; o_distance = 999999; d_distance = 999999; AccessibilityTime = 999999; use_count = 0; balance = 0; Possible_Dwell_time_in_min = 0; dwell_start_time_in_min = 0; } int link_id; // __int64 cell_id; long long cell_id; string name; string geometry; std::vector<GDPoint> m_PointVector; int from_node_id; int to_node_id; double length; double free_speed; double FFTT_in_min; double Possible_Dwell_time_in_min; int dwell_start_time_in_min; int FFTT_in_sec; int x_key; int y_key; int link_seq_no; int from_node_seq_no; int to_node_seq_no; double likelihood_distance; double o_distance; double d_distance; double link_distance; double seg_distance; int hit_count; int use_count; double balance; bool bInsideFlag; int AccessibilityTime; }; std::vector<CNode> g_node_vector; std::vector<CLink> g_link_vector; double g_GetPoint2Point_Distance(const GDPoint *p1, const GDPoint *p2) { return pow(((p1->x - p2->x) * (p1->x - p2->x) + (p1->y - p2->y) * (p1->y - p2->y)), 0.5); } double g_GetPoint2LineDistance(const GDPoint *pt, const GDPoint *FromPt, const GDPoint *ToPt, double UnitGridResolution, bool no_intersection_requirement) { double U; GDPoint Intersection; double LineLength = g_GetPoint2Point_Distance(FromPt, ToPt); U = ((pt->x - ToPt->x) * (FromPt->x - ToPt->x) + (pt->y - ToPt->y) * (FromPt->y - ToPt->y)) / (LineLength * LineLength); if (no_intersection_requirement == false) { if (U < 0.0 || U > 1.0) return g_GridResolution; // intersection does not fall within the segment } Intersection.x = ToPt->x + U * (FromPt->x - ToPt->x); Intersection.y = ToPt->y + U * (FromPt->y - ToPt->y); double distance_1 = g_GetPoint2Point_Distance(pt, &Intersection); double distance_0 = g_GetPoint2Point_Distance(pt, FromPt); double distance_2 = g_GetPoint2Point_Distance(pt, ToPt); if (no_intersection_requirement) { return min(min(distance_1, distance_0), distance_2); } else return distance_1; } bool g_GetPoint2LineIntersectionFlag(const GDPoint *pt, const GDPoint *FromPt, const GDPoint *ToPt) { double U; GDPoint Intersection; double LineLength = g_GetPoint2Point_Distance(FromPt, ToPt); U = ((pt->x - ToPt->x) * (FromPt->x - ToPt->x) + (pt->y - ToPt->y) * (FromPt->y - ToPt->y)) / (LineLength * LineLength); if (U < 0.0 || U > 1.0) return false; Intersection.x = ToPt->x + U * (FromPt->x - ToPt->x); Intersection.y = ToPt->y + U * (FromPt->y - ToPt->y); double distance_1 = g_GetPoint2Point_Distance(pt, &Intersection); double distance_0 = g_GetPoint2Point_Distance(pt, FromPt); double distance_2 = g_GetPoint2Point_Distance(pt, ToPt); if (distance_1 < 0.5 * distance_0 & distance_1 < 0.5 * distance_2 && distance_1 < 0.3 * LineLength) return true; else return false; } bool g_GetTwoPoints2LineIntersectionFlag(const GDPoint *pt0, const GDPoint *pt1, const GDPoint *FromPt, const GDPoint *ToPt) { double U; GDPoint Intersection; GDPoint pt; pt.x = (pt0->x + pt1->x) / 2; pt.y = (pt0->y + pt1->y) / 2; double LineLength = g_GetPoint2Point_Distance(FromPt, ToPt); U = ((pt.x - ToPt->x) * (FromPt->x - ToPt->x) + (pt.y - ToPt->y) * (FromPt->y - ToPt->y)) / (LineLength * LineLength); if (U < -0.3 || U > 1.3) // larger range return false; Intersection.x = ToPt->x + U * (FromPt->x - ToPt->x); Intersection.y = ToPt->y + U * (FromPt->y - ToPt->y); double distance_1 = g_GetPoint2Point_Distance(&pt, &Intersection); double distance_0 = g_GetPoint2Point_Distance(&pt, FromPt); double distance_2 = g_GetPoint2Point_Distance(&pt, ToPt); double relative_angle = fabs(g_Find_PPP_RelativeAngle(pt0, pt1, FromPt, ToPt)); if (relative_angle > 45) return false; if (distance_1 < 1 * distance_0 & distance_1 < 1 * distance_2 && distance_1 < 1 * LineLength) // if (distance_1 < 0.5 * distance_0 & distance_1 < 0.5 * distance_2 && distance_1 < 0.3 * LineLength) return true; else return false; } //ill conditioning detection bool g_ill_conditioning_detection(double link_distance, double GPS_segment_distance) { double cutoff_ratio = 3; double ratio = link_distance / max(0.00000001, GPS_segment_distance); if ((1.0 / cutoff_ratio) < ratio && ratio < cutoff_ratio) return false; //this indicates: good_conditioning, so ill_conditioning = false else return true; } class CGPSPoint { public: CGPSPoint() { bInsideGrid = false; Inside_index = -1; trace_id = -1; interval_in_second = 0; relative_time_in_second = 0; } public: GDPoint pt; // __int64 cell_id; long long cell_id; int trace_id; //double time_interval_no; int dd; int global_time_in_second; int relative_time_in_second; float distance; float speed; int interval_in_second; bool bInsideGrid; int Inside_index; }; class GridNodeSet { public: double x; double y; // __int64 cell_id; long long cell_id; std::vector<int> m_NodeVector; std::vector<int> m_LinkNoVector; std::vector<CGPSPoint> m_GPSPointVector; int origin_cell_flag; int destination_cell_flag; int possible_dwell_cell_flag; float start_min; float end_min; float dwell_time_min; }; class CAgent { public: CAgent() { matching_link_no = -1; avg_GPS_segment_distance = 0; first_segment_distance = 0; last_segment_distance = 0; head_gps_index = -1; tail_gps_index = -1; o_cell_id = -1; d_cell_id = -1; origin_zone_id = -1; destination_zone_id = -1; distance = 0; travel_time = 0; sampling_rate_in_min = 0.5; } ~CAgent() { } int head_gps_index; int tail_gps_index; string agent_id; float volume; float distance; float travel_time; int agent_no; int o_node_id; int d_node_id; int matching_link_no; int origin_node_seq_no; int destination_node_seq_no; int origin_zone_id; int destination_zone_id; // __int64 o_cell_id; // __int64 d_cell_id; long long o_cell_id; long long d_cell_id; float start_time_in_min; float end_time_in_min; float duration_in_min; float sampling_rate_in_min; std::vector<CGPSPoint> m_GPSPointVector; std::map<int, int> m_ExcessiveDwellMap; // time interval seq. no, time interval double avg_GPS_segment_distance; double first_segment_distance; double last_segment_distance; int upstream_node_matched_time_in_sec; int m_node_size; std::vector<int> path_link_vector, path_node_vector, path_time_vector; std::vector<float> path_cost_vector; int *path_link_matched_trace_id; // for each link void AllocatePathNodeVector(int node_size, const int *node_vector, bool backwardflag = false) { m_node_size = node_size; if (backwardflag) { //copy backward for (int i = 0; i < m_node_size; ++i) { path_node_vector.push_back(node_vector[m_node_size - 1 - i]); } } } void AllocatePathNodeVector(int node_size, std::vector<int> node_vector, std::vector<int> time_index_vector, std::vector<float> cost_vector, std::vector<int> link_vector) { m_node_size = node_size; path_link_vector.clear(); path_time_vector.clear(); path_cost_vector.clear(); path_node_vector.clear(); //copy backward path_node_vector = node_vector; path_time_vector = time_index_vector; path_cost_vector = cost_vector; path_link_vector = link_vector; std::reverse(path_node_vector.begin(), path_node_vector.end()); std::reverse(path_time_vector.begin(), path_time_vector.end()); std::reverse(path_cost_vector.begin(), path_cost_vector.end()); std::reverse(path_link_vector.begin(), path_link_vector.end()); } GDPoint m_o_boundary_point[2]; // from point and to point GDPoint m_d_boundary_point[2]; }; vector<CAgent> g_agent_vector; class NetworkForSP // mainly for shortest path calculation { public: NetworkForSP() { } GridNodeSet **m_GridMatrix; //important data structure for creating grid matrix double m_left; // boundary of grid matrix double m_right; double m_top; double m_bottom; double m_GridXStep; // x resolution of grid cell double m_GridYStep; void BuildGridSystem() { m_GridMatrix = Allocate2DDynamicArray<GridNodeSet>(MAX_GRID_SIZE_, MAX_GRID_SIZE_); // initialization of grid rectangle boundary m_left = 100000000; m_right = -100000000; m_top = -1000000000; m_bottom = 1000000000; // exapnd the grid boundary according to the nodes for (int i = 0; i < g_node_vector.size(); i++) { m_left = min(m_left, g_node_vector[i].pt.x); m_right = max(m_right, g_node_vector[i].pt.x); m_top = max(m_top, g_node_vector[i].pt.y); m_bottom = min(m_bottom, g_node_vector[i].pt.y); } m_GridXStep = g_GridResolution; m_GridYStep = g_GridResolution; g_grid_size = max((m_right - m_left) / g_GridResolution + 2, (m_top - m_bottom) / g_GridResolution + 2); //ASSERT(g_grid_size < MAX_GRID_SIZE_); cout << "g_GridResolution= " << g_GridResolution << ", grid size = " << g_grid_size << endl; // put nodes into grid cell for (int i = 0; i < g_node_vector.size(); i++) { int x_key = g_GetCellXID(g_node_vector[i].pt.x, m_left); int y_key = g_GetCellYID(g_node_vector[i].pt.y, m_bottom); m_GridMatrix[x_key][y_key].m_NodeVector.push_back(i); } // put links into grid cell for (int l = 0; l < g_link_vector.size(); l++) { int x_key = g_GetCellXID(g_node_vector[g_link_vector[l].from_node_seq_no].pt.x, m_left); int y_key = g_GetCellYID(g_node_vector[g_link_vector[l].from_node_seq_no].pt.y, m_bottom); m_GridMatrix[x_key][y_key].m_LinkNoVector.push_back(l); g_link_vector[l].cell_id = g_GetCellID(g_node_vector[g_link_vector[l].from_node_seq_no].pt.x, g_node_vector[g_link_vector[l].from_node_seq_no].pt.y); int from_x_key = x_key; int from_y_key = y_key; x_key = g_GetCellXID(g_node_vector[g_link_vector[l].to_node_seq_no].pt.x, m_left); y_key = g_GetCellYID(g_node_vector[g_link_vector[l].to_node_seq_no].pt.y, m_bottom); g_link_vector[l].x_key = x_key; g_link_vector[l].y_key = y_key; if (from_x_key != x_key || from_y_key != y_key) // when the from node and to node of a link belong to different cells. { m_GridMatrix[x_key][y_key].m_LinkNoVector.push_back(l); } /// put this link to the next cells. } } void IdentifyGPSODPoints(int agent_no) { // first step, determine the inside flag // default settings if all GPS points inside g_agent_vector[agent_no].head_gps_index = -1; g_agent_vector[agent_no].tail_gps_index = g_agent_vector[agent_no].m_GPSPointVector.size() - 1; int g_Inside_index = -1; for (int g = 0; g < g_agent_vector[agent_no].m_GPSPointVector.size(); g++) // for each GPS point { // x_key and y_key are relative index of grid int x_key = g_GetCellXID(g_agent_vector[agent_no].m_GPSPointVector[g].pt.x, m_left); int y_key = g_GetCellYID(g_agent_vector[agent_no].m_GPSPointVector[g].pt.y, m_bottom); //__int64 long long cell_id = g_GetCellID(g_agent_vector[agent_no].m_GPSPointVector[g].pt.x, g_agent_vector[agent_no].m_GPSPointVector[g].pt.y); fprintf(g_pFileLog, "trace index %d, trace id: %d, cell %d, %d, %jd \n", g, g_agent_vector[agent_no].m_GPSPointVector[g].trace_id, x_key, y_key); m_GridMatrix[x_key][y_key].m_GPSPointVector.push_back(g_agent_vector[agent_no].m_GPSPointVector[g]); m_GridMatrix[x_key][y_key].cell_id = cell_id; if (g_agent_vector[agent_no].m_GPSPointVector[g].global_time_in_second / 60 > m_GridMatrix[x_key][y_key].end_min) m_GridMatrix[x_key][y_key].end_min = g_agent_vector[agent_no].m_GPSPointVector[g].global_time_in_second / 60; if (g_agent_vector[agent_no].m_GPSPointVector[g].global_time_in_second / 60 < m_GridMatrix[x_key][y_key].start_min) m_GridMatrix[x_key][y_key].start_min = g_agent_vector[agent_no].m_GPSPointVector[g].global_time_in_second / 60; if (g_cell_id_2_zone_id_map.find(cell_id) == g_cell_id_2_zone_id_map.end()) // the subarea network not defined yet continue; if (g_agent_vector[agent_no].head_gps_index == -1) g_agent_vector[agent_no].head_gps_index = g; g_agent_vector[agent_no].tail_gps_index = g; } if (g_agent_vector[agent_no].m_GPSPointVector.size() == 0) return; // second step for origin GPS index int g = g_agent_vector[agent_no].head_gps_index; g_agent_vector[agent_no].m_o_boundary_point[0] = g_agent_vector[agent_no].m_GPSPointVector[g].pt; // setup the default first and second origin GPS points from the head GPS point g_agent_vector[agent_no].m_o_boundary_point[1] = g_agent_vector[agent_no].m_GPSPointVector[g].pt; if (g + 1 < g_agent_vector[agent_no].m_GPSPointVector.size()) { g_agent_vector[agent_no].m_o_boundary_point[1] = g_agent_vector[agent_no].m_GPSPointVector[g + 1].pt; // second to last GPS point } // third step for destination GPS index g = g_agent_vector[agent_no].tail_gps_index; g_agent_vector[agent_no].m_d_boundary_point[0] = g_agent_vector[agent_no].m_GPSPointVector[g].pt; // setup the default last and second-to-last destination GPS points from the head GPS point g_agent_vector[agent_no].m_d_boundary_point[1] = g_agent_vector[agent_no].m_GPSPointVector[g].pt; if (g - 1 >= 0) { g_agent_vector[agent_no].m_d_boundary_point[0] = g_agent_vector[agent_no].m_GPSPointVector[g - 1].pt; // second to last GPS point } } void IdentifyNetworkONode(int agent_no) { double min_distance_to_boundary_point = MAX_LABEL_COST_; for (int l = 0; l < g_link_vector.size(); l++) // for all links in this cell { double distance = MAX_LABEL_COST_; //TRACE("%d->%d\n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id); //if (g_link_vector[l].from_node_id == 402 && g_link_vector[l].to_node_id == 131) // TRACE("%d->%d\n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id); //if (g_link_vector[l].from_node_id == 433 && g_link_vector[l].to_node_id == 341) // TRACE("%d->%d\n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id); //ill conditioning detection double p2l_distance = 999; if (g_ill_conditioning_detection(g_link_vector[l].link_distance, g_agent_vector[agent_no].first_segment_distance) == false) { // case of good conditioning double distance_from = g_GetPoint2LineDistance(&g_agent_vector[agent_no].m_o_boundary_point[0], &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt, 1, false); double distance_to = 0; if (g_agent_vector[agent_no].m_GPSPointVector.size() >= 2) { distance_to = g_GetPoint2LineDistance(&g_agent_vector[agent_no].m_o_boundary_point[1], &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt, 1, false); } p2l_distance = (distance_from + distance_to) / 2; double distance_from_p2p = 0; double distance_to_p2p = 0; distance_from_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_o_boundary_point[0], &g_node_vector[g_link_vector[l].from_node_seq_no].pt); distance_to_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_o_boundary_point[1], &g_node_vector[g_link_vector[l].to_node_seq_no].pt); distance = (distance_from + distance_to + distance_from_p2p + distance_to_p2p) / 4; } else { //case of ill conditioning, we have no help, we can only take the minimum of point to point distance double distance_from_p2p = 0; double distance_to_p2p = 0; distance_from_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_o_boundary_point[0], &g_node_vector[g_link_vector[l].from_node_seq_no].pt); distance_to_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_o_boundary_point[1], &g_node_vector[g_link_vector[l].to_node_seq_no].pt); distance = min(distance_from_p2p, distance_to_p2p); // consider the minimal distance of any point, and avg distance of cross-section distance } // we check this relative angle condition for both ill and good conditions, double relative_angle = fabs(g_Find_PPP_RelativeAngle( &g_agent_vector[agent_no].m_o_boundary_point[0], &g_agent_vector[agent_no].m_o_boundary_point[1], &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt)); if (relative_angle > 45) { // add penalty for opposite direction distance = distance * 10; /// 10 times as panalty } int i_trace = 0; if (distance < g_link_vector[l].o_distance) g_link_vector[l].o_distance = distance; if (distance < min_distance_to_boundary_point) { min_distance_to_boundary_point = distance; g_link_vector[l].o_distance = distance; origin_node_no = g_link_vector[l].from_node_seq_no; fprintf(g_pFileLog, "finding origin_node: %d -> %d, %f \n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id, distance); g_agent_vector[agent_no].matching_link_no = l; // g_agent_vector[agent_no].upstream_node_matched_time_in_sec = t; } } } void IdentifyNetworkDNode(int agent_no) { double min_distance_to_boundary_point = MAX_LABEL_COST_; for (int l = 0; l < g_link_vector.size(); l++) // for all links in this cell { //TRACE("%d->%d\n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id); double distance = MAX_LABEL_COST_; if (g_ill_conditioning_detection(g_link_vector[l].link_distance, g_agent_vector[agent_no].last_segment_distance) == false) { // case of good conditioning double distance_from = g_GetPoint2LineDistance(&g_agent_vector[agent_no].m_d_boundary_point[0], &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt, 1, false); double distance_to = 0; distance_to = g_GetPoint2LineDistance(&g_agent_vector[agent_no].m_d_boundary_point[1], &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt, 1, false); //ill conditioning detection double distance_from_p2p = 0; double distance_to_p2p = 0; distance_from_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_d_boundary_point[0], &g_node_vector[g_link_vector[l].from_node_seq_no].pt); distance_to_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_d_boundary_point[1], &g_node_vector[g_link_vector[l].to_node_seq_no].pt); distance = (distance_from + distance_to + distance_from_p2p + distance_to_p2p) / 4; } else { // case of ill conditionning double distance_from_p2p = 0; double distance_to_p2p = 0; distance_from_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_d_boundary_point[0], &g_node_vector[g_link_vector[l].from_node_seq_no].pt); //[1] ending point of GPS point segment distance_to_p2p = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_d_boundary_point[1], &g_node_vector[g_link_vector[l].to_node_seq_no].pt); distance = min(distance_from_p2p, distance_to_p2p); } // we check this relative angle condition for both ill and good conditions, double relative_angle = fabs(g_Find_PPP_RelativeAngle( &g_agent_vector[agent_no].m_d_boundary_point[0], &g_agent_vector[agent_no].m_d_boundary_point[1], &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt)); if (relative_angle > 45) { // add penalty for opposite direction distance = distance * 10; /// 10 times as panalty } if (distance < g_link_vector[l].d_distance) g_link_vector[l].d_distance = distance; if (distance < min_distance_to_boundary_point) { min_distance_to_boundary_point = distance; destination_node_no = g_link_vector[l].to_node_seq_no; fprintf(g_pFileLog, "finding destination_node: %d -> %d, %f \n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id, distance); //TRACE("%d -> %d, %f \n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id, distance); } } } bool AddGPSPointsIntoGridSystem(int agent_no) { // for every agent for (int x_i = 0; x_i <= g_grid_size; x_i++) for (int y_i = 0; y_i <= g_grid_size; y_i++) { m_GridMatrix[x_i][y_i].possible_dwell_cell_flag = 0; m_GridMatrix[x_i][y_i].dwell_time_min = 0; m_GridMatrix[x_i][y_i].end_min = 0; m_GridMatrix[x_i][y_i].start_min = 9999999; m_GridMatrix[x_i][y_i].m_GPSPointVector.clear(); //reset the existing GPS point records in this grid } for (int i = 0; i < g_link_vector.size(); i++) // reset the cost for all links { m_link_generalised_cost_array[i] = MAX_LABEL_COST_ / 1000; // feasible range g_link_vector[i].bInsideFlag = false; g_link_vector[i].hit_count = 0; for (int t = 0; t < g_TimeRangeInterval; t++) { m_TD_link_generalised_cost_array[i][t] = MAX_LABEL_COST_ / 1000; // feasible range m_TD_link_GPS_point_array[i][t] = -1; m_TD_link_GPS_hit_array[i][t] = -1; } } // put GPS points into grid cell IdentifyGPSODPoints(agent_no); // calculate avg distance double total_GPS_distance = 0; int g; if (g_agent_vector[agent_no].m_GPSPointVector.size() >= 2) { std::vector<int> time_interval_vector; // find median for (g = 1; g < g_agent_vector[agent_no].m_GPSPointVector.size(); g++) // for each GPS point { g_agent_vector[agent_no].m_GPSPointVector[g].interval_in_second = g_agent_vector[agent_no].m_GPSPointVector[g].global_time_in_second - g_agent_vector[agent_no].m_GPSPointVector[g - 1].global_time_in_second; g_agent_vector[agent_no].m_GPSPointVector[g].relative_time_in_second = g_agent_vector[agent_no].m_GPSPointVector[g].global_time_in_second - (int)(g_agent_vector[agent_no].start_time_in_min * 60 + 0.5); g_agent_vector[agent_no].m_GPSPointVector[g].distance = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_GPSPointVector[g].pt, &g_agent_vector[agent_no].m_GPSPointVector[g - 1].pt); time_interval_vector.push_back(g_agent_vector[agent_no].m_GPSPointVector[g].interval_in_second); } if (time_interval_vector.size() >= 4) g_agent_vector[agent_no].sampling_rate_in_min = g_findMedian(time_interval_vector, time_interval_vector.size()) / 60.0; else g_agent_vector[agent_no].sampling_rate_in_min = g_SampleTimeResolution_inMin; // find excessive dwell time // find median float ratio_excessive = 5; for (g = 1; g < g_agent_vector[agent_no].m_GPSPointVector.size(); g++) // for each GPS point { if (g_agent_vector[agent_no].m_GPSPointVector[g].interval_in_second > g_agent_vector[agent_no].sampling_rate_in_min * 60 * ratio_excessive) { float time_stamp_in_min = g_agent_vector[agent_no].m_GPSPointVector[g - 1].global_time_in_second / 60.0; // previous GPS point int timestamp_in_interval = g_GetTimeInterval(time_stamp_in_min); int dwell_time_interval = g_agent_vector[agent_no].m_GPSPointVector[g].interval_in_second / 60.0 / g_TimeResolution_inMin; g_agent_vector[agent_no].m_ExcessiveDwellMap[timestamp_in_interval] = dwell_time_interval; } } for (g = 0; g < g_agent_vector[agent_no].m_GPSPointVector.size() - 1; g++) // for each GPS point { double segment_distance; segment_distance = g_GetPoint2Point_Distance(&g_agent_vector[agent_no].m_GPSPointVector[g].pt, &g_agent_vector[agent_no].m_GPSPointVector[g + 1].pt); total_GPS_distance += segment_distance; if (g == 0) { g_agent_vector[agent_no].first_segment_distance = segment_distance; } if (g == g_agent_vector[agent_no].m_GPSPointVector.size() - 2) { g_agent_vector[agent_no].last_segment_distance = segment_distance; } } } double m_GPSPointVector_size_temp = g_agent_vector[agent_no].m_GPSPointVector.size() - 1; if (m_GPSPointVector_size_temp < 1) m_GPSPointVector_size_temp = 1; g_agent_vector[agent_no].avg_GPS_segment_distance = total_GPS_distance / m_GPSPointVector_size_temp; IdentifyNetworkONode(agent_no); IdentifyNetworkDNode(agent_no); // fourth step // for each grid matrix cell //scan x and y index in the grid // m_link_generalised_cost_array is the link cost used in shortest path for (int x_i = 0; x_i <= g_grid_size; x_i++) for (int y_i = 0; y_i <= g_grid_size; y_i++) { if (m_GridMatrix[x_i][y_i].m_GPSPointVector.size() > 0) { if (m_GridMatrix[x_i][y_i].end_min - m_GridMatrix[x_i][y_i].start_min > 120) // 2 hours { m_GridMatrix[x_i][y_i].possible_dwell_cell_flag = 1; m_GridMatrix[x_i][y_i].dwell_time_min = m_GridMatrix[x_i][y_i].end_min - m_GridMatrix[x_i][y_i].start_min; } } } FILE *g_pFileGrid = nullptr; g_pFileGrid = fopen("grid.csv", "w"); if (g_pFileGrid == NULL) { cout << "File grid.csv cannot be opened." << endl; g_Program_stop(); } else { fprintf(g_pFileGrid, "cell_id,x_index,y_index,origin_flag,destination_flag,dwell_flag,x_coord,y_coord,geometry,\n"); //hhmmss,trace_id,travel_time,delay,geometry for (int x_i = 0; x_i <= g_grid_size; x_i++) for (int y_i = 0; y_i <= g_grid_size; y_i++) { if (m_GridMatrix[x_i][y_i].m_GPSPointVector.size() > 0) { int left_int = floor(m_left / g_GridResolution); int bottom_int = floor(m_bottom / g_GridResolution); double x_coord_left = (left_int * g_GridResolution) + x_i * g_GridResolution; double y_coord_bottom = (bottom_int * g_GridResolution) + y_i * g_GridResolution; double x_coord_right = x_coord_left + g_GridResolution; double y_coord_top = y_coord_bottom + g_GridResolution; int origin_cell_flag = m_GridMatrix[x_i][y_i].origin_cell_flag; int destination_cell_flag = m_GridMatrix[x_i][y_i].destination_cell_flag; int possible_dwell_flag = m_GridMatrix[x_i][y_i].possible_dwell_cell_flag; fprintf(g_pFileGrid, "%jd,%d,%d,%d,%d,%d,", m_GridMatrix[x_i][y_i].cell_id, x_i, y_i, origin_cell_flag, destination_cell_flag, possible_dwell_flag); //hhmmss,trace_id,travel_time,delay,geometry fprintf(g_pFileGrid, "%f,%f,", x_coord_left, y_coord_top); fprintf(g_pFileGrid, "\"LINESTRING ("); fprintf(g_pFileGrid, "%f %f,", x_coord_left, y_coord_top); fprintf(g_pFileGrid, "%f %f,", x_coord_right, y_coord_top); fprintf(g_pFileGrid, "%f %f,", x_coord_right, y_coord_bottom); fprintf(g_pFileGrid, "%f %f,", x_coord_left, y_coord_bottom); fprintf(g_pFileGrid, "%f %f,", x_coord_left, y_coord_top); fprintf(g_pFileGrid, ")\""); fprintf(g_pFileGrid, "\n"); } } fclose(g_pFileGrid); } for (int x_i = 0; x_i <= g_grid_size; x_i++) for (int y_i = 0; y_i <= g_grid_size; y_i++) { if (m_GridMatrix[x_i][y_i].m_GPSPointVector.size() > 0) { // compute the average distance from the GPS points (g, g+1) to the ending points of a link for (int local_l = 0; local_l < m_GridMatrix[x_i][y_i].m_LinkNoVector.size(); local_l++) // for all links in this cell { int l = m_GridMatrix[x_i][y_i].m_LinkNoVector[local_l]; m_link_generalised_cost_array[l] = g_GridResolution; // feasible range g_link_vector[l].bInsideFlag = true; if (m_GridMatrix[x_i][y_i].possible_dwell_cell_flag == 1) { g_link_vector[l].Possible_Dwell_time_in_min = m_GridMatrix[x_i][y_i].dwell_time_min; g_link_vector[l].dwell_start_time_in_min = m_GridMatrix[x_i][y_i].start_min; } g_node_vector[g_link_vector[l].from_node_seq_no].bInsideFlag = true; g_node_vector[g_link_vector[l].to_node_seq_no].bInsideFlag = true; } } // for each grid cell // second, we now select the mininum of GPS point (in the same cell) to link distance to set the link cost for (int g = 0; g < m_GridMatrix[x_i][y_i].m_GPSPointVector.size(); g++) // for each GPS point of an agent in the cell { // compute the average distance from the GPS points (g, g+1) to the ending points of a link for (int local_l = 0; local_l < m_GridMatrix[x_i][y_i].m_LinkNoVector.size(); local_l++) // for all links in this cell { int l = m_GridMatrix[x_i][y_i].m_LinkNoVector[local_l]; //if (g_link_vector[l].from_node_id == 207 && g_link_vector[l].to_node_id == 208) // TRACE("%d->%d\n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id); g_link_vector[l].o_distance = MAX_LABEL_COST_; g_link_vector[l].d_distance = MAX_LABEL_COST_; // if (m_GridMatrix[x_i][y_i].m_GPSPointVector[g].trace_id == 4) // { // if (g_link_vector[l].from_node_id == 10386) // { // TRACE(""); // } // } // if (g_link_vector[l].from_node_id == 201 && g_link_vector[l].to_node_id == 202 && m_GridMatrix[x_i][y_i].m_GPSPointVector[g].trace_id == 11) // { // TRACE("GPS point %d", g); // } bool bHitCount = false; double p2l_distance_hit = g_GetPoint2LineDistance(&m_GridMatrix[x_i][y_i].m_GPSPointVector[g].pt, &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt, 1, false); for (int ls = 0; ls < g_link_vector[l].m_PointVector.size() - 1; ls++) //for a pair of shape points along the link { if (m_GridMatrix[x_i][y_i].m_GPSPointVector.size() >= 2 && g <= m_GridMatrix[x_i][y_i].m_GPSPointVector.size() - 2 && g_GetTwoPoints2LineIntersectionFlag(&m_GridMatrix[x_i][y_i].m_GPSPointVector[g].pt, &m_GridMatrix[x_i][y_i].m_GPSPointVector[g + 1].pt, &g_link_vector[l].m_PointVector[ls], &g_link_vector[l].m_PointVector[ls + 1])) { g_link_vector[l].hit_count += 1; bHitCount = true; break; } } double p2l_distance = g_GetPoint2LineDistance(&m_GridMatrix[x_i][y_i].m_GPSPointVector[g].pt, &g_node_vector[g_link_vector[l].from_node_seq_no].pt, &g_node_vector[g_link_vector[l].to_node_seq_no].pt, 1, true); // recacluate the point 2 line distance, without intersection requirement // we consider GPS segment to the link shape point segment distance for (int p = 0; p < g_link_vector[l].m_PointVector.size(); p++) { double distance_from = g_GetPoint2Point_Distance(&m_GridMatrix[x_i][y_i].m_GPSPointVector[g].pt, &g_link_vector[l].m_PointVector[p]); double distance_to = 0; if (g_agent_vector[agent_no].m_GPSPointVector.size() >= 2 && p < g_link_vector[l].m_PointVector.size() - 1 && (g != m_GridMatrix[x_i][y_i].m_GPSPointVector.size() - 1)) // boundary points) { distance_to = g_GetPoint2Point_Distance(&m_GridMatrix[x_i][y_i].m_GPSPointVector[g + 1].pt, &g_link_vector[l].m_PointVector[p + 1]); } // we do not need to detect ill conditionning here, as the link in the cell , and the GPS trace information is all we have. // distance from is the distance from GPS point g to from node of link // distance to is the distance from GPS point g to to node of link double nonhit_distance = (p2l_distance * 10 + distance_from + distance_to) / 10; //if (g_link_vector[l].to_node_id == 172) //{ //TRACE("grid: %d,%d,trace_d: %d, dist = %f\n", // x_i, y_i,m_GridMatrix[x_i][y_i].m_GPSPointVector[g + 1].trace_id, distance); //} if (nonhit_distance > g_link_vector[l].link_distance * 2) // filter out long deviation continue; if (nonhit_distance < m_link_generalised_cost_array[l]) // for static case { m_link_generalised_cost_array[l] = nonhit_distance; // use this distance as the likelihood cost } int time_interval = g_GetTimeInterval(m_GridMatrix[x_i][y_i].m_GPSPointVector[g].global_time_in_second / 60.0); double distance; if (bHitCount) distance = p2l_distance_hit; else distance = nonhit_distance * g_NonHitDistanceRatio; if (distance < m_TD_link_generalised_cost_array[l][time_interval]) // TD case { // if (g_link_vector[l].from_node_id == 201 && g_link_vector[l].to_node_id == 202) // { // TRACE("GPS point %d", g); // } //int offset_in_interval = max(1, g_agent_vector[agent_no].sampling_rate_in_min / g_TimeResolution_inMin); int offset_in_interval = g_agent_vector[agent_no].sampling_rate_in_min / g_TimeResolution_inMin; if (offset_in_interval < 1) offset_in_interval = 1; int t0 = max(0, time_interval - offset_in_interval); int t1 = min(time_interval + offset_in_interval, g_TimeRangeInterval); for (int t = t0; t < t1; t++) { m_TD_link_generalised_cost_array[l][t] = distance; m_TD_link_GPS_point_array[l][t] = m_GridMatrix[x_i][y_i].m_GPSPointVector[g].trace_id; m_TD_link_GPS_hit_array[l][t] = bHitCount; } } } } } } for (int i = 0; i < g_link_vector.size(); i++) // reset the cost for all links { g_link_vector[i].likelihood_distance = m_link_generalised_cost_array[i]; } for (int l = 0; l < g_link_vector.size(); l++) // { if ((g_link_vector[l].from_node_id == 201 && g_link_vector[l].to_node_id == 202) || (g_link_vector[l].from_node_id == 202 && g_link_vector[l].to_node_id == 135)) { for (int t = 0; t < g_TimeRangeInterval; t++) { if (m_TD_link_generalised_cost_array[l][t] < MAX_LABEL_COST_) { float timestamp_in_min = t * g_TimeResolution_inMin + g_StartTimeinMin; int t_in_sec = (timestamp_in_min - g_StartTimeinMin) * 60; fprintf(g_pFileLog, "arc cost %d -> %d at time index %d and sec %d = %f, hit flag: %d: GPS point ID: %d \n", g_link_vector[l].from_node_id, g_link_vector[l].to_node_id, t, t_in_sec, m_TD_link_generalised_cost_array[l][t], m_TD_link_GPS_hit_array[l][t], m_TD_link_GPS_point_array[l][t]); } } } } return true; } int UpdateLinkLRPriceGridSystem(int agent_no) { // for every agent int balance_count = 0; float benefit = 100; for (int l = 0; l < g_link_vector.size(); l++) { if (g_link_vector[l].hit_count >= 1 && g_link_vector[l].use_count == 0) // subgradient algorithm for adjusting price { g_link_vector[l].balance = g_link_vector[l].use_count - g_link_vector[l].hit_count; for (int t = 0; t < g_TimeRangeInterval; t++) { if (m_TD_link_GPS_hit_array[l][t] >= 1) // TD case m_TD_link_generalised_cost_array[l][t] += benefit * g_link_vector[l].balance; } balance_count += 1; } } fprintf(g_pFileLog, "LR balance count = %d \n", balance_count); cout << "balance_count = " << balance_count << endl; return balance_count; } std::vector<int> m_agent_vector; int m_memory_block_no; std::vector<int> m_origin_node_vector; // assigned nodes for computing std::vector<int> m_origin_zone_seq_no_vector; int tau; // assigned nodes for computing int m_agent_type_no; // assigned nodes for computing double m_value_of_time; int m_threadNo; // internal thread number int m_ListFront; // used in coding SEL int m_ListTail; // used in coding SEL int *m_SENodeList; // used in coding SEL double *m_node_label_cost; // label cost // for shortest path calcuating double *m_label_time_array; // time-based cost double *m_label_distance_array; // distance-based cost int *m_node_predecessor; // predecessor for nodes int *m_node_status_array; // update status int *m_link_predecessor; // predecessor for this node points to the previous link that updates its label cost (as part of optimality condition) (for easy referencing) double *m_link_flow_volume_array; double *m_link_generalised_cost_array; double **m_TD_link_generalised_cost_array; int **m_TD_link_GPS_point_array; int **m_TD_link_GPS_hit_array; double **m_TD_node_label_cost; int **m_TD_node_predecessor; // predecessor for nodes int **m_TD_link_predecessor; // predecessor for this node points to the previous link that updates its label cost (as part of optimality condition) (for easy referencing) int **m_TD_time_predecessor; // predecessor for this node points to the previous link that updates its label cost (as part of optimality condition) (for easy referencing) int *temp_path_node_vector; // major function 1: allocate memory and initialize the data void AllocateMemory(int number_of_nodes, int number_of_links) { m_SENodeList = new int[number_of_nodes]; //1 m_node_status_array = new int[number_of_nodes]; //2 m_label_time_array = new double[number_of_nodes]; //3 m_label_distance_array = new double[number_of_nodes]; //4 m_node_predecessor = new int[number_of_nodes]; //5 m_link_predecessor = new int[number_of_nodes]; //6 m_node_label_cost = new double[number_of_nodes]; //7 m_link_flow_volume_array = new double[number_of_links]; //8 m_link_generalised_cost_array = new double[number_of_links]; //9 temp_path_node_vector = new int[number_of_nodes]; m_TD_link_generalised_cost_array = Allocate2DDynamicArray<double>(number_of_links, g_TimeRangeInterval); m_TD_link_GPS_point_array = Allocate2DDynamicArray<int>(number_of_links, g_TimeRangeInterval); m_TD_link_GPS_hit_array = Allocate2DDynamicArray<int>(number_of_links, g_TimeRangeInterval); m_TD_node_label_cost = Allocate2DDynamicArray<double>(number_of_nodes, g_TimeRangeInterval); m_TD_node_predecessor = Allocate2DDynamicArray<int>(number_of_nodes, g_TimeRangeInterval); m_TD_link_predecessor = Allocate2DDynamicArray<int>(number_of_nodes, g_TimeRangeInterval); m_TD_time_predecessor = Allocate2DDynamicArray<int>(number_of_nodes, g_TimeRangeInterval); } ~NetworkForSP() { if (m_SENodeList != NULL) //1 delete[] m_SENodeList; if (m_node_status_array != NULL) //2 delete[] m_node_status_array; if (m_label_time_array != NULL) //3 delete[] m_label_time_array; if (m_label_distance_array != NULL) //4 delete[] m_label_distance_array; if (m_node_predecessor != NULL) //5 delete[] m_node_predecessor; if (m_link_predecessor != NULL) //6 delete[] m_link_predecessor; if (m_node_label_cost != NULL) //7 delete[] m_node_label_cost; if (m_link_flow_volume_array != NULL) //8 delete[] m_link_flow_volume_array; if (m_link_generalised_cost_array != NULL) //9 delete[] m_link_generalised_cost_array; if (temp_path_node_vector != NULL) //9 delete[] temp_path_node_vector; if (m_GridMatrix) Deallocate2DDynamicArray<GridNodeSet>(m_GridMatrix, MAX_GRID_SIZE_); if (m_TD_link_generalised_cost_array) Deallocate2DDynamicArray<double>(m_TD_link_generalised_cost_array, g_TimeRangeInterval); if (m_TD_link_GPS_point_array) Deallocate2DDynamicArray<int>(m_TD_link_GPS_point_array, g_TimeRangeInterval); if (m_TD_link_GPS_hit_array) Deallocate2DDynamicArray<int>(m_TD_link_GPS_hit_array, g_TimeRangeInterval); if (m_TD_node_label_cost) Deallocate2DDynamicArray<double>(m_TD_node_label_cost, g_TimeRangeInterval); if (m_TD_node_predecessor) Deallocate2DDynamicArray<int>(m_TD_node_predecessor, g_TimeRangeInterval); if (m_TD_link_predecessor) Deallocate2DDynamicArray<int>(m_TD_link_predecessor, g_TimeRangeInterval); if (m_TD_time_predecessor) Deallocate2DDynamicArray<int>(m_TD_time_predecessor, g_TimeRangeInterval); } // SEList: scan eligible List implementation: the reason for not using STL-like template is to avoid overhead associated pointer allocation/deallocation inline void SEList_clear() { m_ListFront = -1; m_ListTail = -1; } inline void SEList_push_front(int node) { if (m_ListFront == -1) // start from empty { m_SENodeList[node] = -1; m_ListFront = node; m_ListTail = node; } else { m_SENodeList[node] = m_ListFront; m_ListFront = node; } } inline void SEList_push_back(int node) { if (m_ListFront == -1) // start from empty { m_ListFront = node; m_ListTail = node; m_SENodeList[node] = -1; } else { m_SENodeList[m_ListTail] = node; m_SENodeList[node] = -1; m_ListTail = node; } } inline bool SEList_empty() { return (m_ListFront == -1); } //major function: update the cost for each node at each SP tree, using a stack from the origin structure int origin_node_no; int destination_node_no; //major function 2: // abel correcting algorithm with double queue implementation double optimal_label_correcting(int agent_no) { origin_node_no = -1; destination_node_no = -1; AddGPSPointsIntoGridSystem(agent_no); //find the origin and destination nodes int number_of_nodes = g_node_vector.size(); int i; for (i = 0; i < number_of_nodes; i++) //Initialization for all non-origin nodes { m_node_status_array[i] = 0; // not scanned m_node_label_cost[i] = MAX_LABEL_COST_; m_link_predecessor[i] = -1; // pointer to previous NODE INDEX from the current label at current node and time m_node_predecessor[i] = -1; // pointer to previous NODE INDEX from the current label at current node and time m_label_time_array[i] = 0; // comment out to speed up comuting ////m_label_distance_array[i] = 0; } int internal_debug_flag = 0; if (origin_node_no == -1 || destination_node_no == -1) { return 0; } cout << "origin_node_id =" << g_node_vector[origin_node_no].node_id << "; " << "destination_node_id =" << g_node_vector[destination_node_no].node_id << endl; //Initialization for origin node at the preferred departure time, at departure time, cost = 0, otherwise, the delay at origin node m_label_time_array[origin_node_no] = g_agent_vector[agent_no].start_time_in_min; m_node_label_cost[origin_node_no] = 0.0; //Mark: m_label_distance_array[origin_node_no] = 0.0; m_link_predecessor[origin_node_no] = -1; // pointer to previous NODE INDEX from the current label at current node and time m_node_predecessor[origin_node_no] = -1; // pointer to previous NODE INDEX from the current label at current node and time SEList_clear(); SEList_push_back(origin_node_no); int from_node, to_node; int link_sqe_no; double new_time = 0; double new_distance = 0; double new_to_node_cost = 0; int tempFront; while (!(m_ListFront == -1)) //SEList_empty() { // from_node = SEList_front(); // SEList_pop_front(); // remove current node FromID from the SE list from_node = m_ListFront; //pop a node FromID for scanning tempFront = m_ListFront; m_ListFront = m_SENodeList[m_ListFront]; m_SENodeList[tempFront] = -1; m_node_status_array[from_node] = 2; int pred_link_seq_no = m_link_predecessor[from_node]; for (i = 0; i < g_node_vector[from_node].m_outgoing_link_seq_no_vector.size(); i++) // for each link (i,j) belong A(i) { link_sqe_no = g_node_vector[from_node].m_outgoing_link_seq_no_vector[i]; to_node = g_link_vector[link_sqe_no].to_node_seq_no; //remark: the more complicated implementation can be found in paper Shortest Path Algorithms In Transportation Models: Classical and Innovative Aspects // A note on least time path computation considering delays and prohibitions for intersection movements //very important: only origin zone can access the outbound connectors, //the other zones do not have access to the outbound connectors new_to_node_cost = m_node_label_cost[from_node] + m_link_generalised_cost_array[link_sqe_no]; // m_link_generalised_cost_array is the likelihood cost determined externally by the GPS points to link distance if (new_to_node_cost < m_node_label_cost[to_node]) // we only compare cost at the downstream node ToID at the new arrival time t { m_label_time_array[origin_node_no] = 0; m_node_label_cost[to_node] = new_to_node_cost; m_node_predecessor[to_node] = from_node; // pointer to previous physical NODE INDEX from the current label at current node and time m_link_predecessor[to_node] = link_sqe_no; // pointer to previous physical NODE INDEX from the current label at current node and time // deque updating rule for m_node_status_array if (m_node_status_array[to_node] == 0) { ///// SEList_push_back(to_node); ///// begin of inline block if (m_ListFront == -1) // start from empty { m_ListFront = to_node; m_ListTail = to_node; m_SENodeList[to_node] = -1; } else { m_SENodeList[m_ListTail] = to_node; m_SENodeList[to_node] = -1; m_ListTail = to_node; } ///// end of inline block m_node_status_array[to_node] = 1; } if (m_node_status_array[to_node] == 2) { /////SEList_push_front(to_node); ///// begin of inline block if (m_ListFront == -1) // start from empty { m_SENodeList[to_node] = -1; m_ListFront = to_node; m_ListTail = to_node; } else { m_SENodeList[to_node] = m_ListFront; m_ListFront = to_node; } ///// end of inline block m_node_status_array[to_node] = 1; } } } } return m_node_label_cost[destination_node_no]; } double time_dependent_label_correcting(int agent_no) { origin_node_no = -1; destination_node_no = -1; for (int link = 0; link < g_link_vector.size(); link++) { g_link_vector[link].hit_count = 0; g_link_vector[link].use_count = 0; g_link_vector[link].Possible_Dwell_time_in_min = 0; } if (AddGPSPointsIntoGridSystem(agent_no) == false) return 0; //step 1: find the origin and destination nodes int LR_iteration_size = 1; // step 2: LR int balance_count = 0; for (int lr_i = 0; lr_i < LR_iteration_size; lr_i++) { if (lr_i >= 1) { int balance_count_current = UpdateLinkLRPriceGridSystem(agent_no); if (lr_i >= 2) { int balance_count_change = balance_count_current - balance_count; if (balance_count_current == 0) // no improvement break; } balance_count = balance_count_current; } int number_of_nodes = g_node_vector.size(); int i; for (i = 0; i < number_of_nodes; i++) //Initialization for all non-origin nodes { if (g_node_vector[i].bInsideFlag = false) continue; for (int t = 0; t < g_TimeRangeInterval; t++) { m_TD_node_label_cost[i][t] = MAX_LABEL_COST_; m_TD_link_predecessor[i][t] = -1; // pointer to previous NODE INDEX from the current label at current node and time m_TD_node_predecessor[i][t] = -1; // pointer to previous NODE INDEX from the current label at current node and time m_TD_time_predecessor[i][t] = -1; // pointer to previous NODE INDEX from the current label at current node and time } } fprintf(g_pFileLog, "OD node index: %d -> %d\n", origin_node_no, destination_node_no); int internal_debug_flag = 0; if (origin_node_no == -1 || destination_node_no == -1) { return 0; } cout << "origin_node_no =" << g_node_vector[origin_node_no].node_id << "; " << "destination_node_no =" << g_node_vector[destination_node_no].node_id << endl; fprintf(g_pFileLog, "OD node id: %d -> %d\n", g_node_vector[origin_node_no].node_id, g_node_vector[destination_node_no].node_id); //Initialization for origin node at the preferred departure time, at departure time, cost = 0, otherwise, the delay at origin node m_label_time_array[origin_node_no] = g_agent_vector[agent_no].start_time_in_min; int start_timestamp_in_interval = g_GetTimeInterval(g_agent_vector[agent_no].start_time_in_min); g_agent_vector[agent_no].end_time_in_min = g_agent_vector[agent_no].m_GPSPointVector[g_agent_vector[agent_no].m_GPSPointVector.size() - 1].global_time_in_second / 60.0; int end_timestamp_in_interval = g_GetTimeInterval(g_agent_vector[agent_no].end_time_in_min); m_TD_node_label_cost[origin_node_no][start_timestamp_in_interval] = 0.0; int from_node, to_node; int link_sqe_no; double new_time = 0; double new_distance = 0; double new_to_node_cost = 0; fprintf(g_pFileLog, "finding time index: %d -> %d\n", start_timestamp_in_interval, end_timestamp_in_interval); for (int tr = start_timestamp_in_interval; tr <= end_timestamp_in_interval; tr++) // tr as current time { int update_count = 0; for (int link = 0; link < g_link_vector.size(); link++) { if (g_link_vector[link].bInsideFlag == false) continue; from_node = g_link_vector[link].from_node_seq_no; to_node = g_link_vector[link].to_node_seq_no; //if (tr == 60 && g_link_vector[link].from_node_id == 9175 && g_link_vector[link].to_node_id == 9212) //{ // TRACE(""); //} float timestamp_in_min = tr * g_TimeResolution_inMin + g_StartTimeinMin; int timestamp_in_interval = max(0, g_GetTimeInterval(timestamp_in_min)); int max_TT_Dwell_time_in_int = 0; if (g_agent_vector[agent_no].m_ExcessiveDwellMap.find(tr) != g_agent_vector[agent_no].m_ExcessiveDwellMap.end()) { max_TT_Dwell_time_in_int = g_agent_vector[agent_no].m_ExcessiveDwellMap[timestamp_in_interval]; } float over_speed_limit_ratio = 0.7; //int min_FFTT_in_interval = max(1, g_link_vector[link].FFTT_in_min / g_TimeResolution_inMin * over_speed_limit_ratio + 0.5); int min_FFTT_in_interval = g_link_vector[link].FFTT_in_min / g_TimeResolution_inMin * over_speed_limit_ratio + 0.5; if (min_FFTT_in_interval < 1) min_FFTT_in_interval = 1; //int FFTT_in_interval = max(1, g_link_vector[link].FFTT_in_min / g_TimeResolution_inMin + 0.5); int FFTT_in_interval = g_link_vector[link].FFTT_in_min / g_TimeResolution_inMin + 0.5; if (FFTT_in_interval < 1) FFTT_in_interval = 1; int stage_size = 10; int max_TT_in_interval = max(1, max(max_TT_Dwell_time_in_int, FFTT_in_interval * stage_size)); int step_size = 1; for (int travel_time_in_interval = min_FFTT_in_interval; travel_time_in_interval < max_TT_in_interval; travel_time_in_interval += step_size) //++1 might give more precise travel time { int final_tt_in_interval = travel_time_in_interval; //dynamic step size //float ratio = travel_time_in_interval * 1.0 / FFTT_in_interval; //if (ratio > 5 && travel_time_in_interval* g_TimeResolution_inMin>=2) //{ // step_size = max(1, ratio / 3); // to speed up calculation //} //last stage //if (travel_time_in_interval == max_TT_in_interval-1 && g_link_vector[link].Possible_Dwell_time_in_min>=1 && // (timestamp_in_min>g_link_vector[link].dwell_start_time_in_min && timestamp_in_min < g_link_vector[link].dwell_start_time_in_min+1)) //{ // final_tt_in_interval = g_link_vector[link].Possible_Dwell_time_in_min/ g_TimeResolution_inMin; // hour //} int tnext = min(g_TimeRangeInterval - 1, tr + final_tt_in_interval); float benefit = 0; float speed_deviation_penalty = 0; // only apply for normal cases //if (max_TT_Dwell_time_in_int == 0) //{ // speed_deviation_penalty = abs(final_tt_in_interval - FFTT_in_interval) * 0.000001; //} //else //{ //} new_to_node_cost = m_TD_node_label_cost[from_node][tr] + m_TD_link_generalised_cost_array[link][timestamp_in_interval] + benefit + speed_deviation_penalty; // m_link_generalised_cost_array is the likelihood cost determined externally by the GPS points to link distance if (new_to_node_cost < m_TD_node_label_cost[to_node][tnext]) // we only compare cost at the downstream node ToID at the new arrival time t { m_TD_node_label_cost[to_node][tnext] = new_to_node_cost; m_TD_node_predecessor[to_node][tnext] = from_node; m_TD_link_predecessor[to_node][tnext] = link; m_TD_time_predecessor[to_node][tnext] = tr; if (g_link_vector[link].AccessibilityTime > new_to_node_cost) { g_link_vector[link].AccessibilityTime = tnext; } //if(agent_no==0) //{ //fprintf(g_pFileLog, "%d: %d, link %d, time %d-> %d: cost %f \n", update_count, link, g_link_vector[link].to_node_id, tr, tnext, new_to_node_cost); //} update_count++; } } } } int node_size = 0; std::vector<int> reversed_path_node_sequence, reversed_path_link_sequence, reversed_path_time_sequence; std::vector<float> reversed_path_cost_sequence; int min_end_timestamp_in_interval = end_timestamp_in_interval; float min_label_cost = m_TD_node_label_cost[destination_node_no][end_timestamp_in_interval]; for (int tt = max(0, end_timestamp_in_interval - 5); tt < end_timestamp_in_interval; tt++) { if (m_TD_node_label_cost[destination_node_no][tt] < min_label_cost) { min_label_cost = m_TD_node_label_cost[destination_node_no][tt]; min_end_timestamp_in_interval = tt; } } reversed_path_node_sequence.push_back(destination_node_no); //record the first node backward, destination node reversed_path_time_sequence.push_back(min_end_timestamp_in_interval); //record the first node backward, destination node reversed_path_cost_sequence.push_back(min_label_cost); fprintf(g_pFileLog, "backtracing time index: %d\n", min_end_timestamp_in_interval); int pred_node = m_TD_node_predecessor[destination_node_no][end_timestamp_in_interval]; int pred_time_r = m_TD_time_predecessor[destination_node_no][end_timestamp_in_interval]; int pred_link = -1; int pred_node_record, pred_time_record_r; while (pred_node != -1 && pred_time_r >= start_timestamp_in_interval) // scan backward in the predessor array of the shortest path calculation results { //record current values of node and time predecessors, and update PredNode and PredTime pred_node_record = pred_node; pred_time_record_r = pred_time_r; pred_node = m_TD_node_predecessor[pred_node_record][pred_time_record_r]; pred_time_r = m_TD_time_predecessor[pred_node_record][pred_time_record_r]; pred_link = m_TD_link_predecessor[pred_node_record][pred_time_record_r]; if (pred_node != -1) { fprintf(g_pFileLog, "backtracing time index: %d", pred_time_r); fprintf(g_pFileLog, "backtracing link %d: %d->%d\n", pred_link, g_link_vector[pred_link].from_node_id, g_link_vector[pred_link].to_node_id); reversed_path_link_sequence.push_back(pred_link); reversed_path_node_sequence.push_back(pred_node); reversed_path_time_sequence.push_back(pred_time_r); reversed_path_cost_sequence.push_back(m_TD_node_label_cost[pred_node_record][pred_time_record_r]); } } g_agent_vector[agent_no].AllocatePathNodeVector(reversed_path_node_sequence.size(), reversed_path_node_sequence, reversed_path_time_sequence, reversed_path_cost_sequence, reversed_path_link_sequence); fprintf(g_pFileLog, "AllocatePathNodeVector\n"); if (origin_node_no >= 0 && destination_node_no >= 0) //feasible origin and destination nodes { g_agent_vector[agent_no].o_node_id = g_node_vector[origin_node_no].node_id; g_agent_vector[agent_no].d_node_id = g_node_vector[destination_node_no].node_id; } for (int i = 0; i < reversed_path_link_sequence.size(); i++) { int link_no = reversed_path_link_sequence[i]; g_link_vector[link_no].use_count += 1; } } return m_node_label_cost[destination_node_no]; } void find_path_for_agents_assigned_for_this_thread() { int return_value; for (int i = 0; i < m_agent_vector.size(); i++) { CAgent *p_agent = &(g_agent_vector[m_agent_vector[i]]); cout << "agent_id =" << p_agent->agent_id.c_str() << endl; return_value = optimal_label_correcting(p_agent->agent_no); if (return_value == -1) { continue; } // step 2: backtrack to the origin (based on node and time predecessors) int current_node_seq_no = destination_node_no; // destination node int current_link_seq_no = -1; int l_node_size = 0; // backtrace the shortest path tree from the destination to the root (at origin) while (current_node_seq_no >= 0 && current_node_seq_no < g_number_of_nodes) { temp_path_node_vector[l_node_size++] = current_node_seq_no; if (l_node_size >= 10000) { cout << "Error: l_node_size >= temp_path_node_vector_size" << endl; g_Program_stop(); } current_node_seq_no = m_node_predecessor[current_node_seq_no]; // update node seq no } p_agent->AllocatePathNodeVector(l_node_size, temp_path_node_vector, true); if (origin_node_no >= 0 && destination_node_no >= 0) //feasible origin and destination nodes { p_agent->o_node_id = g_node_vector[origin_node_no].node_id; p_agent->d_node_id = g_node_vector[destination_node_no].node_id; } } } void find_TD_path_for_agents_assigned_for_this_thread() { int return_value; for (int i = 0; i < m_agent_vector.size(); i++) { CAgent *p_agent = &(g_agent_vector[m_agent_vector[i]]); cout << "agent_id =" << p_agent->agent_id.c_str() << endl; return_value = time_dependent_label_correcting(p_agent->agent_no); if (return_value == -1) { continue; } } } }; NetworkForSP *g_pNetworkVector = nullptr; vector<double> g_timestr2second(string str) { vector<double> output_global_minute; vector<double> output_global_second; int string_lenghth = str.length(); const char *string_line = str.data(); //string to char* int char_length = strlen(string_line); char ch, buf_ddhhmm[32] = {0}, buf_SS[32] = {0}, buf_sss[32] = {0}; char dd1, dd2, hh1, hh2, mm1, mm2, SS1, SS2, sss1, sss2, sss3; double ddf1, ddf2, hhf1, hhf2, mmf1, mmf2, SSf1, SSf2, sssf1, sssf2, sssf3; double global_minute = 0; double dd = 0, hh = 0, mm = 0, SS = 0, sss = 0; int i = 0; int buffer_i = 0, buffer_k = 0, buffer_j = 0; int num_of_colons = 0; //DDHHMM:SS:sss or HHMM:SS:sss while (i < char_length) { ch = string_line[i++]; if (num_of_colons == 0 && ch != '_' && ch != ':') //input to buf_ddhhmm until we meet the colon { buf_ddhhmm[buffer_i++] = ch; } else if (num_of_colons == 1 && ch != ':') //start the Second "SS" { buf_SS[buffer_k++] = ch; } else if (num_of_colons == 2 && ch != ':') //start the Millisecond "sss" { buf_sss[buffer_j++] = ch; } if (ch == '_' || ch == ';' || i == char_length) //start a new time string { if (buffer_i == 4) //"HHMM" { //HHMM, 0123 hh1 = buf_ddhhmm[0]; //read each first hh2 = buf_ddhhmm[1]; mm1 = buf_ddhhmm[2]; mm2 = buf_ddhhmm[3]; hhf1 = ((double)hh1 - 48); //convert a char to a double hhf2 = ((double)hh2 - 48); mmf1 = ((double)mm1 - 48); mmf2 = ((double)mm2 - 48); dd = 0; hh = hhf1 * 10 * 60 + hhf2 * 60; mm = mmf1 * 10 + mmf2; } else if (buffer_i == 6) //"DDHHMM" { //DDHHMM, 012345 dd1 = buf_ddhhmm[0]; //read each first dd2 = buf_ddhhmm[1]; hh1 = buf_ddhhmm[2]; hh2 = buf_ddhhmm[3]; mm1 = buf_ddhhmm[4]; mm2 = buf_ddhhmm[5]; ddf1 = ((double)dd1 - 48); //convert a char to a double ddf2 = ((double)dd2 - 48); hhf1 = ((double)hh1 - 48); hhf2 = ((double)hh2 - 48); mmf1 = ((double)mm1 - 48); mmf2 = ((double)mm2 - 48); dd = ddf1 * 10 * 24 * 60 + ddf2 * 24 * 60; hh = hhf1 * 10 * 60 + hhf2 * 60; mm = mmf1 * 10 + mmf2; } if (num_of_colons == 1 || num_of_colons == 2) { //SS, 01 SS1 = buf_SS[0]; //read each first SS2 = buf_SS[1]; SSf1 = ((double)SS1 - 48); //convert a char to a double SSf2 = ((double)SS2 - 48); SS = (SSf1 * 10 + SSf2) / 60; } if (num_of_colons == 2) { //sss, 012 sss1 = buf_sss[0]; //read each first sss2 = buf_sss[1]; sss3 = buf_sss[2]; sssf1 = ((double)sss1 - 48); //convert a char to a double sssf2 = ((double)sss2 - 48); sssf3 = ((double)sss3 - 48); sss = (sssf1 * 100 + sssf2 * 10 + sssf3) / 1000; } global_minute = dd + hh + mm + SS + sss; double global_second = (dd + hh + mm + SS + sss) * 60.0; output_global_second.push_back(global_second); //initialize the parameters buffer_i = 0; buffer_k = 0; buffer_j = 0; num_of_colons = 0; } if (ch == ':') { num_of_colons += 1; } } return output_global_second; } int timestr2second(string time_str) { //hhmmss string hh = time_str.substr(0, 2); string mm = time_str.substr(2, 2); string ss = time_str.substr(5, 2); int hhi = stoi(hh); int mmi = stoi(mm); int ssi = stoi(ss); return hhi * 3600 + mmi * 60 + ssi; } string second2timestr(int time_int) { int hhi = time_int / 3600; int mmi = (time_int - 3600 * hhi) / 60; int ssi = time_int - 3600 * hhi - 60 * mmi; string hh = hhi < 10 ? "0" + to_string(hhi) : to_string(hhi); string mm = mmi < 10 ? "0" + to_string(mmi) : to_string(mmi); string ss = ssi < 10 ? "0" + to_string(ssi) : to_string(ssi); return hh + mm + ":" + ss; } void g_DetermineResolution() { CCSVParser parser; if (parser.OpenCSVFile("node.csv", true)) { // initialization of grid rectangle boundary double m_left = 100000000; double m_right = -100000000; double m_top = -1000000000; double m_bottom = 1000000000; int node_count = 0; while (parser.ReadRecord()) // if this line contains [] mark, then we will also read field headers. { int node_id; if (parser.GetValueByFieldName("node_id", node_id) == false) continue; CNode node; node.node_id = node_id; parser.GetValueByFieldName("x_coord", node.pt.x, false); parser.GetValueByFieldName("y_coord", node.pt.y, false); // exapnd the grid boundary according to the nodes m_left = min(m_left, node.pt.x); m_right = max(m_right, node.pt.x); m_top = max(m_top, node.pt.y); m_bottom = min(m_bottom, node.pt.y); node_count++; } int grid_size = 5; if (node_count > 10000) grid_size = 10; if (node_count > 40000) grid_size = 15; double temp_resolution = (((m_right - m_left) / grid_size + (m_top - m_bottom) / grid_size)) / 2.0; vector<double> ResolutionVector; ResolutionVector.push_back(0.00005); ResolutionVector.push_back(0.0001); ResolutionVector.push_back(0.0002); ResolutionVector.push_back(0.0005); ResolutionVector.push_back(0.001); ResolutionVector.push_back(0.002); ResolutionVector.push_back(0.005); ResolutionVector.push_back(0.01); ResolutionVector.push_back(0.02); ResolutionVector.push_back(0.05); ResolutionVector.push_back(0.1); ResolutionVector.push_back(0.2); ResolutionVector.push_back(0.5); ResolutionVector.push_back(1); ResolutionVector.push_back(2); ResolutionVector.push_back(5); ResolutionVector.push_back(10); ResolutionVector.push_back(20); ResolutionVector.push_back(50); double ClosestResolution = 1; if (temp_resolution < ResolutionVector[0]) temp_resolution = ResolutionVector[0]; for (unsigned int i = 0; i < ResolutionVector.size() - 1; i++) { if ((temp_resolution > ResolutionVector[i] + 0.000001) && temp_resolution < ResolutionVector[i + 1]) { temp_resolution = ResolutionVector[i + 1]; // round up break; } } g_GridResolution = temp_resolution; cout << "g_GridResolution = " << temp_resolution << endl; parser.CloseCSVFile(); } } void g_ReadInputData() { //g_DetermineResolution(); CCSVParser parser; if (parser.OpenCSVFile("node.csv", true)) { while (parser.ReadRecord()) // if this line contains [] mark, then we will also read field headers. { int node_id; if (parser.GetValueByFieldName("node_id", node_id) == false) continue; if (g_internal_node_seq_no_map.find(node_id) != g_internal_node_seq_no_map.end()) { cout << "warning: duplicate definition of node " << node_id << " was detected\n"; continue; } int zone_id = 0; CNode node; node.node_id = node_id; node.node_seq_no = g_number_of_nodes++; parser.GetValueByFieldName("x_coord", node.pt.x, false); parser.GetValueByFieldName("y_coord", node.pt.y, false); parser.GetValueByFieldName("zone_id", zone_id, true); if (g_time_dependent_computing_mode == 1) { zone_id = node_id; } //__int64 long long cell_id = g_GetCellID(node.pt.x, node.pt.y); if (zone_id > 0) // zone id is feasible { if (g_cell_id_2_zone_id_map.find(cell_id) == g_cell_id_2_zone_id_map.end()) // not defined yet g_cell_id_2_zone_id_map[cell_id] = zone_id; else { g_cell_id_2_zone_id_map[cell_id] = 0; // for computing mode TD // empty do not overwrite the zone_id : may be some issues if there are multiple zones in one cell, but we are fine with an assumption at most one zone for one cell. } } g_node_vector.push_back(node); g_internal_node_seq_no_map[node_id] = node.node_seq_no; if (g_number_of_nodes % 1000 == 0) cout << "reading " << g_number_of_nodes << " nodes.. " << endl; } cout << "number of nodes = " << g_number_of_nodes << endl; parser.CloseCSVFile(); } else { cout << "Cannot open file node.csv" << endl; g_Program_stop(); } CCSVParser parser_link; if (parser_link.OpenCSVFile("link.csv", true)) { while (parser_link.ReadRecord()) { CLink link; if (parser_link.GetValueByFieldName("link_id", link.link_id) == false) continue; if (parser_link.GetValueByFieldName("from_node_id", link.from_node_id) == false) continue; if (parser_link.GetValueByFieldName("to_node_id", link.to_node_id) == false) continue; parser_link.GetValueByFieldName("length", link.length); parser_link.GetValueByFieldName("free_speed", link.free_speed); parser_link.GetValueByFieldName("VDF_fftt1", link.FFTT_in_min); link.FFTT_in_min = max(0.1, link.FFTT_in_min); link.FFTT_in_sec = link.FFTT_in_min * 60.0; string allowed_uses; parser_link.GetValueByFieldName("allowed_uses", allowed_uses, false); //if (allowed_uses != 1) // not allowed, skip this link in map matching process, we have to comment out this line. to allow easy input for all mode. // continue; // if users need to select a specific network, they have to construct underlying network if (g_internal_node_seq_no_map.find(link.from_node_id) == g_internal_node_seq_no_map.end()) { cout << "warning: from_node_id " << link.from_node_id << " of link " << link.link_id << " has not been defined in node.csv\n"; continue; } if (g_internal_node_seq_no_map.find(link.to_node_id) == g_internal_node_seq_no_map.end()) { cout << "warning: to_node_id " << link.to_node_id << " of link " << link.link_id << " has not been defined in node.csv\n"; continue; } string geometry_str; parser_link.GetValueByFieldName("geometry", geometry_str); link.from_node_seq_no = g_internal_node_seq_no_map[link.from_node_id]; link.to_node_seq_no = g_internal_node_seq_no_map[link.to_node_id]; link.geometry = geometry_str; // overwrite when the field "geometry" exists CGeometry geometry(geometry_str); std::vector<CCoordinate> CoordinateVector; CoordinateVector = geometry.GetCoordinateList(); link.link_distance = 0; GDPoint Point; GDPoint Point_next; if (CoordinateVector.size() >= 2) { for (int l = 0; l < CoordinateVector.size(); l++) { Point.x = CoordinateVector[l].X; Point.y = CoordinateVector[l].Y; // GPSPoint.time_str = time_stamp; link.m_PointVector.push_back(Point); if (l < CoordinateVector.size() - 1) // consider shape points in each segment of a link { Point_next.x = CoordinateVector[l + 1].X; Point_next.y = CoordinateVector[l + 1].Y; link.link_distance += g_GetPoint2Point_Distance(&Point, &Point_next); } } link.seg_distance = link.link_distance / (CoordinateVector.size() - 1); // take the average of segment distance } link.link_seq_no = g_number_of_links++; g_internal_link_no_map[link.link_id] = link.link_seq_no; g_node_vector[link.from_node_seq_no].m_outgoing_link_seq_no_vector.push_back(link.link_seq_no); g_node_vector[link.from_node_seq_no].m_outgoing_link_seq_no_map[link.to_node_seq_no] = link.link_seq_no; g_link_vector.push_back(link); if (g_number_of_links % 1000 == 0) cout << "reading " << g_number_of_links << " links.. " << endl; } cout << "number of links = " << g_number_of_links << endl; parser_link.CloseCSVFile(); } else { cout << "Cannot open file link.csv" << endl; g_Program_stop(); } } bool g_ReadInputAgentCSVFile() { CCSVParser gps_parser; int gps_point_count = 0; if (gps_parser.OpenCSVFile("input_agent.csv", true)) { double x, y; string time_stamp; int global_time_in_second; while (gps_parser.ReadRecord()) { string agent_id; if (gps_parser.GetValueByFieldName("agent_id", agent_id) == false) continue; string time_sequence_str; gps_parser.GetValueByFieldName("time_sequence", time_sequence_str); float volume = 0; gps_parser.GetValueByFieldName("volume", volume); std::vector<int> time_sequence; g_ParserIntSequence(time_sequence_str, time_sequence); string geometry_str; gps_parser.GetValueByFieldName("geometry", geometry_str); // overwrite when the field "geometry" exists CGeometry geometry(geometry_str); std::vector<CCoordinate> CoordinateVector; CoordinateVector = geometry.GetCoordinateList(); std::vector<CGPSPoint> l_GPSPointVector; if (CoordinateVector.size() >= 2) { for (int l = 0; l < CoordinateVector.size(); l++) { CGPSPoint GPSPoint; GPSPoint.pt.x = CoordinateVector[l].X; GPSPoint.pt.y = CoordinateVector[l].Y; if (l < time_sequence.size()) GPSPoint.global_time_in_second = time_sequence[l]; //__int64 long long cell_id = g_GetCellID(GPSPoint.pt.x, GPSPoint.pt.y); if (g_cell_id_2_zone_id_map.find(cell_id) != g_cell_id_2_zone_id_map.end()) //only consider the GPS points passing through the subarea { GPSPoint.cell_id = cell_id; l_GPSPointVector.push_back(GPSPoint); gps_point_count++; } } } if (l_GPSPointVector.size() <= 1) // if the trace is outside the current network continue; if (g_internal_agent_no_map.find(agent_id) == g_internal_agent_no_map.end()) { CAgent agent; agent.agent_id = agent_id; agent.volume = volume; agent.agent_no = g_agent_vector.size(); g_internal_agent_no_map[agent_id] = agent.agent_no; // assign the internal agent no as the current size of the map. agent.m_GPSPointVector = l_GPSPointVector; agent.o_cell_id = l_GPSPointVector[0].cell_id; agent.d_cell_id = l_GPSPointVector[l_GPSPointVector.size() - 1].cell_id; if (g_cell_id_2_zone_id_map.find(l_GPSPointVector[0].cell_id) != g_cell_id_2_zone_id_map.end()) agent.origin_zone_id = g_cell_id_2_zone_id_map[l_GPSPointVector[0].cell_id]; else agent.origin_zone_id = -1; if (g_cell_id_2_zone_id_map.find(l_GPSPointVector[l_GPSPointVector.size() - 1].cell_id) != g_cell_id_2_zone_id_map.end()) agent.destination_zone_id = g_cell_id_2_zone_id_map[l_GPSPointVector[l_GPSPointVector.size() - 1].cell_id]; else agent.destination_zone_id = -1; g_agent_vector.push_back(agent); } } cout << "number of agents = " << g_agent_vector.size() << endl; cout << "number of GPS points = " << gps_point_count << endl; gps_parser.CloseCSVFile(); return true; } return false; } void g_ReadTraceCSVFile() { CCSVParser gps_parser; int gps_point_count = 0; gps_point_count = 0; if (gps_parser.OpenCSVFile("trace.csv", true)) { cout << "reading trace.csv" << endl; double x, y; while (gps_parser.ReadRecord()) { string agent_id; if (gps_parser.GetValueByFieldName("agent_id", agent_id) == false) continue; if (g_internal_agent_no_map.find(agent_id) == g_internal_agent_no_map.end()) { g_internal_agent_no_map[agent_id] = g_internal_agent_no_map.size(); // assign the internal agent no as the current size of the map. CAgent agent; agent.agent_id = agent_id; agent.agent_no = g_agent_vector.size(); g_agent_vector.push_back(agent); } gps_parser.GetValueByFieldName("x_coord", x, false); gps_parser.GetValueByFieldName("y_coord", y, false); int dd = 0; int hh = 0; int mm = 0; int ss = 0; gps_parser.GetValueByFieldName("dd", dd); gps_parser.GetValueByFieldName("dd", hh); gps_parser.GetValueByFieldName("hh", hh); gps_parser.GetValueByFieldName("mm", mm); gps_parser.GetValueByFieldName("ss", ss); int trace_id = 0; gps_parser.GetValueByFieldName("trace_id", trace_id); float time_in_min; time_in_min = hh * 60 + mm + ss / 60.0; CGPSPoint GPSPoint; GPSPoint.trace_id = trace_id; GPSPoint.pt.x = x; GPSPoint.pt.y = y; GPSPoint.global_time_in_second = hh * 3600 + mm * 60 + ss; GPSPoint.dd = dd; //__int64 long long cell_id = g_GetCellID(GPSPoint.pt.x, GPSPoint.pt.y); if (g_cell_id_2_zone_id_map.find(cell_id) != g_cell_id_2_zone_id_map.end()) //only consider the GPS points passing through the subarea { if (g_agent_vector[g_internal_agent_no_map[agent_id]].m_GPSPointVector.size() == 0) { g_agent_vector[g_internal_agent_no_map[agent_id]].start_time_in_min = time_in_min; g_agent_vector[g_internal_agent_no_map[agent_id]].end_time_in_min = time_in_min; } if (time_in_min > g_agent_vector[g_internal_agent_no_map[agent_id]].end_time_in_min) g_agent_vector[g_internal_agent_no_map[agent_id]].end_time_in_min = time_in_min; GPSPoint.cell_id = cell_id; g_agent_vector[g_internal_agent_no_map[agent_id]].m_GPSPointVector.push_back(GPSPoint); if (time_in_min < g_StartTimeinMin) g_StartTimeinMin = time_in_min; if (time_in_min > g_EndTimeinMin) g_EndTimeinMin = time_in_min; float g_EndTimeinMin = 0; fprintf(g_pFileLog, "trace index %d, cell id %jd\n", trace_id, cell_id); gps_point_count++; } else { fprintf(g_pFileLog, "trace index %d, not included\n", trace_id); } } for (int a_i = 0; a_i < g_agent_vector.size(); a_i++) { fprintf(g_pFileLog, "agent index %s, GPS point size = %d \n", g_agent_vector[a_i].agent_id.c_str(), g_agent_vector[a_i].m_GPSPointVector.size()); } //g_TimeRangeInterval = max((g_EndTimeinMin - g_StartTimeinMin) / g_TimeResolution_inMin + 1, 10); g_TimeRangeInterval = (g_EndTimeinMin - g_StartTimeinMin) / g_TimeResolution_inMin + 1; if (g_TimeRangeInterval < 10) g_TimeRangeInterval = 10; gps_parser.CloseCSVFile(); } } void g_OutputTraceCSVFile() { FILE *g_pFileTrace = nullptr; g_pFileTrace = fopen("trace_processing.csv", "w"); if (g_pFileTrace == NULL) { cout << "File trace_processing.csv cannot be opened." << endl; g_Program_stop(); } else { fprintf(g_pFileTrace, "gps_trace_id,agent_id,x_coord,y_coord,global_sec,interval,relative_sec,distance,speed\n"); for (int a = 0; a < g_agent_vector.size(); a++) { for (int g = 0; g < g_agent_vector[a].m_GPSPointVector.size(); g++) { CAgent *p_agent = &(g_agent_vector[a]); double cumulative_distance = 0; fprintf(g_pFileTrace, "%d,%s,", g, p_agent->agent_id.c_str()); fprintf(g_pFileTrace, "%f,%f,", g_agent_vector[a].m_GPSPointVector[g].pt.x, g_agent_vector[a].m_GPSPointVector[g].pt.y); fprintf(g_pFileTrace, "%d,%d,%d,", g_agent_vector[a].m_GPSPointVector[g].global_time_in_second, g_agent_vector[a].m_GPSPointVector[g].interval_in_second, g_agent_vector[a].m_GPSPointVector[g].relative_time_in_second); fprintf(g_pFileTrace, "%f,%f,", g_agent_vector[a].m_GPSPointVector[g].distance, g_agent_vector[a].m_GPSPointVector[g].distance / max(1, g_agent_vector[a].m_GPSPointVector[g].interval_in_second)); fprintf(g_pFileTrace, "\n"); } } fclose(g_pFileTrace); } } int g_number_of_CPU_threads() { //int number_of_threads = omp_get_max_threads(); int number_of_threads = 1; if (number_of_threads <= g_max_number_of_threads) return number_of_threads; else return g_max_number_of_threads; } void g_OutputAgentCSVFile() { FILE *g_pFileAgent = nullptr; g_pFileAgent = fopen("agent.csv", "w"); if (g_pFileAgent == NULL) { cout << "File agent.csv cannot be opened." << endl; g_Program_stop(); } else { fprintf(g_pFileAgent, "agent_id,o_node_id,d_node_id,o_zone_id,d_zone_id,o_cell_id,d_cell_id,volume,departure_time,travel_time,distance,node_sequence,geometry\n"); for (int a = 0; a < g_agent_vector.size(); a++) { CAgent *p_agent = &(g_agent_vector[a]); int matching_link_from_node_id = -1; int matching_link_to_node_id = -1; int matching_link_id = -1; if (p_agent->matching_link_no >= 0) { matching_link_from_node_id = g_link_vector[p_agent->matching_link_no].from_node_id; matching_link_to_node_id = g_link_vector[p_agent->matching_link_no].to_node_id; matching_link_id = g_link_vector[p_agent->matching_link_no].link_id; } p_agent->distance = 0; for (int i = 0; i < p_agent->m_node_size - 2; i++) { int link_no = g_node_vector[p_agent->path_node_vector[i]].m_outgoing_link_seq_no_map[p_agent->path_node_vector[i + 1]]; p_agent->distance += g_link_vector[link_no].length; } p_agent->travel_time = p_agent->end_time_in_min - p_agent->start_time_in_min; fprintf(g_pFileAgent, "%s,%d,%d,%d,%d,%jd,%jd,%f,%f,%f,%f,", p_agent->agent_id.c_str(), p_agent->o_node_id, p_agent->d_node_id, p_agent->origin_zone_id, p_agent->destination_zone_id, p_agent->o_cell_id, p_agent->d_cell_id, p_agent->volume, p_agent->start_time_in_min, p_agent->travel_time, p_agent->distance); for (int i = 0; i < p_agent->path_node_vector.size(); i++) { fprintf(g_pFileAgent, "%d;", g_node_vector[p_agent->path_node_vector[i]].node_id); } fprintf(g_pFileAgent, ","); fprintf(g_pFileAgent, "\"LINESTRING ("); for (int i = 0; i < p_agent->path_link_vector.size(); i++) { int link_no = p_agent->path_link_vector[i]; //ASSERT(link_no >= 0); for (int gl = 0; gl < g_link_vector[link_no].m_PointVector.size(); gl++) { fprintf(g_pFileAgent, "%f %f,", g_link_vector[link_no].m_PointVector[gl].x, g_link_vector[link_no].m_PointVector[gl].y); } } fprintf(g_pFileAgent, ")\""); fprintf(g_pFileAgent, "\n"); } fclose(g_pFileAgent); } } void g_OutputCell2ZoneCSVFile() { FILE *g_pFileCell2Zone = nullptr; g_pFileCell2Zone = fopen("cell2zone.csv", "w"); if (g_pFileCell2Zone == NULL) { cout << "File cell2zone.csv cannot be opened." << endl; g_Program_stop(); } else { fprintf(g_pFileCell2Zone, "cell_id,zone_id\n"); // map<__int64, int>::iterator it; map<long long, int>::iterator it; for (it = g_cell_id_2_zone_id_map.begin(); it != g_cell_id_2_zone_id_map.end(); it++) { fprintf(g_pFileCell2Zone, "%jd,%d\n", it->first, it->second); } fclose(g_pFileCell2Zone); } } void g_OutputRouteCSVFile() { //FILE* g_pFileLinkRoute = nullptr; //g_pFileLinkRoute = fopen("route.csv", "w"); //if (g_pFileLinkRoute == NULL) //{ // cout << "File route.csv cannot be opened." << endl; // g_Program_stop(); //} //else //{ // fprintf(g_pFileLinkRoute, "agent_id,from_node_id,to_node_id,timestamp,cumu_distance,hhmmss,trace_id,travel_time,delay,geometry\n"); // for (int a = 0; a < g_agent_vector.size(); a++) // { // CAgent* p_agent = &(g_agent_vector[a]); // int travel_time_in_second; // int timestamp_in_upstreamnode = -1; // double cumulative_distance = 0; // for (int i = 0; i < p_agent->m_node_size - 1; i++) // { // fprintf(g_pFileLinkRoute, "%s,", p_agent->agent_id.c_str()); // int from_node_id = g_node_vector[p_agent->path_node_vector[i]].node_id; // int to_node_id = g_node_vector[p_agent->path_node_vector[i + 1]].node_id; // fprintf(g_pFileLinkRoute, "%d,%d,", from_node_id, to_node_id); // // timestamp // int link_no = p_agent->path_link_vector[i]; // int prev_link_index = max(0, i - 1); // int prev_link_no = p_agent->path_link_vector[prev_link_index]; // timestamp_in_upstreamnode = p_agent->path_time_index[prev_link_index]; // fprintf(g_pFileLinkRoute, "%d,", p_agent->path_time_index[i]); // cumulative_distance += g_link_vector[link_no].length; // fprintf(g_pFileLinkRoute, "%.2f,", cumulative_distance); // string timestamp_str = second2timestr(p_agent->path_time_index[i]); // fprintf(g_pFileLinkRoute, "%s,", timestamp_str.c_str()); // travel_time_in_second = p_agent->path_time_index[i] - timestamp_in_upstreamnode; // timestamp_in_upstreamnode = p_agent->path_time_index[i]; // recursive update // int trace_id = p_agent->path_link_matched_trace_id[i]; // //trace id // fprintf(g_pFileLinkRoute, "%d,", trace_id); // //travel time // fprintf(g_pFileLinkRoute, "%d,", max(0, travel_time_in_second)); // //delay // int delay = max(0, travel_time_in_second - g_link_vector[link_no].FFTT_in_sec); // fprintf(g_pFileLinkRoute, "%d,", delay); // travel_time_in_second = max(1, travel_time_in_second); // //update upstream node from the current link // fprintf(g_pFileLinkRoute, "\"%s\",", g_link_vector[link_no].geometry.c_str()); // fprintf(g_pFileLinkRoute, "\n"); // } // } // fclose(g_pFileLinkRoute); //} } void g_OutputLinklikelihoodCSVFile() { FILE *g_pFileLinkRoute = nullptr; g_pFileLinkRoute = fopen("link_likelihood.csv", "w"); if (g_pFileLinkRoute == NULL) { cout << "File link_likelihood.csv cannot be opened." << endl; g_Program_stop(); } else { fprintf(g_pFileLinkRoute, "from_node_id,to_node_id,cell_id,FFTT_in_sec,distance,o_distance,d_distance,accessbility_time,hit_count,use_count,balance,geometry\n"); for (int a = 0; a < g_link_vector.size(); a++) { if (g_link_vector[a].likelihood_distance < 998) { int from_node_id = g_link_vector[a].from_node_id; int to_node_id = g_link_vector[a].to_node_id; ; fprintf(g_pFileLinkRoute, "%d,%d,%jd,%d,%f,%f,%f,%d,%d,%d,%f,", from_node_id, to_node_id, g_link_vector[a].cell_id, g_link_vector[a].FFTT_in_sec, g_link_vector[a].likelihood_distance, g_link_vector[a].o_distance, g_link_vector[a].d_distance, g_link_vector[a].AccessibilityTime, g_link_vector[a].hit_count, g_link_vector[a].use_count, g_link_vector[a].balance); fprintf(g_pFileLinkRoute, "\"%s\"", g_link_vector[a].geometry.c_str()); fprintf(g_pFileLinkRoute, "\n"); } } fclose(g_pFileLinkRoute); } } void g_OutputTDRouteCSVFile() { FILE *g_pFileLinkRoute = nullptr; g_pFileLinkRoute = fopen("route.csv", "w"); if (g_pFileLinkRoute == NULL) { cout << "File route.csv cannot be opened." << endl; g_Program_stop(); } else { fprintf(g_pFileLinkRoute, "agent_id,cumu_time_in_sec,time_index,time_index_t,time_index_diff,travel_time_in_sec,timestamp_minute,from_node_id,to_node_id,length,FFTT_in_sec,delay_in_sec,cumu_distance,label_cost,hh,mm,ss,geometry,geometry_from_node,\n"); //hhmmss,trace_id,travel_time,delay,geometry for (int a = 0; a < g_agent_vector.size(); a++) { CAgent *p_agent = &(g_agent_vector[a]); int travel_time_in_second; int timestamp_in_upstreamnode = -1; float cumu_distance = 0; double cumulative_distance = 0; if (p_agent->path_link_vector.size() == 0) { fprintf(g_pFileLinkRoute, "%s\n", p_agent->agent_id.c_str()); continue; } for (int i = 0; i < p_agent->path_link_vector.size(); i++) { int link_no = p_agent->path_link_vector[i]; //ASSERT(link_no >= 0); cumu_distance += g_link_vector[link_no].length; float time_in_min = g_GetTimeInMinFromInterval(p_agent->path_time_vector[i]); int time_in_sec = (int)((time_in_min - p_agent->start_time_in_min) * 60.0 + 0.5); fprintf(g_pFileLinkRoute, "%s,", p_agent->agent_id.c_str()); fprintf(g_pFileLinkRoute, "%d,", time_in_sec); fprintf(g_pFileLinkRoute, "%d,", p_agent->path_time_vector[i]); travel_time_in_second = 0; fprintf(g_pFileLinkRoute, "%d,", p_agent->path_time_vector[i + 1]); int travel_time_index_diff = p_agent->path_time_vector[i + 1] - p_agent->path_time_vector[i]; travel_time_in_second = (int)(travel_time_index_diff * (60 * g_TimeResolution_inMin) + 0.5); fprintf(g_pFileLinkRoute, "%d,%d,", travel_time_index_diff, travel_time_in_second); int from_node_id = g_link_vector[link_no].from_node_id; int to_node_id = g_link_vector[link_no].to_node_id; fprintf(g_pFileLinkRoute, "%.2f,%d,%d,", time_in_min, from_node_id, to_node_id); fprintf(g_pFileLinkRoute, "%f,%d,%d,%f,", g_link_vector[link_no].length, g_link_vector[link_no].FFTT_in_sec, travel_time_in_second - g_link_vector[link_no].FFTT_in_sec, cumu_distance); fprintf(g_pFileLinkRoute, "%f,", p_agent->path_cost_vector[i]); int hh = time_in_min / 60; fprintf(g_pFileLinkRoute, "%d,", hh); int mm = time_in_min - hh * 60; fprintf(g_pFileLinkRoute, "%d,", mm); int ss = (time_in_min - hh * 60 - mm) * 60; fprintf(g_pFileLinkRoute, "%d,", ss); //fprintf(g_pFileLinkRoute, "%f,%f", g_node_vector[p_agent->path_node_vector[i]].pt.x, g_node_vector[p_agent->path_node_vector[i]].pt.y); fprintf(g_pFileLinkRoute, "\"LINESTRING ("); for (int gl = 0; gl < g_link_vector[link_no].m_PointVector.size(); gl++) { fprintf(g_pFileLinkRoute, "%f %f,", g_link_vector[link_no].m_PointVector[gl].x, g_link_vector[link_no].m_PointVector[gl].y); } fprintf(g_pFileLinkRoute, ")\","); fprintf(g_pFileLinkRoute, "\"POINT ("); int from_node_no = g_link_vector[link_no].from_node_seq_no; fprintf(g_pFileLinkRoute, "%f %f", g_node_vector[from_node_no].pt.x, g_node_vector[from_node_no].pt.y); fprintf(g_pFileLinkRoute, ")\","); fprintf(g_pFileLinkRoute, "\n"); } } } fclose(g_pFileLinkRoute); } bool g_LikelyRouteFinding() { //int number_of_threads = g_number_of_CPU_threads(); int number_of_threads = 1; g_pNetworkVector = new NetworkForSP[number_of_threads]; // create n copies of network, each for a subset of agents to use cout << "number of CPU threads = " << number_of_threads << endl; NetworkForSP *p_Network; for (int i = 0; i < number_of_threads; i++) { g_pNetworkVector[i].AllocateMemory(g_number_of_nodes, g_number_of_links); g_pNetworkVector[i].BuildGridSystem(); // called once } for (int a = 0; a < g_agent_vector.size(); a++) // { p_Network = &g_pNetworkVector[a % number_of_threads]; p_Network->m_agent_vector.push_back(a); } //#pragma omp parallel for for (int thread_no = 0; thread_no < number_of_threads; thread_no++) { if (g_time_dependent_computing_mode == 0) { g_OutputCell2ZoneCSVFile(); g_pNetworkVector[thread_no].find_path_for_agents_assigned_for_this_thread(); g_OutputAgentCSVFile(); g_OutputRouteCSVFile(); } if (g_time_dependent_computing_mode == 1) { g_pNetworkVector[thread_no].find_TD_path_for_agents_assigned_for_this_thread(); fprintf(g_pFileLog, "output agent.csv\n"); g_OutputAgentCSVFile(); fprintf(g_pFileLog, "output route.csv\n"); g_OutputTDRouteCSVFile(); } } cout << "End of Sequential Optimization Process. " << endl; fprintf(g_pFileLog, "end of optimization process\n"); return true; } // int main(int argc) void MapMatching4GMNS() { clock_t start_t, end_t, total_t; g_pFileLog = fopen("log.txt", "w"); if (g_pFileLog == NULL) { cout << "File log.txt cannot be opened." << endl; g_Program_stop(); } g_ReadInputData(); if (g_ReadInputAgentCSVFile() == false) { g_ReadTraceCSVFile(); } start_t = clock(); g_LikelyRouteFinding(); g_OutputTraceCSVFile(); g_OutputLinklikelihoodCSVFile(); end_t = clock(); total_t = (end_t - start_t); cout << "CPU Running Time = " << total_t / 1000.0 << " seconds" << endl; cout << "free memory.." << endl; cout << "done." << endl; //g_node_vector.clear(); //g_link_vector.clear(); //g_agent_vector.clear(); fclose(g_pFileLog); //return 1; }
[ "noreply@github.com" ]
noreply@github.com
84d6b7778af5241f1480026178d436ca3eb39cb1
e5e5e43423485340a25361420ed3bc8d2cfaa5d0
/question_5/couple.cpp
34fe3ff6ddc8a463bb818f02fd00f44f6946edeb
[]
no_license
PPL-IIITA/ppl-assignment-pt97
39d216e8a10eaf709b384d78d0360a44624f5a22
7015713e751aad193e8c7354b162b7e1cd2b2000
refs/heads/master
2021-01-21T06:21:27.247313
2017-04-09T20:46:51
2017-04-09T20:46:51
83,219,125
0
0
null
null
null
null
UTF-8
C++
false
false
6,036
cpp
#include "couple.h" #include <iostream> #include <string> #include "miser.h" #include "normal.h" using namespace std; void make1() { Miser boy_attr[50]; string name; int i,j,attr,intel,bud,min,pre,maint; fstream myfile; myfile.open ("boy.txt"); for(i=1;i<=50;i++) { myfile>>name>>attr>>intel>>bud>>min; boy_attr[i-1].setname(name); boy_attr[i-1].setbudget(bud); boy_attr[i-1].setcommitted(false); boy_attr[i-1].setattraction(attr); boy_attr[i-1].setminattraction(min); boy_attr[i-1].setintelligence(intel); } myfile.close(); myfile.open("girl.txt"); Normal girl_attr[30]; for(i=1;i<=30;i++) { myfile>>name>>attr>>intel>>maint>>pre; girl_attr[i-1].setname(name); girl_attr[i-1].setmaintenance(maint); girl_attr[i-1].setcommitted(false); girl_attr[i-1].setattraction(attr); girl_attr[i-1].setpreference(pre); girl_attr[i-1].setintelligence(intel); } myfile.close(); ofstream myfile1,myfile2; myfile1.open ("ans1.txt"); myfile2.open("temp1.txt"); for(i=1;i<=30;i++) { if(girl_attr[i-1].getpreference()==1&&girl_attr[i-1].getcommitted()==false) { int attract=0,temp=-1; for(j=1;j<=50;j++) { if(boy_attr[j-1].getcommitted()==false) { if(boy_attr[j-1].getminattraction()<=girl_attr[i-1].getattraction()) { if(boy_attr[j-1].getbudget()>=girl_attr[i-1].getmaintenance()) { if(boy_attr[j-1].getattraction()>attract) { attract=boy_attr[j-1].getattraction(); temp=j-1; } } } } } if(temp!=-1) { boy_attr[temp].setcommitted(true); girl_attr[i-1].setcommitted(true); cout<<boy_attr[temp].getname()<<" "<<girl_attr[i-1].getname()<<endl; myfile1<<boy_attr[temp].getname()<<" "<<girl_attr[i-1].getname()<<endl; myfile2<<boy_attr[temp].getname()<<" "<<rand()%3+1<<" "<<boy_attr[temp].getattraction()<<" "; myfile2<<boy_attr[temp].getintelligence()<<" "<<boy_attr[temp].getbudget()<<" "; myfile2<<girl_attr[i-1].getname()<<" "<<rand()%3+1<<" "<<girl_attr[i-1].getattraction()<<" "; myfile2<<girl_attr[i-1].getintelligence()<<" "<<girl_attr[i-1].getmaintenance()<<endl; } } if(girl_attr[i-1].getpreference()==2&&girl_attr[i-1].getcommitted()==false) { int rich=0,temp=-1; for(j=1;j<=50;j++) { if(boy_attr[j-1].getcommitted()==false) { if(boy_attr[j-1].getminattraction()<=girl_attr[i-1].getattraction()) { if(boy_attr[j-1].getbudget()>=girl_attr[i-1].getmaintenance()) { if(boy_attr[j-1].getbudget()>rich) { rich=boy_attr[j-1].getbudget(); temp=j-1; } } } } } if(temp!=-1) { boy_attr[temp].setcommitted(true); girl_attr[i-1].setcommitted(true); cout<<boy_attr[temp].getname()<<" "<<girl_attr[i-1].getname()<<endl; myfile1<<boy_attr[temp].getname()<<" "<<girl_attr[i-1].getname()<<endl; myfile2<<boy_attr[temp].getname()<<" "<<rand()%3+1<<" "<<boy_attr[temp].getattraction()<<" "; myfile2<<boy_attr[temp].getintelligence()<<" "<<boy_attr[temp].getbudget()<<" "; myfile2<<girl_attr[i-1].getname()<<" "<<rand()%3+1<<" "<<girl_attr[i-1].getattraction()<<" "; myfile2<<girl_attr[i-1].getintelligence()<<" "<<girl_attr[i-1].getmaintenance()<<endl; } } if(girl_attr[i-1].getpreference()==3&&girl_attr[i-1].getcommitted()==false) { int inteli=0,temp=-1; for(j=1;j<=50;j++) { if(boy_attr[j-1].getcommitted()==false) { if(boy_attr[j-1].getminattraction()<=girl_attr[i-1].getattraction()) { if(boy_attr[j-1].getbudget()>=girl_attr[i-1].getmaintenance()) { if(boy_attr[j-1].getintelligence()>inteli) { inteli=boy_attr[j-1].getintelligence(); temp=j-1; } } } } } if(temp!=-1) { boy_attr[temp].setcommitted(true); girl_attr[i-1].setcommitted(true); cout<<boy_attr[temp].getname()<<" "<<girl_attr[i-1].getname()<<endl; myfile1<<boy_attr[temp].getname()<<" "<<girl_attr[i-1].getname()<<endl; myfile2<<boy_attr[temp].getname()<<" "<<rand()%3+1<<" "<<boy_attr[temp].getattraction()<<" "; myfile2<<boy_attr[temp].getintelligence()<<" "<<boy_attr[temp].getbudget()<<" "; myfile2<<girl_attr[i-1].getname()<<" "<<rand()%3+1<<" "<<girl_attr[i-1].getattraction()<<" "; myfile2<<girl_attr[i-1].getintelligence()<<" "<<girl_attr[i-1].getmaintenance()<<endl; } } } cout<<endl<<"According to the happiness k couples are :---"<<endl; for(i=1;i<=5;i++) { cout<<boy_attr[i-1].getname()<<" "<<girl_attr[i-1+2*i].getname()<<endl; } myfile1.close(); myfile2.close(); }
[ "iit2015094@iiita.ac.in" ]
iit2015094@iiita.ac.in