| 167 | } |
| 168 | |
| 169 | Source::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 | |
| 193 | Source::Source( const std::string& path ) : path( path ) {} |
| 194 |
nothing calls this directly
no test coverage detected