MCPcopy Create free account
hub / github.com/SpartanJ/eepp / Source

Method Source

src/tools/ecode/plugins/debugger/dap/protocol.cpp:169–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169Source::Source( const json& body ) :
170 name( body.value( DAP_NAME, "" ) ),
171 path( body.value( DAP_PATH, "" ) ),
172 sourceReference( parseOptionalInt( body, DAP_SOURCE_REFERENCE ) ),
173 presentationHint( parseOptionalString( body, DAP_PRESENTATION_HINT ) ),
174 origin( body.value( DAP_ORIGIN, "" ) ),
175 adapterData( body.contains( DAP_ADAPTER_DATA ) ? body[DAP_ADAPTER_DATA] : nlohmann::json{} ) {
176 // sources
177 if ( body.contains( DAP_SOURCES ) ) {
178 const auto values = body[DAP_SOURCES];
179 for ( const auto& item : values ) {
180 sources.emplace_back( Source( item ) );
181 }
182 }
183
184 // checksums
185 if ( body.contains( DAP_CHECKSUMS ) ) {
186 const auto values = body[DAP_CHECKSUMS];
187 for ( const auto& item : values ) {
188 checksums.emplace_back( Checksum( item ) );
189 }
190 }
191}
192
193Source::Source( const std::string& path ) : path( path ) {}
194

Callers

nothing calls this directly

Calls 6

parseOptionalIntFunction · 0.85
parseOptionalStringFunction · 0.85
SourceClass · 0.85
ChecksumClass · 0.85
valueMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected