Welcome to mirror list, hosted at ThFree Co, Russian Federation.

runner.h « bundle « cli « corehost « installer « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fb4d74bf877a2f23e6a352bfe027188a8a53f25b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#ifndef __RUNNER_H__
#define __RUNNER_H__

#include "error_codes.h"
#include "header.h"
#include "manifest.h"
#include "info.h"

// bundle::runner extends bundle::info to supports:
// * Reading the bundle manifest and identifying file locations for the runtime
// * Extracting bundled files to disk when necessary
// bundle::runner is used by HostPolicy.

namespace bundle
{
    class runner_t : public info_t
    {
    public:
        runner_t(const pal::char_t* bundle_path,
                 const pal::char_t *app_path,
                 int64_t header_offset)
            : info_t(bundle_path, app_path, header_offset) {}

        const pal::string_t& extraction_path() const { return m_extraction_path; }

        const file_entry_t *probe(const pal::string_t& path) const;
        bool locate(const pal::string_t& relative_path, pal::string_t& full_path) const;

        static StatusCode process_manifest_and_extract()
        {
            return ((runner_t*) the_app)->extract();
        }

        static const runner_t* app() { return (const runner_t*)the_app; }

    private:

        StatusCode extract();

        manifest_t m_manifest;
        pal::string_t m_extraction_path;
    };
}

#endif // __RUNNER_H__