Exemplo n.º 1
0
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: void print(std::ostream& os) const
        public void print(std::ostream os)
        {
            for (var it = m_range.Item1; it != m_range.Item2; ++it)
            {
                os << '\n' << std::setw(21) << m_currency.formatAmount(it.second.amount) << ' ' << (it.second.address.empty() ? "<UNKNOWN>" : it.second.address) << ' ' << it.second.type;
            }
        }
Exemplo n.º 2
0
        // IStreamSerializable
        public override void save(std::ostream os)
        {
            m_logger.functorMethod(INFO, BRIGHT_WHITE) << "Saving...";
//C++ TO C# CONVERTER TODO TASK: There is no equivalent to 'reinterpret_cast' in C#:
            os.write(reinterpret_cast <const char>(m_genesisBlockHash), sizeof(Crypto.Hash));
            m_logger.functorMethod(INFO, BRIGHT_WHITE) << "Saved";
        }
Exemplo n.º 3
0
        // IStreamSerializable
        public void save(std::ostream os)
        {
            StdOutputStream stream = new StdOutputStream(os);

            CryptoNote.BinaryOutputStreamSerializer s = new CryptoNote.BinaryOutputStreamSerializer(stream);
            CryptoNote.GlobalMembers.serialize(s.functorMethod, "state");
        }
Exemplo n.º 4
0
        // IStreamSerializable
        public override void save(std::ostream os)
        {
            m_sync.save(os);

            StdOutputStream stream = new StdOutputStream(os);

            CryptoNote.BinaryOutputStreamSerializer s = new CryptoNote.BinaryOutputStreamSerializer(stream);
//C++ TO C# CONVERTER TODO TASK: There is no equivalent to 'const_cast' in C#:
            s.functorMethod(const_cast <uint&>(GlobalMembers.TRANSFERS_STORAGE_ARCHIVE_VERSION), "version");

            ulong subscriptionCount = m_consumers.Count;

            s.beginArray(ref subscriptionCount, "consumers");

            foreach (var consumer in m_consumers)
            {
                s.beginObject("");
//C++ TO C# CONVERTER TODO TASK: There is no equivalent to 'const_cast' in C#:
                s.functorMethod(const_cast <PublicKey&>(consumer.first), "view_key");

                std::stringstream consumerState = new std::stringstream();
                // synchronization state
                m_sync.getConsumerState(consumer.second.get()).save(consumerState);

                string blob = consumerState.str();
                s.functorMethod(blob, "state");

                List <AccountPublicAddress> subscriptions = new List <AccountPublicAddress>();
                consumer.second.getSubscriptions(subscriptions);
                ulong subCount = subscriptions.Count;

                s.beginArray(ref subCount, "subscriptions");

                foreach (var addr in subscriptions)
                {
                    var sub = consumer.second.getSubscription(addr);
                    if (sub != null)
                    {
                        s.beginObject("");

                        std::stringstream subState = new std::stringstream();
                        Debug.Assert(sub);
                        sub.getContainer().save(subState);
                        // store data block
                        string blob = subState.str();
                        s.functorMethod(addr, "address");
                        s.functorMethod(blob, "state");

                        s.EndObject();
                    }
                }

                s.EndArray();
                s.EndObject();
            }
        }
Exemplo n.º 5
0
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: void print(std::ostream& os) const
        public void print(std::ostream os)
        {
            os << '{';

            if (m_walletOrderList.Count > 0)
            {
                os << '<' << m_currency.formatAmount(m_walletOrderList[0].amount) << ", " << m_walletOrderList[0].address << '>';

                for (var it = std::next(m_walletOrderList.GetEnumerator()); it != m_walletOrderList.end(); ++it)
                {
                    os << '<' << m_currency.formatAmount(it.amount) << ", " << it.address << '>';
                }
            }

            os << '}';
        }
Exemplo n.º 6
0
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: std::ostream& printHttpResponse(std::ostream& os) const
        private std::ostream printHttpResponse(std::ostream os)
        {
            os << "HTTP/1.1 " << GlobalMembers.getStatusString(status) << "\r\n";

            foreach (var pair in headers)
            {
                os << pair.first << ": " << pair.second << "\r\n";
            }
            os << "\r\n";

            if (!string.IsNullOrEmpty(body))
            {
                os << body;
            }

            return(os);
        }
Exemplo n.º 7
0
//C++ TO C# CONVERTER WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: std::ostream& printHttpRequest(std::ostream& os) const
        private std::ostream printHttpRequest(std::ostream os)
        {
            os << "POST " << url << " HTTP/1.1\r\n";
            var host = headers.find("Host");

            if (host == headers.end())
            {
                os << "Host: " << "127.0.0.1" << "\r\n";
            }

            foreach (var pair in headers)
            {
                os << pair.first << ": " << pair.second << "\r\n";
            }

            os << "\r\n";
            if (!string.IsNullOrEmpty(body))
            {
                os << body;
            }

            return(os);
        }
Exemplo n.º 8
0
 public StdOutputStream(std::ostream @out)
 {
     this.@out = @out;
 }