mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
output signature too
This commit is contained in:
parent
0d95f17e19
commit
b99f699862
@ -363,6 +363,33 @@ output(ostream &out) const {
|
||||
<< " declarations.";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ConfigPage::output_brief_signature
|
||||
// Access: Published
|
||||
// Description: Outputs the first few hex digits of the signature.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ConfigPage::
|
||||
output_brief_signature(ostream &out) const {
|
||||
size_t num_bytes = min(_signature.size(), (size_t)8);
|
||||
for (size_t p = 0; p < num_bytes; ++p) {
|
||||
unsigned int byte = _signature[p];
|
||||
|
||||
unsigned int hi = (byte >> 4) & 0xf;
|
||||
if (hi >= 10) {
|
||||
out << (char)((hi - 10) + 'a');
|
||||
} else {
|
||||
out << (char)(hi + '0');
|
||||
}
|
||||
|
||||
unsigned int lo = byte & 0xf;
|
||||
if (lo >= 10) {
|
||||
out << (char)((lo - 10) + 'a');
|
||||
} else {
|
||||
out << (char)(lo + '0');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ConfigPage::write
|
||||
// Access: Published
|
||||
|
@ -67,6 +67,7 @@ PUBLISHED:
|
||||
bool is_variable_used(int n) const;
|
||||
|
||||
void output(ostream &out) const;
|
||||
void output_brief_signature(ostream &out) const;
|
||||
void write(ostream &out) const;
|
||||
|
||||
private:
|
||||
|
@ -432,9 +432,13 @@ write(ostream &out) const {
|
||||
const ConfigPage *page = (*pi);
|
||||
out << " " << page->get_name();
|
||||
if (page->get_trust_level() > 0) {
|
||||
out << " (signed " << page->get_trust_level() << ")\n";
|
||||
out << " (signed " << page->get_trust_level() << ": ";
|
||||
page->output_brief_signature(out);
|
||||
out << ")\n";
|
||||
} else if (!page->get_signature().empty()) {
|
||||
out << " (invalid signature)\n";
|
||||
out << " (invalid signature: ";
|
||||
page->output_brief_signature(out);
|
||||
out << ")\n";
|
||||
} else {
|
||||
out << "\n";
|
||||
}
|
||||
@ -445,9 +449,13 @@ write(ostream &out) const {
|
||||
const ConfigPage *page = (*pi);
|
||||
out << " " << page->get_name();
|
||||
if (page->get_trust_level() > 0) {
|
||||
out << " (signed " << page->get_trust_level() << ")\n";
|
||||
out << " (signed " << page->get_trust_level() << ": ";
|
||||
page->output_brief_signature(out);
|
||||
out << ")\n";
|
||||
} else if (!page->get_signature().empty()) {
|
||||
out << " (invalid signature)\n";
|
||||
out << " (invalid signature: ";
|
||||
page->output_brief_signature(out);
|
||||
out << ")\n";
|
||||
} else {
|
||||
out << "\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user