[go: up one dir, main page]

Menu

[r734]: / mfsclip.cpp  Maximize  Restore  History

Download this file

773 lines (697 with data), 22.7 kB

  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
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
/* Marcion
Copyright (C) 2009-2016 Milan Konvicka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
#include "mfsclip.h"
MFSClip::MFSClip() :
QFileInfoList(),
_state(None),
_files(),
_errs()
{
}
void MFSClip::clear()
{
QFileInfoList::clear();
_files.clear();
_errs.clear();
_state=None;
}
void MFSClip::printClipboard() const
{
m_msg()->MsgMsg(QObject::tr("content of clipboard:"));
for(int x=0;x<QFileInfoList::count();x++)
m_msg()->MsgMsg(QFileInfoList::at(x).absoluteFilePath());
QString msg(QObject::tr("items count: ")+QString::number(QFileInfoList::count())+QObject::tr("\nmode: "));
switch(_state)
{
case None :
msg.append("none");
break;
case Copy :
msg.append("copy");
break;
case Cut :
msg.append("cut");
break;
case Delete :
msg.append("delete");
break;
}
m_msg()->MsgInf(msg);
}
void MFSClip::cut(QFileInfo abs_fpath)
{
QFileInfoList::append(abs_fpath);
_state=Cut;
}
void MFSClip::copy(QFileInfo abs_fpath)
{
QFileInfoList::append(abs_fpath);
_state=Copy;
}
void MFSClip::remove(QFileInfo abs_fpath)
{
QFileInfoList::append(abs_fpath);
_state=Delete;
}
void MFSClip::scan_items()
{
_files.clear();
for(int x=0;x<QFileInfoList::count();x++)
{
QFileInfo const * fi(&QFileInfoList::at(x));
_files.append(MFSInfo(fi->absoluteFilePath(),fi));
if(fi->isDir()&&!fi->isSymLink())
scan_dir(*fi,fi);
}
}
void MFSClip::scan_dir(QFileInfo const & dir,QFileInfo const * base)
{
MDirLister dl;
dl.makeList(dir.absoluteFilePath());
MFileInfoItemListPtr & fil(dl.items_sorted());
//QFileInfoList fil=QDir(dir.absoluteFilePath()).entryInfoList(QDir::AllEntries|QDir::Hidden|QDir::System|QDir::NoDotAndDotDot);
for(int x=0;x<fil.count();x++)
{
QFileInfo const * fi(fil.at(x));
_files.append(MFSInfo(fi->absoluteFilePath(),base));
if(fi->isDir()&&!fi->isSymLink())
scan_dir(*fi,base);
}
}
/*void MFSClip::read_dir(QDir from_dir,QDir target_dir,unsigned long & items,CProgressDialog & pd)
{
QFileInfoList fil=from_dir.entryInfoList(QDir::AllEntries|QDir::Hidden|QDir::System|QDir::NoDotAndDotDot);
for(int x=0;x<fil.count();x++)
{
QFileInfo fi(fil.at(x));
items++;
pd.incProgress();
QString fn_from(fi.canonicalFilePath()),fn_to(target_dir.canonicalPath()+QDir::separator()+fi.fileName());
if(fi.isDir())
{
if(_state!=Delete)
{
QString msg(QObject::tr("creating directory '")+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(target_dir.mkdir(fi.fileName()))
{
if(!QFile(fn_to).setPermissions(QFile(fn_from).permissions()))
{
QString msg(QObject::tr("Warning: cannot set permissions for directory '")+fn_to+"' ...");
_errs.append(msg);
m_msg()->MsgMsg(msg);
}
read_dir(QDir(fn_from),QDir(fn_to),items,pd);
if(_state==Cut)
{
m_msg()->MsgMsg(QObject::tr("removing directory '")+fn_from+"' ...");
if(!QDir().rmdir(fn_from))
{
QString msg(QObject::tr("cannot remove directory '")+fn_to+"' ...");
_errs.append(msg);
m_msg()->MsgMsg(msg);
}
}
}
else
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
}
else
{
read_dir(QDir(fn_from),QDir(),items,pd);
QString msg(QObject::tr("removing directory '")+fn_from+"' ...");
m_msg()->MsgMsg(msg);
if(!QDir().rmdir(fi.canonicalFilePath()))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
}
}
else
{
switch(_state)
{
case None :
break;
case Cut :
{
QString msg(QObject::tr("moving '")+fn_from+"' -> '"+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(!QFile::rename(fn_from,fn_to))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
break;
}
case Copy :
{
QString msg(QObject::tr("copying '")+fn_from+"' -> '"+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(!QFile::copy(fn_from,fn_to))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
else if(!QFile(fn_from).setPermissions(QFile(fn_to).permissions()))
{
QString msg(QObject::tr("Warning: cannot set permissions for file '")+fn_to+"' ...");
_errs.append(msg);
m_msg()->MsgMsg(msg);
}
break;
}
case Delete :
{
QString msg(QObject::tr("deleting '")+fn_from+" ...");
m_msg()->MsgMsg(msg);
if(!QFile::remove(fn_from))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
break;
}
}
}
if(pd.stopped())
return;
}
}*/
bool MFSClip::moveItems(QDir const & target_dir,bool & interrupted)
{
unsigned long const items(QFileInfoList::count());
unsigned long r_items(0);
CProgressDialog pd;
pd.initProgress(QObject::tr("moving ..."),items);
pd.show();
QFileInfoList fi_list;
for(unsigned int x=0;x<items;x++)
{
QFileInfo const * fi(&QFileInfoList::at(x));
pd.incProgress();
QString fn_from(fi->absoluteFilePath()),fn_to(target_dir.absolutePath()+QDir::separator()+fi->fileName());
QString msg(QObject::tr("moving '")+fn_from+"' -> '"+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(!QFile::rename(fn_from,fn_to))
{
//msg.append(QObject::tr(" failed!"));
//_errs.append(msg);
fi_list.append(*fi);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
else
r_items++;
if(pd.stopped())
{
m_msg()->MsgInf(QObject::tr("interrupted, ")+QObject::tr("items moved: ")+QString::number(r_items)+QObject::tr(" from ")+QString::number(items));
return interrupted=true;
}
}
m_msg()->MsgMsg(QObject::tr("items moved: ")+QString::number(r_items)+QObject::tr(" from ")+QString::number(items));
QFileInfoList::operator=(fi_list);
interrupted=false;
return (fi_list.count()==0);
}
bool MFSClip::paste(QDir target_dir/*,QString const & names*/)
{
QString dtitle,qmsg,names;
bool targ(true);
switch(_state)
{
case None :
return false;
break;
case Cut :
dtitle=QObject::tr("cut");
qmsg=QObject::tr("Moving ");
break;
case Copy :
dtitle=QObject::tr("copy");
qmsg=QObject::tr("Copying ");
break;
case Delete :
dtitle=QObject::tr("delete");
qmsg=QObject::tr("Deleting ");
targ=false;
break;
}
for(int x=0;x<QFileInfoList::count();x++)
names.append(QFileInfoList::at(x).absoluteFilePath()+"\n");
if(targ)
names.append("\n"+QObject::tr("TO ")+target_dir.absolutePath()+"\n");
QMessageBox mb(QMessageBox::Question,dtitle+QObject::tr(" items"),qmsg+QObject::tr(" items:\n\n")+names+QObject::tr("\nContinue?"),QMessageBox::Ok|QMessageBox::Cancel);
if(mb.exec()!=QMessageBox::Ok)
{
if(_state==Delete)
clear();
return false;
}
QString _target(target_dir.absolutePath());
if(!target_dir.exists())
{
m_msg()->MsgErr(QObject::tr("target directory '")+_target+"' does not exist!");
return false;
}
USE_CLEAN_WAIT
if(_state==Cut)
{
bool interrupted(false);
bool r=moveItems(target_dir,interrupted);
if(r||interrupted)
return true;
else
m_msg()->MsgMsg(QObject::tr("some items cannot be renamed, there are still ")+QString::number(QFileInfoList::count())+QObject::tr(" items to process"));
}
scan_items();
unsigned long const items(_files.count());
unsigned long r_items(0);
CProgressDialog pd;
switch(_state)
{
case None :
break;
case Cut :
pd.initProgress(QObject::tr("moving ..."),items);
break;
case Copy :
pd.initProgress(QObject::tr("copying ..."),items);
break;
case Delete :
pd.initProgress(QObject::tr("deleting ..."),items);
break;
}
pd.show();
m_msg()->MsgMsg(QObject::tr("paste ")+QString::number(items)+QObject::tr(" items"));
for(unsigned int x=0;x<items;x++)
{
MFSInfo const * fi(&_files.at(x));
r_items++;
pd.incProgress();
QString fn_from(fi->absoluteFilePath()),fn_to(target_dir.absolutePath()+QDir::separator()+fi->relativeToItem());
if(fi->isDir()&&!fi->isSymLink())
{
if(_state!=Delete)
{
QString msg(QObject::tr("creating directory '")+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(fi->isSymLink())
{
QString ltg(linkTarget(*fi)),
msgsl(QObject::tr("creating link '")+fn_to+QObject::tr("', target: '")+ltg+"' ...");
m_msg()->MsgMsg(msgsl);
if(!QFile::link(ltg,fn_to))
{
msgsl.append(QObject::tr(" failed!"));
_errs.append(msgsl);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
}
else
{
if(QDir().mkdir(fn_to))
{
if(!QFile(fn_to).setPermissions(fi->permissions()))
{
QString msg(QObject::tr("Warning: cannot set permissions for directory '")+fn_to+"' ...");
_errs.append(msg);
m_msg()->MsgMsg(msg);
}
}
else
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
}
}
}
else
{
switch(_state)
{
case None :
break;
case Cut :
/*{
QString msg(QObject::tr("moving '")+fn_from+"' -> '"+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(!QFile::rename(fn_from,fn_to))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
break;
}*/
case Copy :
{
QString msg(QObject::tr("copying '")+fn_from+"' -> '"+fn_to+"' ...");
m_msg()->MsgMsg(msg);
if(fi->isSymLink())
{
QString ltg(linkTarget(*fi)),
msgsl(QObject::tr("creating link '")+fn_to+QObject::tr("', target: '")+ltg+"' ...");
m_msg()->MsgMsg(msgsl);
if(!QFile::link(ltg,fn_to))
{
msgsl.append(QObject::tr(" failed!"));
_errs.append(msgsl);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
}
else
{
if(!QFile::copy(fn_from,fn_to))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
else if(!QFile(fn_to).setPermissions(fi->permissions()))
{
QString msg(QObject::tr("Warning: cannot set permissions for file '")+fn_to+"' ...");
_errs.append(msg);
m_msg()->MsgMsg(msg);
}
else if(_state==Cut)
goto lbl_delete;
}
break;
}
case Delete :
{
lbl_delete:
QString msg(QObject::tr("deleting '")+fn_from+"' ...");
m_msg()->MsgMsg(msg);
if(!QFile::remove(fn_from))
{
msg.append(QObject::tr(" failed!"));
_errs.append(msg);
m_msg()->MsgMsg(QObject::tr("failed!"));
}
break;
}
}
}
if(pd.stopped())
{
m_msg()->MsgInf(QObject::tr("interrupted, ")+QObject::tr("items completed: ")+QString::number(r_items)+QObject::tr(" from ")+QString::number(items));
return true;
}
}
if(_state==Cut||_state==Delete)
for(int x=((long)items)-1;x>=0;x--)
{
MFSInfo const * fi(&_files.at(x));
if(fi->isDir()&&!fi->isSymLink())
{
m_msg()->MsgMsg(QObject::tr("removing directory '")+fi->absoluteFilePath()+"' ...");
if(!QDir().rmdir(fi->absoluteFilePath()))
{
QString msg(QObject::tr("cannot remove directory '")+fi->absoluteFilePath()+"' ...");
_errs.append(msg);
m_msg()->MsgMsg(msg);
}
}
}
m_msg()->MsgMsg(QString::number(r_items)+QObject::tr(" completed"));
printErrs();
if(_state==Cut||_state==Delete)
clear();
return true;
}
/*unsigned long MFSClip::count_dir() const
{
unsigned long items(0);
for(int x=0;x<QFileInfoList::count();x++)
{
QFileInfo fi(QFileInfoList::at(x));
items++;
if(fi.isDir())
count_dir2(QDir(fi.canonicalFilePath()),items);
}
return items;
}
void MFSClip::count_dir2(QDir dir,unsigned long & items) const
{
QFileInfoList fil(dir.entryInfoList(QDir::AllEntries|QDir::Hidden|QDir::System|QDir::NoDotAndDotDot));
for(int x=0;x<fil.count();x++)
{
QFileInfo fi(fil.at(x));
items++;
if(fi.isDir())
count_dir2(QDir(fi.canonicalFilePath()),items);
}
}*/
void MFSClip::printErrs()
{
int c(_errs.count());
if(c==0)
m_msg()->MsgMsg(QObject::tr("finished, no errors"));
else
{
m_msg()->MsgInf(QObject::tr("finished, ")+QString::number(c)+QObject::tr(" errors occurred"));
m_msg()->MsgMsg(_errs.join("\n"));
}
}
QString MFSClip::linkTarget(QFileInfo const & fileinfo)
{
#ifndef Q_WS_WIN
int size(0xff);
char * buffer(0);
while(true)
{
if(buffer)
delete [] buffer;
buffer = new char[size];
if(buffer)
{
int nchars = readlink(fileinfo.absoluteFilePath().toUtf8().constData(), buffer, size);
if(nchars<0)
{
if(buffer)
delete [] buffer;
return QString();
}
if(nchars<size)
{
buffer[nchars]=0;
QString rv(buffer);
delete [] buffer;
return rv;
}
size*=2;
}
else
return QString();
}
#else
return QString();
#endif
}
/*bool MFSClip::createLink(QFileInfo const & fileinfo,QString const & target)
{
return (symlink(fileinfo.absoluteFilePath().toUtf8().data(),target.toUtf8().data())==0);
}*/
// MFSInfo
MFSInfo::MFSInfo(QString const & path,QFileInfo const * base) :
QFileInfo(path),
_base(base)
{
}
MFSInfo::MFSInfo(MFSInfo const & other) :
QFileInfo(other),
_base(other._base)
{
}
/*MFSInfo MFSInfo::operator=(MFSInfo const & other)
{
*this=other;
_rel=other._rel;
return *this;
}*/
QString MFSInfo::relativeToItem() const
{
return absoluteFilePath().remove(QRegExp(QString("^")+QRegExp::escape(_base->absolutePath()+QDir::separator())));
}
// MDirLister
MDirLister::MDirLister() :
_dir(0),
_dir_entry(0),
_dirname(),
_error_text(),
_files(),
_sorted()
{
}
int MDirLister::countFilesInDir(QString const & dirname)
{
int count(0);
DIR * dir=opendir(dirname.toUtf8().data());
if(dir)
{
dirent * entry(0);
while((entry=readdir(dir))){
if(!(strcmp(entry->d_name,".")==0||strcmp(entry->d_name,"..")==0))
{
struct stat stat_entry;
QString const fullname(dirname+QDir::separator()+QString::fromUtf8(entry->d_name));
stat(fullname.toUtf8().data(),&stat_entry);
count++;
if(S_ISDIR(stat_entry.st_mode))
count+=countFilesInDir(fullname);
}
}
closedir(dir);
}
return count;
}
/*int MDirLister::count_files_in_dir(QString const & dirname)
{
int count(0);
DIR * dir=opendir(dirname.toUtf8().data());
dirent * entry(0);
while((entry=readdir(dir))){
if(!(strcmp(entry->d_name,".")==0||strcmp(entry->d_name,"..")==0))
{
count++;
if(entry->d_type==DT_DIR)
count+=count_files_in_dir(QString(dirname+QDir::separator()+QString::fromUtf8(entry->d_name)),count);
}
}
closedir(dir);
return count;
}*/
bool MDirLister::openDir(QString const & dirname)
{
_dirname=dirname;
_dir=0;
_dir_entry=0;
_dir=opendir(_dirname.toUtf8().data());
if(!_dir)
_error_text=QString(QObject::tr("cannot scan directory '")+_dirname+"'");
return _dir;
}
bool MDirLister::closeDir()
{
int r=closedir(_dir);
if(r==-1)
_error_text=QString(QObject::tr("cannot close directory stream!"));
return (r!=-1);
}
bool MDirLister::readDir()
{
read_again:
_dir_entry=readdir(_dir);
if(!_dir_entry)
{
closeDir();
return false;
}
if(strcmp(_dir_entry->d_name,".")==0||strcmp(_dir_entry->d_name,"..")==0)
goto read_again;
return true;
}
QString MDirLister::dirItemName() const
{
return QString::fromUtf8(_dir_entry->d_name);
}
QByteArray MDirLister::dirItemNameRaw() const
{
return QByteArray(_dir_entry->d_name);
}
QString MDirLister::dirItemPath(bool add_separator) const
{
QString path(_dirname);
if(add_separator)
path.append(QDir::separator());
path.append(dirItemName());
return path;
}
MFileInfoItem MDirLister::dirItem() const
{
MFileInfoItem mfi(dirItemPath(true));
mfi._raw_name=dirItemNameRaw();
return mfi;
}
int MDirLister::makeList(QString const & dirname)
{
_sorted.clear();
_files.clear();
MFileInfoItemListPtr unsorted_f,unsorted_d;
if(openDir(dirname))
{
while(readDir())
_files.append(dirItem());
for(int x=0;x<_files.count();x++)
{
MFileInfoItem const * fi(&_files.at(x));
if(fi->isDir())
unsorted_d.append(fi);
else
unsorted_f.append(fi);
}
}
MFileInfoItemListPtr * fi_lists[]={&unsorted_d,
&unsorted_f,
0};
for(MFileInfoItemListPtr ** clist=&fi_lists[0];
*clist;clist++)
while((*clist)->count()>0)
{
MFileInfoItem const* first((*clist)->first());
int findex=0;
for(int x=0;x<(*clist)->count();x++)
{
MFileInfoItem const * cur((*clist)->at(x));
if(cur!=first)
if(QString::compare(first->fileName(),cur->fileName(),Qt::CaseSensitive)>0)
{
first=cur;
findex=x;
}
}
_sorted.append(first);
(*clist)->removeAt(findex);
}
return _sorted.count();
}
// MFileInfoItem
MFileInfoItem::MFileInfoItem(QString const & file) :
QFileInfo(file),
_raw_name()
{
}
MFileInfoItem::MFileInfoItem(MFileInfoItem const & other) :
QFileInfo(other),
_raw_name(other._raw_name)
{
}
MFileInfoItem & MFileInfoItem::operator=(MFileInfoItem const & other)
{
QFileInfo::operator=(other);
_raw_name=other._raw_name;
return *this;
}