Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sol-file-reader.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include "sol-str-slice.h"
22 #include "sol-types.h"
23 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
37 struct sol_file_reader;
39 
48 struct sol_file_reader *sol_file_reader_open(const char *filename);
49 
59 
65 void sol_file_reader_close(struct sol_file_reader *fr);
66 
76 
85 const struct stat *sol_file_reader_get_stat(const struct sol_file_reader *fr);
86 
100 
105 #ifdef __cplusplus
106 }
107 #endif
struct sol_blob * sol_file_reader_to_blob(struct sol_file_reader *fr)
convert an open file reader to a blob.
void sol_file_reader_close(struct sol_file_reader *fr)
Closes a file reader, releasing its memory.
struct sol_file_reader * sol_file_reader_from_fd(int fd)
Create a file reader from a file descriptor.
These routines are used for Soletta types' manipulation.
struct sol_str_slice sol_file_reader_get_all(const struct sol_file_reader *fr)
Get the content of the file as a sol_str_slice.
const struct stat * sol_file_reader_get_stat(const struct sol_file_reader *fr)
Retrieve stat information from a file.
String slice type.
Definition: sol-str-slice.h:84
static FILE * fd
Definition: download.c:28
Data type describing the default blob implementation.
Definition: sol-types.h:468
struct sol_file_reader * sol_file_reader_open(const char *filename)
Open a file using its filename.
These are routines that Soletta provides for its string slice implementation.
struct sol_file_reader sol_file_reader
Opaque handler for a file reader.
Definition: sol-file-reader.h:38