summaryrefslogtreecommitdiff
path: root/gio/src/datainputstream.ccg
diff options
context:
space:
mode:
Diffstat (limited to 'gio/src/datainputstream.ccg')
-rw-r--r--gio/src/datainputstream.ccg30
1 files changed, 15 insertions, 15 deletions
diff --git a/gio/src/datainputstream.ccg b/gio/src/datainputstream.ccg
index 485c7b1e..8dd8b317 100644
--- a/gio/src/datainputstream.ccg
+++ b/gio/src/datainputstream.ccg
@@ -26,7 +26,7 @@ namespace Gio
bool DataInputStream::read_line(std::string& line, const Glib::RefPtr<Cancellable>& cancellable)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
char* c_line = g_data_input_stream_read_line(gobj(),
0, // pass NULL since we can easily determine the length from the returned std::string
Glib::unwrap(cancellable),
@@ -44,7 +44,7 @@ bool DataInputStream::read_line(std::string& line, const Glib::RefPtr<Cancellabl
bool DataInputStream::read_line(std::string& line)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
char* c_line = g_data_input_stream_read_line(gobj(),
0, // pass NULL since we can easily determine the length from the returned std::string
0,
@@ -65,7 +65,7 @@ void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::Re
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
- SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+ auto slot_copy = new SlotAsyncReady(slot);
g_data_input_stream_read_line_async(gobj(),
io_priority,
@@ -76,7 +76,7 @@ void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::Re
bool DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
gsize size = 0;
gchar* buffer = g_data_input_stream_read_line_finish(gobj(), Glib::unwrap(result), &size, &(gerror));
if(gerror)
@@ -85,7 +85,7 @@ bool DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result,
bool retval = false;
if(buffer && size)
{
- retval = (buffer != 0);
+ retval = (buffer != nullptr);
data = std::string(buffer, size);
g_free (buffer);
}
@@ -95,7 +95,7 @@ bool DataInputStream::read_line_finish(const Glib::RefPtr<AsyncResult>& result,
bool DataInputStream::read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
char* c_str = g_data_input_stream_read_until(gobj(),
stop_chars.c_str(),
0, // pass NULL since we can easily determine the length from the returned std::string
@@ -116,7 +116,7 @@ bool DataInputStream::read_until(std::string& data, const std::string& stop_char
*/
bool DataInputStream::read_until(std::string& data, const std::string& stop_chars)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
char* c_str = g_data_input_stream_read_until(gobj(),
stop_chars.c_str(),
0, // pass NULL since we can easily determine the length from the returned std::string
@@ -138,7 +138,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
- SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+ auto slot_copy = new SlotAsyncReady(slot);
g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(),
io_priority,
@@ -149,7 +149,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot
bool DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
gsize size = 0;
gchar* buffer = g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror));
if(gerror)
@@ -158,7 +158,7 @@ bool DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result,
bool retval = false;
if(buffer && size)
{
- retval = (buffer != 0);
+ retval = (buffer != nullptr);
data = std::string(buffer, size);
g_free (buffer);
}
@@ -169,7 +169,7 @@ bool DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result,
bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
char* c_str = g_data_input_stream_read_upto(gobj(),
stop_chars.c_str(), -1, /* null-terminated */
0, // pass NULL since we can easily determine the length from the returned std::string
@@ -190,7 +190,7 @@ bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars
*/
bool DataInputStream::read_upto(std::string& data, const std::string& stop_chars)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
char* c_str = g_data_input_stream_read_upto(gobj(),
stop_chars.c_str(), -1, /* null-terminated */
0, // pass NULL since we can easily determine the length from the returned std::string
@@ -215,7 +215,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
// and deleted in the callback.
- SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+ auto slot_copy = new SlotAsyncReady(slot);
g_data_input_stream_read_upto_async(gobj(), stop_chars.c_str(), -1, /* null-terminated */
io_priority,
@@ -226,7 +226,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA
bool DataInputStream::read_upto_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data)
{
- GError* gerror = 0;
+ GError* gerror = nullptr;
gsize size = 0;
gchar* buffer = g_data_input_stream_read_upto_finish(gobj(), Glib::unwrap(result), &size, &(gerror));
if(gerror)
@@ -235,7 +235,7 @@ bool DataInputStream::read_upto_finish(const Glib::RefPtr<AsyncResult>& result,
bool retval = false;
if(buffer && size)
{
- retval = (buffer != 0);
+ retval = (buffer != nullptr);
data = std::string(buffer, size);
g_free (buffer);
}